The settings in httpd.conf are similar and different after the Windows environment is changed from Apache2.2 to Apache2.4.
1. Change of permission setting method
2.2 Use Order Deny / Allow method, 2.4 switch to Require
apache2.2:
Order deny,allow
Deny from all
apache2.4:
Require all denied
The more commonly used ones here are as follows:
Require all denied Require all granted Require host xxx.com Require ip 192.168.1 192.168.2 Require local
Note: If there are any settings in the htaccess file, they must also be modified
2. Change the logging mode setting
RewriteLogLevel command is changed to logLevel
The first value set by LOGLEVEL is the default level for the entire Apache, followed by The logging level of this module can be modified for the specified module
For example:
LogLevel warn rewrite: warn
3, Namevirtualhost is removed
4, More modules need to be loaded
To enable Gzip, mod_deflate needs to be loaded in apache2.2, and mod_filter and mod_deflate need to be loaded in apache2.4
To enable SSL, in apache2.2 Mod_ssl needs to be loaded in, mod_socache_shmcb and mod_ssl need to be loaded in apache2.4
5. Recommended settings in the windows environment
EnableSendfile Off EnableMMAP Off
When the Log log appears It is recommended to set
AcceptFilter http none AcceptFilter https none
when there are errors such as AcceptEx failed. Note: Win32DisableAcceptEx is replaced by AcceptFilter None in apache2.4.
6, Listen setting Adjustment
Taking 443 as an example, you cannot only set Listen 443
The following error will occur:
(OS 10048) Only one communication address (protocol/network address) can be used at a time /connection): AH00072: make_sock: could not bind to address [::]:443
(OS 10048) Only one communication end address (protocol/network address/connection) can be used at a time: AH00072: make_sock: could not bind to address 0.0.0.0:443
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
Therefore, you need to specify the listening IP, and you can set multiple
For more Apache related technical articles, please visit theApache usage tutorialcolumn to learn!
The above is the detailed content of Apache 2.2 2.4 difference. For more information, please follow other related articles on the PHP Chinese website!