Forum Moderators: phranque

Message Too Old, No Replies

httpd.conf file

         

jshpik1

11:58 am on Aug 23, 2007 (gmt 0)

10+ Year Member



I found that extremly useful ban list of the ages on here. Very useful info. Anyway I have a question about the httpd.conf file which was mentioned.

.htaccess is starting to get pretty big with bans and rewrites, etc. Since .htaccess is used on every server request httpd.conf would be a better option for the ban list, correct? The only thing it requires a server restart in order for the server to start recognizing the new rules. Am I correct here? Also, the httpd.conf file is placed in the root directory and controls all directories below that, just like .htaccess?

How do I verify that the rules are being used? Note that I'm on shared hosting so I probably have the same permissions any shared customer has.

Thanks.

jdMorgan

12:59 pm on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're on shared hosting, it is extremely unlikely that you'll have access to httpd.conf, since that is the configuration file for the entire server. On a dedicated server you can reasonably expect httpd.conf access. On a virtual private server, you might have access to httpd.conf or more likely conf.d, depending on how the VPS is configured. But on common shared virtual hosting you either:
A) Won't have httpd.conf access,
or
B) Will have access, in which case, you need to get away from that host as soon as possible, since other users will be able to re-configure your site and you'll be able to re-configure theirs... It would be a security nightmare!

Httpd.conf is also invoked for every HTTP request to the server. The difference is that code in httpd.conf is compiled at server startup, and runs as "raw executable code" for each request. In contrast, code in .htaccess in interpreted for each HTTP request, and must be translated all the way from the original text-characters to executable code for each HTTP request.

If you're not familiar with the differences between compiling and interpreting code, a search for these terms will turn up many references in general programming discussions and documents. An example of compiled code is "C", while an example of interpreted code is PERL.

Jim