You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Florin <fl...@yahoo.fr> on 2005/04/09 18:22:00 UTC
[users@httpd] index.htm recognized in virtual host, but not index.html
Hello everybody!
I subscribed to this list because I think I found a bug in Apache
2.0.53, but I might be wrong.
I have apache 2.0.53 + apache 1.3.33 running in proxied mode on a dual
Xeon 2.6GHz with Mandrake Linux 9.2.
The machine hosts a main domain, let's say www.<my_domain>.ro and some
virtual hosts named like:
www.<vhost1>.<my_domain>.ro
<vhost2>.<my_domain>.ro
<vhost3>.<my_domain>.ro
All the vhosts are CNAME for www.<my_domain>.ro in DNS.
The configuration for vhost1, vhost2 and vhost3 in vhosts/Vhosts.conf is
identically made except that the DocumentRoot and CustomLog sections
point to different locations, such as:
vhost1 has DocumentRoot /home/user1/public_html
vhost2 has DocumentRoot /home/user2/public_html
vhost3 has DocumentRoot /var/www/html/vhost3.my_domain.ro
Here comes the problem: when vhost1 directoty index is
"/home/user1/public_html/index.html", trying to access
www.vhost1.my_domain.ro with a web browser results in 403 error
("Directory index forbidden by rule" in log files). Accessing
www.vhost1.my_domain.ro/index.html works correctly. Replacing index.html
with index.htm and accessing www.vhost1.my_domain.ro also works.
In the same time vhost2 and vhost3 have no problem in recognising both
index.htm or index.htmo as index file.
Trying to replace DocumentRoot for vhost1 with /home/user2/public_html
and accessing www.vhost1.my_domain.ro results in the same problem of
only recognizing index.htm as index for vhost1. Replacing DocumentRoot
for both vhost2 or vhost3 with /home/user1/public_html and accessing
vhost2.my_domain.ro, respectively vhost3.my_domain.ro does not generate
any problem for vhost2 or vhost3 to recognize index.html as index file,
so I can certify the problem does not come from file/dir permissions.
The only things that seems to be at the origin of the problem is the
CNAME for vhost1, where there is a "www" before "vhost1".
The same configuration files *did* work correctly with apache-2.0.47
Using the port 8200 (where apache 1.3.33 runs as mod_perl proxy) does
not show the same problem as does the port 80, so it's only specific to
apache-2.0.53.
Did anybody have the same problem, or am I missing something? I suppose
this must be a bug in apache 2.0.53.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] index.htm recognized in virtual host, but not index.html
Posted by Joshua Slive <js...@gmail.com>.
On 09 Apr 2005 21:29:33 +0300, Florin <fl...@yahoo.fr> wrote:
> Don't mind the "RevriteEngine" blabla, I had to write it for each vhost,
> because I noticed it wasn't inherited from the commonhttpd.conf file and
> it really fixes some security issues.
Not really. In fact, apache doesn't have any TRACK method, so that is
completely unnecessary, and TRACE is not a real security
vulnerability. Don't believe everything your security scanner tells
you.
> So I still don't understand why what works for vhost2 and 3 do not work
> for vhost1.
> I must add that there is nothing concerning *any* of the vhosts in the
> commonhttpd.conf or any of the other .conf files.
> And also, trying DirectoryIndex index.html in the www.vhost1 section do
> not help at all.
> And also, if adding Option +Indexes I obtain the directory index.
> It really seems the "www" thing causes the problem, if I modify the
> CNAME in the DNS config (yes, I do have access to it, since I'm the
> administrator of that domain) and remove the www there and in
> Vhosts.conf, it starts working. Yet I don't understand why, cause it
> shouldn't.
> Doesn't apache 2.0.53 support subdomain/hostname-with-a-dot-in-it
> addresses anymore?
Apache doesn't care at all about the contents of the hostname.
> NameVirtualHost www.vhost1.my_domain.ro
> <VirtualHost www.vhost1.my_domain.ro>
This is not an optimal configuration. You should have one
NameVirtualHost directive for each IP address that your server uses
or, more simply, just use "NameVirtualHost *:80". The <VirtualHost>
container should contain the same thing. The only place you should
use the domain name is in the ServerName directive.
I don't see why this would cause the problem you are seeing, but it is
certainly something you should fix.
Other than that, I suggest looking carefully for any <Directory>
section, Alias, or RewriteRule that could be affecting requests to
/home/vhost1/public_html.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] index.htm recognized in virtual host, but not
index.html
Posted by Florin <fl...@yahoo.fr>.
Sorry, I didn't mean to insult anybody; it's just that in my first post
I tried to be as clear as possible and give as much detail as I could.
I'm sure it can't be a vhost configuration problem, that's all. The
configs for all vhosts on that server were made by copy/paste.
So here's my Vhosts.conf ( a little modified to hide the real names ).
Don't mind the "RevriteEngine" blabla, I had to write it for each vhost,
because I noticed it wasn't inherited from the commonhttpd.conf file and
it really fixes some security issues.
So I still don't understand why what works for vhost2 and 3 do not work
for vhost1.
I must add that there is nothing concerning *any* of the vhosts in the
commonhttpd.conf or any of the other .conf files.
And also, trying DirectoryIndex index.html in the www.vhost1 section do
not help at all.
And also, if adding Option +Indexes I obtain the directory index.
It really seems the "www" thing causes the problem, if I modify the
CNAME in the DNS config (yes, I do have access to it, since I'm the
administrator of that domain) and remove the www there and in
Vhosts.conf, it starts working. Yet I don't understand why, cause it
shouldn't.
Doesn't apache 2.0.53 support subdomain/hostname-with-a-dot-in-it
addresses anymore? I used the www.vhost1.my_domain.ro CNAME because the
subgroup using/administering that virtual page requested it, and it
worked for several years till now, so it would be a bit embarassing to
change their web address or impose them to only use index.htm file.
I even tried downgrading back to 2.0.47 and it started working again;
but I can't keep that version, it has serious security holes.
NameVirtualHost www.vhost1.my_domain.ro
<VirtualHost www.vhost1.my_domain.ro>
ServerName www.vhost1.my_domain.ro
CustomLog /var/log/httpd/vhost1/access_log combined
DocumentRoot /home/vhost1/public_html
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</VirtualHost>
NameVirtualHost vhost2.my_domain.ro
<VirtualHost vhost2.my_domain.ro>
ServerName vhost2.my_domain.ro
CustomLog /var/log/httpd/vhost2/access_log combined
DocumentRoot /var/www/html/vhost2.my_domain.ro/
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</VirtualHost>
NameVirtualHost vhost3.my_domain.ro
<VirtualHost vhost3.my_domain.ro>
ServerName vhost3.my_domain.ro
CustomLog /var/log/httpd/vhost3/access_log combined
DocumentRoot /home/vhost3/public_html
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</VirtualHost>
On Sat, 2005-04-09 at 20:55, Joshua Slive wrote:
> On 09 Apr 2005 19:59:20 +0300, Florin <fl...@yahoo.fr> wrote:
> > Nope! :)
> > *If* you would have read attentively my previous post, you would have
> > noticed that:
> > - this couldn't be explained why it *actually works* with apache 1.3.33
> > - also why it *did* work with apache 2.0.47 and no longer works in
> > 2.0.53?
> > I am not a novice and DirectoryIndex was the first thing I looked at.
> > You should look too:
>
> Not a good idea to start by insulting the person trying to help you.
>
> *Everyone* says "I didn't change anything and now it doesn't work",
> and in 99% of cases they did change something. And the fact that you
> did not mention your DirectoryIndex directive to start with meant that
> there was no point in going further without verifying it was set
> correctly. I don't read minds.
>
> So you say it fails in only one of three vhosts. So why don't you
> show us the config of that vhost. Also, try using a much simpler
> DirectoryIndex directive, and placing it within a <Directory
> /home/user1/public_html> within the relevant vhost.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] index.htm recognized in virtual host, but not index.html
Posted by Joshua Slive <js...@gmail.com>.
On 09 Apr 2005 19:59:20 +0300, Florin <fl...@yahoo.fr> wrote:
> Nope! :)
> *If* you would have read attentively my previous post, you would have
> noticed that:
> - this couldn't be explained why it *actually works* with apache 1.3.33
> - also why it *did* work with apache 2.0.47 and no longer works in
> 2.0.53?
> I am not a novice and DirectoryIndex was the first thing I looked at.
> You should look too:
Not a good idea to start by insulting the person trying to help you.
*Everyone* says "I didn't change anything and now it doesn't work",
and in 99% of cases they did change something. And the fact that you
did not mention your DirectoryIndex directive to start with meant that
there was no point in going further without verifying it was set
correctly. I don't read minds.
So you say it fails in only one of three vhosts. So why don't you
show us the config of that vhost. Also, try using a much simpler
DirectoryIndex directive, and placing it within a <Directory
/home/user1/public_html> within the relevant vhost.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] index.htm recognized in virtual host, but not
index.html
Posted by Florin <fl...@yahoo.fr>.
Nope! :)
*If* you would have read attentively my previous post, you would have
noticed that:
- this couldn't be explained why it *actually works* with apache 1.3.33
- also why it *did* work with apache 2.0.47 and no longer works in
2.0.53?
I am not a novice and DirectoryIndex was the first thing I looked at.
You should look too:
[root@www conf]# grep -i DirectoryIndex *
commonhttpd.conf:# DirectoryIndex: Name of the file or files to use as a
pre-written HTML
commonhttpd.conf: DirectoryIndex index.html index.html.var index.php
index.php3 index.shtml index.cgi index.pl index.htm Default.htm
default.htm index.xml
[root@www conf]#
There's no other DirectoryIndex set anywhere else.
Florin
On Sat, 2005-04-09 at 19:43, Joshua Slive wrote:
> On 09 Apr 2005 19:22:00 +0300, Florin <fl...@yahoo.fr> wrote:
> > Hello everybody!
> > I subscribed to this list because I think I found a bug in Apache
> > 2.0.53, but I might be wrong.
>
> Unlikely that this is a bug.
>
> More likely you have the DirectoryIndex directive set incorrectly someplace.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] index.htm recognized in virtual host, but not index.html
Posted by Joshua Slive <js...@gmail.com>.
On 09 Apr 2005 19:22:00 +0300, Florin <fl...@yahoo.fr> wrote:
> Hello everybody!
> I subscribed to this list because I think I found a bug in Apache
> 2.0.53, but I might be wrong.
Unlikely that this is a bug.
More likely you have the DirectoryIndex directive set incorrectly someplace.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org