Author |
|
jnl2
Joined: 16 Oct 2015 Posts: 3 Location: San Rafael, CA
|
Posted: Sat 17 Oct '15 0:04 Post subject: httpd-default.conf vs httpd.conf ?? |
|
|
Apache 2.4.9
as part of WAMP 2.5
I'm a newbie with servers
I'm reading a post online regarding securing ones Apache server. It suggests modifying the httpd-default.conf configuration file for versions 2.0 and greater. I also see in my file system that a httpd.conf file exists elsewhere in the file system. That file (httpd.conf) is recommended modified for versions less than 2.0.
I'm curious, what are the differences between the two files? i.e. Why are there two files when apparently one sufficed in the past.
Cheers. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sat 17 Oct '15 9:55 Post subject: |
|
|
httpd.conf
Is the main Apache HTTP server configuration file.
httpd-default.conf:
Reflects some extra default settings.
Look in the files and you see it. |
|
Back to top |
|
jnl2
Joined: 16 Oct 2015 Posts: 3 Location: San Rafael, CA
|
Posted: Tue 20 Oct '15 23:02 Post subject: Ok. Thanks. |
|
|
I suspected that much, but wanted to be sure. Thanks for the input.
Which file would the following settings be added to for Apache versions greater than 2.0?
Code: | <Directory />
Order Deny,Allow
Deny from all
Options None
AllowOverride None
</Directory> |
Code: | <Directory C:/apache2/htdocs>
Order Allow,Deny
Allow from all
</Directory | > |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 21 Oct '15 15:48 Post subject: |
|
|
Both are needed. the second one is for the document root and the first one for the root of the file system.
Both configs work only for 2.0 and 2.2
2.4 uses a different syntax.
if you still use 2.0 or 2.2 you should upgrade to 2.4 asap. if you still use 1.3 ... well that is a whole different story |
|
Back to top |
|
jnl2
Joined: 16 Oct 2015 Posts: 3 Location: San Rafael, CA
|
Posted: Wed 28 Oct '15 22:45 Post subject: follow up |
|
|
Thanks for introducing the proper terminology to me for those script snippets. I am running Apache v2.4.9
Follow up:
1. Are both snippets of script accurate; good syntax?
2. Do both snippets get added to the httpd-default.config file?
Thank you for the help. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 29 Oct '15 11:34 Post subject: |
|
|
With 2.4 it is
Code: |
<Directory />
AllowOverride none
Options none
Require all denied
</Directory>
|
Code: |
<Directory C:/apache2/htdocs>
Require all granted
</Directory
|
|
|
Back to top |
|