Forum Moderators: phranque

Message Too Old, No Replies

.htaccess won't load in virtual domain

         

ParaNoya

6:57 pm on May 18, 2004 (gmt 0)

10+ Year Member



Hi there,

I've encountered some problems with using .htaccess files under my virtual domain www.example.com
This domain is located at the server with the server name servername-b.org.
I have my own home directory on this server namely /home/paranoya/ in this directory I have my public_html directory in which my old website was located and I have my example_html directory in which the web site www.example.com is located.
Now the problem is that apache does not use any .htaccess file I have located in the example_html directory. But when I place a .htaccess file under the public_html it will do its job correctly.

Well after a brief search on the internet I found out I had to allow the usage of .htaccess files for my example_html directory.

after having a look at my httpd.conf I saw that it was set up like this for all the public html directories:

<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Options Indexes
Options MultiViews -Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

So I figured this would probably the same for my example_html directory, therefore I added the following:

<Directory /home/paranoya/example_html>
AllowOverride FileInfo AuthConfig Limit Options Indexes
Options MultiViews -Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

Well guess what this didn't help a bit I still couldn't make use of any of my .htaccess files located under example_html directory.

So after trying some more I also found out some other weird thing. I have placed a .htaccess file in one of the underlying directories of the public_html directory. This one denies a directorylisting of that dir. This works nicely when I browse to that directory using the following URL: [servername-b.org ]

BUT my public_html directory is also linked to the my paranoya.example.com domain. So when I browsed to the same location, through my www.example.com domain, using this URL: [paranoya.example.com ]
The .htaccess file is ignored again as you can see.

So it seems that apache ignores all .htaccess files "under" my example.com domain. I've searched for hours to find a solution and I just have the feeling that it is something very elementary I'm missing here. :)

Can someone please help me out?

[edited by: jdMorgan at 7:04 pm (utc) on May 18, 2004]
[edit reason] Removed specifics per WebmasterWorld TOS [/edit]

jdMorgan

7:07 pm on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ParaNoya,

Welcome to WebmasterWorld [webmasterworld.com]!

Quick question... Did you restart Apache after editing httpd.conf?

Jim

ParaNoya

9:41 pm on May 18, 2004 (gmt 0)

10+ Year Member



Hi jdMorgan,

thx for the welcome.

Yep I did restart apache so that wasn't the problem.

gergoe

10:20 pm on May 18, 2004 (gmt 0)

10+ Year Member



Did you checked the standard error log of the apache or the error log of your virtual host for any error/warning related to this issue? Is there no additional restrictions placed in your virtual host container with the httpd.conf?

ParaNoya

5:16 pm on May 19, 2004 (gmt 0)

10+ Year Member



Finally I have solved the problem!

After changing:

<Directory /home/paranoya/example_html>

into

<Directory /var/www/htdocs/hosts/*example.com>

in my httpd.conf file everything worked out just fine!