MySQL is one of the most popular database management systems. The installation of the software can be completed with the following commands:. During the installation you might be prompted to set root password for the MySQL service. If not, you can set the root password after completion of the installation using the following command:.
PHP is one of the most used open-source scripting languages preferred by the web developers. The software installation can be completed with the following commands:. Consult your distribution's documentation for Apache-specific file locations. It can compress data, implement caching, resize files, and remove unnecessary whitespace from configuration files.
There are binaries on the project's webpage for Ubuntu. To download and install on a bit Ubuntu system, type the following:. This module is enabled when it is installed and should begin optimizing content when you reload the server, but you can configure many different optimization and monitoring functions from within the configuration file. It is an application firewall that can prevent exposing vulnerabilities to the internet.
This module is in Ubuntu's default repositories, so it can be installed with the following command:. Read the configuration file and adjust the values based on the needs of your site. Most of the default configuration settings are okay. When you are ready to apply the settings, you can change the "SecRuleEngine" rule to read "On" instead of "DetectionOnly":.
This will implement your rules and begin applying them to your sites. You will need to reload your Apache instance for these rules to take affect:. One of the most helpful and easiest modules to configure comes pre-installed and configured when you install Apache on Ubuntu. You can edit the configuration file in the "mods-available" directory with the following command:. Once again, be sure that the IP address you input is the computer you are using to access the server, and not the server's IP address.
Navigate to the server-status page you have defined by typing the following into your web browser:. You will be given a stats page that will give you information and text-based indications of your server's performance and load.
Rapidly refreshing the page will allow you to see how activity is shown. The Spamhaus module enables you to block attackers by denying request from a blacklist of IP addresses that are known to be bad. Once again, this module is in Ubuntu's default repositories. Install is with the following command:. Instead of the content, it generates error codes and messages inside the tags:. You can confirm that ModSecurity worked by looking for code at the Apache error logs with the command:.
Another method you can use to test ModSecurity is to use a B ash script. Type one of the keywords from the rule into the form. In this example: enlarge, Nigerian, or gold. If we had specified an individual. You should now have a solid understanding of how to install, set up, and configure ModSecurity on Apache. Make sure you installed the LAMP stack properly before following the steps in this guide.
Introduction ModSecurity is a plug-in module for Apache that works like a firewall. Note: Ubuntu has a slightly different syntax for the ModSecurity package. Was this article helpful? Goran Jevtic.
0コメント