logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: httpd-default.conf vs httpd.conf ??
Author
jnl2



Joined: 16 Oct 2015
Posts: 3
Location: San Rafael, CA

PostPosted: Sat 17 Oct '15 0:04    Post subject: httpd-default.conf vs httpd.conf ?? Reply with quote

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

PostPosted: Sat 17 Oct '15 9:55    Post subject: Reply with quote

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

PostPosted: Tue 20 Oct '15 23:02    Post subject: Ok. Thanks. Reply with quote

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

PostPosted: Wed 21 Oct '15 15:48    Post subject: Reply with quote

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 Wink
Back to top
jnl2



Joined: 16 Oct 2015
Posts: 3
Location: San Rafael, CA

PostPosted: Wed 28 Oct '15 22:45    Post subject: follow up Reply with quote

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

PostPosted: Thu 29 Oct '15 11:34    Post subject: Reply with quote

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


Reply to topic   Topic: httpd-default.conf vs httpd.conf ?? View previous topic :: View next topic
Post new topic   Forum Index -> Apache