Welcome to WebmasterWorld Guest from 34.204.191.31

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

AllowOverridesNone keeps changing to AllowOverridesAll

After changing httpd.conf to disallow overrides and saving, it changes back

     
5:41 pm on Feb 5, 2008 (gmt 0)

Full Member

10+ Year Member

joined:May 5, 2003
posts: 319
votes: 0


I have a client who's running a dedicated Apache web server, who is having a configuration problem. He wants to set AllowOverride None in httpd.conf, but, everytime he sets and saves this command, it changes back to AllowOverride All, a few minutes later. What other configuration file has control over httpd.conf, to cause this to revert, against his wishes?

He is using mod_access to block unwanted traffic and some of my mod_rewrite directives. Does the use of a mod_rewrite directive in a .htaccess affect the directives set in httpd.conf, or is he mistyping something in httpd.conf?

He has provided me with this additional information:


I use a .htaccess in my public_html folder for easy FTP changes, but I
have it set as an Include in httpd.conf. I set "AllowOverride None"
for better performance.

< snip >

I'm having some trouble with one of your directives:

RewriteBase /

I Include .htaccess file in httpd.conf. Apache won't restart, so then
I run "apachectl configtest" I get this error:

Syntax error on line 162 of /home/EXAMPLE/public_html/.htaccess:
RewriteBase: only valid in per-directory config files

Line 162 corresponds to the "Rewritebase /" directive. When I comment
it out I can restart Apache OK. Any idea what's the matter with this?


Thanks in advance.
10:09 pm on Feb 6, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


This is some script that your client's host is running, probably to enforce a 'standard environment' for all hosted sites. It is also possible that the standard AllowOverride setting is required so that the host's control panel and 'standard script support' packages will work properly.

I'd recommend that you/he contact the hosting company.

Jim

10:17 pm on Feb 6, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


... and as indicated by the error message, RewriteBase can only be used in .htaccess, not httpd.conf, conf.d, or other server-config files.

Jim

10:33 pm on Feb 6, 2008 (gmt 0)

Full Member

10+ Year Member

joined:May 5, 2003
posts: 319
votes: 0


Thanks Jim. I will pass this info on to him. He already has begun undoing some of these httpd directives to see what else they are affecting.

Interestingly, and possibly related, I wrote some consolidated RedirectMatch rules for him and some of these rules used the Regular Expression term: \d and \d{1,2} - to redirect old pages to new ones. many of these rules use back references and some had double back references. I tested all of the codes on my own server and they worked as designed. However, on his server, all of the redirects using the \d failed until I changed them to [0-9]. His server is running Apache 1.3, while mine is at 2.26. I tested on my server and the \d worked fine. Is this a known issue with Apache 1.3 (problems with RegExpr and back references)?

[edited by: Wizcrafts at 10:33 pm (utc) on Feb. 6, 2008]

12:33 am on Feb 7, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Not Apache-related at all, but rather related to the POSIX Regular Expressions library bundled with the operating system. For best results, use the regex "styles" given in the mod_alias and mod_rewrite documentation and examples. Note that the 'tokens' such as "\d" are not mentioned, and several differences in the rules of character-escaping exist between Apache modules and various scripting languages -- for example, in Apache, it's not necessary to escape the "/" character, because it has no meaning as a pattern delimiter as it does in PERL.

Jim

12:59 am on Feb 7, 2008 (gmt 0)

Full Member

10+ Year Member

joined:May 5, 2003
posts: 319
votes: 0


Jim, thanks for explaining that so concisely. I will keep these differences in mind from now on. It seems that every application I use that supports Regular Expressions has a different interpretor.

Wiz