[Apache] Apache conversion from 2.2 to 2.4 httpd.conf (Windows environment)

Source: Internet
Author: User

Original address: Http://www.dotblogs.com.tw/maplenote/archive/2012/07/20/apache24_httpd_conf.aspx

Sort out the setup notes and problems with the Windows environment that changed from Apache 2.2 to Apache 2.4.1 httpd.conf

If you are interested, you can first look at the official document stating the difference of 2.4 (I certainly am ...). Didn't read Orz)

Http://httpd.apache.org/docs/2.4/upgrading.html

Http://httpd.apache.org/docs/2.4/new_features_2_4.html

/*2012.12.25 Refill */

Apache 2.4.3 version of the Windows version of the SSL bug is fixed, bug said http://www.apachelounge.com/viewtopic.php?p=22306

The bug is simply that it will let the 443 page link hang ...

1. The rights setting is changed more

Originally using Order deny/allow , instead of Require

Official Example:

2.2 Configuration:
Order deny,allowdeny      from all

In 2.4 need to change into

2.4 Configuration:
Require all denied

The more commonly used are the following kinds of

Require all denied

Require all granted

Require Host xxx.com

Require IP 192.168.1 192.168.2

Require Local

Note: If any of the settings are set in . htaccess also change

Detailed instructions stating: Http://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require

2. Setting the Log recording mode becomes more

Rewriteloglevel instruction changed to LogLevel

LogLevel Setting the first value is the preset level for the entire Apache setting, and you can modify the Log records for this module for the specified module.

Example:

LogLevel warn Rewrite:warn

Detailed instructions please view: http://httpd.apache.org/docs/2.4/mod/core.html#loglevel

3. Namevirtualhost is removed

Although I check the official documents there are still namevirtualhost instructions, but it will be wrong to perform.

The official document also writes that this directive is currently useless, so delete this setting.

Details: Http://httpd.apache.org/docs/2.4/mod/core.html#namevirtualhost

4. Other modules to be loaded more

Using Web site compression In addition to opening the mod_deflate, you need to open more mod_filter in Apache 2.4

In addition to opening mod_ssl, the SSL procured certificate requires more MOD_SOCACHE_SHMCB in Apache 2.4

5. Settings in Windows environment advice

Enablesendfile OFF

Enablemmap OFF

Also, when Log has a AcceptEx failed , it is proposed to adjust the following setting

acceptfilter http None

#AcceptFilter HTTPS None this line of Apache 2.4.1 can not be connected to 443, so I did not set, in the Apache 2.4.3 version of the normal operation

Bug fix Files: http://www.apachelounge.com/viewtopic.php?p=22306

Instructions for stating Http://httpd.apache.org/docs/2.4/mod/core.html#acceptfilter

Note: The WIN32DISABLEACCEPTEX directive was replaced by Acceptfilter None in apache2.4

Related articles:

http://www.neo.com.tw/archives/000223

http://www.iteye.com/news/24881

http://www.apachelounge.com/viewtopic.php?t=4450

6. Listen Setting adjustment

Take 443 as an example, you can not only set Listen 443

The following bugs will appear

(OS 10048) can only use one message end address at a time (Message agreement/network address/port). : AH00072:make_sock:could not bind to address [::]:443

(OS 10048) can only use one message end address at a time (Message agreement/network address/port). : 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 IP that you want to listen to, and you can set multiple

For example:

Listen 192.168.2.1:443

Listen 127.0.0.1:443

Other common bugs:

One day a sudden effort to tide test can be opened. htaccess's file, it's scary to start.

The original httpd.conf preset is not open. ht* 's setting fails!

<files ". ht*" >

Require all denied

</Files>

The results of the test, the <Files> and <FilesMatch> inhttpd.conf is completely ineffective!

I'm not sure if I have a relationship with <VirtualHost> (actually I'm not so familiar with httpd.conf, I've been stabbed to the neck.) =A)

After a half-day of torture, it was finally discovered that the use of locationmatch to make it work.

Because I didn't get to htpasswd, so I'm not afraid. Ht* 's file was opened .... So it's the first way to solve this lame foot.

For example:

<locationmatch "\.SVN" >

Require all denied

</LocationMatch>

Note: The locationmatch of the sub-tier is set, and the instruction should be under the row of the parent layer, otherwise it will be covered

and cannot be set to ". ht*"!

Because the Server is unable to read. ht* information ... Of course, it's not going to run.

The other is . htaccess ,<files> and <FilesMatch> may fail

And there's no way to set Locationmatch ... in htaccess. (sighs atmosphere)

In my environment, the. htaccess of Server 2008 is in effect,

But in the Win7 environment, placed in the second layer of the folder. htaccess is effective if the third folder is placed. htaccess will fail.

One of the whole tricks ... I had to look at it first as a BUG

[Apache] Apache conversion from 2.2 to 2.4 httpd.conf (Windows environment)

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.