UbuntuLinux: Apache installation settings-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Install Apache2
Sudo apt-get install apache2
Edit the/etc/apache2/apache2.conf file. before modifying the file, back up the configuration file. In this way, you can recover an error.
In this way, we won't go through the garbled code every time we open the web page!
Add the security Module to ensure the normal operation of Apache services. Now we have installed mod-security. (Optional)
First install the libapache2-mod-security package
Sudo apt-get install libapache2-mod-security
This module is not activated by default, we can see a mod-security.load file in the/etc/apache2/mod-available Directory, but there is no soft link in the/etc/apache2/mod-enabled directory. Now we activate it:
# When matching sh, redirect to a special warning page. This page is self-written. If you write some warnings, attackers may be unable to leave the page. This section will not take effect first, it is not too late to expire after the relevant configuration is configured. Remember to make it take effect after configuration.
# SecFilter sh redirect: http: // localhost/hack/warning.htm
# Prevent OS specific keywords
# Filter sensitive things. We use * to prevent attackers from using/etc/./passwd.
SecFilter/etc/passwd => SecFilter/etc/* passwd
SecFilter/bin/* sh
# Very crude filters to prevent SQL injection attacks
Note: The third step may cause some websites to fail to run normally. You can refer to removing some restrictions. Because it is a security module, you can refer to the firewall approach to turn off all insecure services, then open the necessary information as needed.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.