You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by anand nalya <an...@gmail.com> on 2008/01/25 15:35:53 UTC
[users@httpd] httpd 2.0.54 VHost not working
Hi,
I've Apache httpd version 2.0.54 on Redhat Linux Fedora 4. I'm trying to
configure name based virtual hosts on it. Here are the relavent
fragments from the httpd.conf:
DocumentRoot /var/www/html
NameVirtualHost 10.76.6.1:80
<VirtualHost 10.76.6.1:80>
DocumentRoot /var/www/html/sub
ServerName sub.mydomain.com
</VirtualHost>
<VirtualHost 10.76.6.1:80>
DocumentRoot /var/www/html/www
ServerName www.mydomain.com
</VirtualHost>
The problem is that none of the virtual hosts is working.
For example, when I request a document with Hostname as sub.mydomain.com it
returns files from the default root /var/www/html. If the virtual host were
working, then it should return files from /var/www/html/sub.
Am I missing something??
Thanks in advance,
Anand Nalya
Re: [users@httpd] httpd 2.0.54 VHost not working
Posted by anand nalya <an...@gmail.com>.
The issue is solved. I needed to do some configuration in sw,conf
On 28/01/2008, anand nalya <an...@gmail.com> wrote:
>
> Thanks for the quick response.
>
> These are the contents of xaccess_log.
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
> 10.76.6.6 - - [28/Jan/2008:13:07:13 +0530] 10.76.6.1:80 www.mydomain.com
> www.mydomain.com "GET /index.html HTTP/1.1"
> /usr/local/skunk/docroot/index.html 200 1198 "
>
> 10.76.6.6 - - [28/Jan/2008:13:10:17 +0530] 10.76.6.1:80 sub.mydomain.com
> sub.mydomain.com "GET /index.html HTTP/1.1"
> /usr/local/skunk/docroot/sub/index.html 200 1198 "
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> I think, there is some problem with the skunk module. Now I'm starting to
> look into it.
> Thanks for the pointer.
>
> On 28/01/2008, Axel-Stephane SMORGRAV <
> Axel-Stephane.SMORGRAV@europe.adp.com> wrote:
> >
> > Could you:
> >
> > 1. add the following lines at the server-level of your configuration:
> >
> > LogFormat "%h %l %u %t %A:%p %v %V \"%r\" %f %>s %b \"" extended
> > CustomLog /var/logs/www/xaccess_log extended
> >
> > 2. restart your server
> >
> > 3. Perform the request you claim fails to be executed in the VH context
> >
> > 4. Post the contents of /var/logs/www/xaccess_log
> >
> > -ascs
> >
> >
>
Re: [users@httpd] httpd 2.0.54 VHost not working
Posted by anand nalya <an...@gmail.com>.
Thanks for the quick response.
These are the contents of xaccess_log.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
10.76.6.6 - - [28/Jan/2008:13:07:13 +0530] 10.76.6.1:80 www.mydomain.com
www.mydomain.com "GET /index.html HTTP/1.1"
/usr/local/skunk/docroot/index.html 200 1198 "
10.76.6.6 - - [28/Jan/2008:13:10:17 +0530] 10.76.6.1:80 sub.mydomain.com
sub.mydomain.com "GET /index.html HTTP/1.1"
/usr/local/skunk/docroot/sub/index.html 200 1198 "
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
I think, there is some problem with the skunk module. Now I'm starting to
look into it.
Thanks for the pointer.
On 28/01/2008, Axel-Stephane SMORGRAV <Ax...@europe.adp.com>
wrote:
>
> Could you:
>
> 1. add the following lines at the server-level of your configuration:
>
> LogFormat "%h %l %u %t %A:%p %v %V \"%r\" %f %>s %b \"" extended
> CustomLog /var/logs/www/xaccess_log extended
>
> 2. restart your server
>
> 3. Perform the request you claim fails to be executed in the VH context
>
> 4. Post the contents of /var/logs/www/xaccess_log
>
> -ascs
>
>
RE: [users@httpd] httpd 2.0.54 VHost not working
Posted by Axel-Stephane SMORGRAV <Ax...@europe.adp.com>.
Could you:
1. add the following lines at the server-level of your configuration:
LogFormat "%h %l %u %t %A:%p %v %V \"%r\" %f %>s %b \"" extended
CustomLog /var/logs/www/xaccess_log extended
2. restart your server
3. Perform the request you claim fails to be executed in the VH context
4. Post the contents of /var/logs/www/xaccess_log
-ascs
________________________________
De : anand nalya [mailto:anand.nalya@gmail.com]
Envoyé : lundi 28 janvier 2008 07:11
À : users@httpd.apache.org
Objet : Re: [users@httpd] httpd 2.0.54 VHost not working
Hi,
The exact configuration is:
Listen 10.76.6.1:80
UseCanonicalName Off
DocumentRoot /var/www/html
NameVirtualHost 10.76.6.1:80 <http://10.76.6.1/>
<VirtualHost 10.76.6.1:80 <http://10.76.6.1/> >
DocumentRoot /var/www/html/www/sub
ServerName sub.mydomain.com <http://sub.mydomain.com/>
</VirtualHost>
<VirtualHost 10.76.6.1:80 <http://10.76.6.1/> >
DocumentRoot /var/www/html/www
ServerName www.mydomain.com <http://www.mydomain.com/>
</VirtualHost>
And I'm using telnet to test virtual hosts with proper host names.
Is there any way, I can trace how apache is finding the absolute path of the file to be served.
Thanks,
Anand Nalya
On 25/01/2008, Axel-Stephane SMORGRAV <Ax...@europe.adp.com> wrote:
Do you happen to have a Listen directive somewhere in the config for that address of yours?
Listen 10.76.6.1:80
Furthermore, are you sure that the request contains a host header with one of the VH servernames?
Try to type in the following at a shell prompt ($ is a prompt):
$ telnet 10.76.6.1 80
GET /index.html HTTP/1.1
Host: www.mydomain.com
Connection: close
Make sure to press CR twice after the last line. Make sure you have a file named index.html in /var/www/html/www
BR
-ascs
---------------------------------------------------------------------
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] httpd 2.0.54 VHost not working
Posted by anand nalya <an...@gmail.com>.
Hi,
The exact configuration is:
Listen 10.76.6.1:80
UseCanonicalName Off
DocumentRoot /var/www/html
NameVirtualHost 10.76.6.1:80 <http://10.76.6.1/>
<VirtualHost 10.76.6.1:80 <http://10.76.6.1/>>
DocumentRoot /var/www/html/www/sub
ServerName sub.mydomain.com
</VirtualHost>
<VirtualHost 10.76.6.1:80 <http://10.76.6.1/>>
DocumentRoot /var/www/html/www
ServerName www.mydomain.com
</VirtualHost>
And I'm using telnet to test virtual hosts with proper host names.
Is there any way, I can trace how apache is finding the absolute path of the
file to be served.
Thanks,
Anand Nalya
On 25/01/2008, Axel-Stephane SMORGRAV <Ax...@europe.adp.com>
wrote:
>
> Do you happen to have a Listen directive somewhere in the config for that
> address of yours?
>
> Listen 10.76.6.1:80
>
> Furthermore, are you sure that the request contains a host header with one
> of the VH servernames?
>
> Try to type in the following at a shell prompt ($ is a prompt):
>
> $ telnet 10.76.6.1 80
> GET /index.html HTTP/1.1
> Host: www.mydomain.com
> Connection: close
>
>
> Make sure to press CR twice after the last line. Make sure you have a file
> named index.html in /var/www/html/www
>
> BR
> -ascs
>
> ---------------------------------------------------------------------
> 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] httpd 2.0.54 VHost not working
Posted by Axel-Stephane SMORGRAV <Ax...@europe.adp.com>.
De : anand nalya [mailto:anand.nalya@gmail.com]
Envoyé : vendredi 25 janvier 2008 15:36
À : users@httpd.apache.org
Objet : [users@httpd] httpd 2.0.54 VHost not working
> Hi,
>
> I've Apache httpd version 2.0.54 on Redhat Linux Fedora 4. I'm trying to configure name based virtual hosts on it. Here are the relavent fragments from the httpd.conf:
>
> DocumentRoot /var/www/html
>
> NameVirtualHost 10.76.6.1:80
>
> <VirtualHost 10.76.6.1:80>
> DocumentRoot /var/www/html/sub
> ServerName sub.mydomain.com
> </VirtualHost>
>
> <VirtualHost 10.76.6.1:80>
> DocumentRoot /var/www/html/www
> ServerName www.mydomain.com
> </VirtualHost>
>
> The problem is that none of the virtual hosts is working.
> For example, when I request a document with Hostname as sub.mydomain.com it returns files from the default root /var/www/html. If the virtual host were working, then it should return files from /var/www/html/sub.
>
> Am I missing something??
>
Do you happen to have a Listen directive somewhere in the config for that address of yours?
Listen 10.76.6.1:80
Furthermore, are you sure that the request contains a host header with one of the VH servernames?
Try to type in the following at a shell prompt ($ is a prompt):
$ telnet 10.76.6.1 80
GET /index.html HTTP/1.1
Host: www.mydomain.com
Connection: close
Make sure to press CR twice after the last line. Make sure you have a file named index.html in /var/www/html/www
BR
-ascs
---------------------------------------------------------------------
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