How to put online the Apache 2.4 Server

Share

If you find yourself googling in order to make your new local server work online, you’ve come to the right place. Most Web Server packages today (WAMP, XAMPP or Uniform Server) are configured to work with the “old” Apache 2.2 version and have a major flaw. Since 2.4, Apache has dropped the directive “Allow” in favour of the new directive “Require”.

Therefore, in order to make your aliases work and also to put your Apache Server configuration online, you must edit the configuration file and make two changes:

1. For aliases, find  and replace “Allow from all” with “Require all granted”.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<Directory "[...]/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
<Directory "[...]/www/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny Allow from all </Directory>
1
2
3
4
5
6
<Directory "[...]/www/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order allow,deny
    Allow from all
</Directory>
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<Directory "[...]/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
</Directory>
<Directory "[...]/www/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Require all granted </Directory>
1
2
3
4
5
<Directory "[...]/www/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Require all granted
</Directory>

2. To put server online, you must edit the httpd.conf and find the setting:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<Directory "[...]/www/">
# [...] comments
Require local
</Directory>
<Directory "[...]/www/"> # [...] comments Require local </Directory>
1
2
3
4
<Directory "[...]/www/">
    # [...] comments
    Require local
</Directory>

and replace it with:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<Directory "[...]/www/">
# [...] comments
Require all granted
</Directory>
<Directory "[...]/www/"> # [...] comments Require all granted </Directory>
1
2
3
4
<Directory "[...]/www/">
    # [...] comments
    Require all granted
</Directory>

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close