Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Virtual hosts not working

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  iis clustering  
Author Message
zaphod

External


Since: Aug 13, 2007
Posts: 3



(Msg. 1) Posted: Mon Aug 13, 2007 3:25 pm
Post subject: Virtual hosts not working
Archived from groups: alt>apache>configuration (more info?)

CentOS 5
Apache 2.2.3


I've configured Apache with virtual hosting to run 3 domains, 2 pointing to:

/var/www/html/danny

..... and the 3rd pointing to:

/var/www/html/richmond

However, all requests for www.therichmondstudio.co.uk return pages from the
other domain: www.dannyisrael.co.uk

??

The domain 'therichmondstudio.co.uk' correctly resolves to the same IP as
the server machine as you can see from the 'dig' commands listed below.

Garry


*************** httpd config ******************************

ServerName danisrael.vm.bytemark.co.uk:80

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.therichmondstudio.co.uk
ServerAdmin garry RemoveThis @usableit.co.uk
DocumentRoot /var/www/html/richmond
</VirtualHost>

<VirtualHost *:80>
ServerName www.dannyisrael.com
ServerAdmin garry RemoveThis @usableit.co.uk
DocumentRoot /var/www/html/danny
</VirtualHost>

<VirtualHost *:80>
ServerName www.dannyisrael.co.uk
ServerAdmin garry RemoveThis @usableit.co.uk
DocumentRoot /var/www/html/danny
</VirtualHost>


*********************************************************
; <<>> DiG 9.3.3rc2 <<>> danisrael.vm.bytemark.co.uk
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6970
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;danisrael.vm.bytemark.co.uk. IN A

;; ANSWER SECTION:
danisrael.vm.bytemark.co.uk. 86400 IN A 80.68.88.120

**********************************************************

; <<>> DiG 9.3.3rc2 <<>> therichmondstudio.co.uk
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36335
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;therichmondstudio.co.uk. IN A

;; ANSWER SECTION:
therichmondstudio.co.uk. 86400 IN A 80.68.88.120

***********************************************************

 >> Stay informed about: Virtual hosts not working 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2994



(Msg. 2) Posted: Mon Aug 13, 2007 3:25 pm
Post subject: Re: Virtual hosts not working [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived

 >> Stay informed about: Virtual hosts not working 
Back to top
Login to vote
zaphod

External


Since: Aug 13, 2007
Posts: 3



(Msg. 3) Posted: Mon Aug 13, 2007 3:25 pm
Post subject: Re: Virtual hosts not working [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Davide Bianchi wrote:
> On 2007-08-13, zaphod <abc.DeleteThis@def.com> wrote:
>> I've configured Apache with virtual hosting to run 3 domains, 2 pointing to:
>>
>> /var/www/html/danny
>>
>> .... and the 3rd pointing to:
>>
>> /var/www/html/richmond
>
> Are you sure that the directory /richmond contains a different html than
> the other two? From what you said and what I can see, the vhost works
> fine but the html returned is not the right one.
>
> The configuration looks correct.
>
> What does an apachectl configtest resturns? Have you restarted your
> apache service?
>
> Davide
>

httpd -S output:

VirtualHost configuration:
80.68.88.120:80 is a NameVirtualHost
default server dannyisrael.com (/etc/httpd/conf/httpd.conf:998)
port 80 namevhost dannyisrael.com (/etc/httpd/conf/httpd.conf:998)
port 80 namevhost dannyisrael.co.uk (/etc/httpd/conf/httpd.conf:1004)
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server www.therichmondstudio.co.uk
(/etc/httpd/conf/httpd.conf:1742)
port 80 namevhost www.therichmondstudio.co.uk
(/etc/httpd/conf/httpd.conf:1742)
port 80 namevhost www.dannyisrael.com
(/etc/httpd/conf/httpd.conf:1748)
port 80 namevhost www.dannyisrael.co.uk
(/etc/httpd/conf/httpd.conf:1754)
Syntax OK


Yes, the 2 directories have entirely different content. Both have distinct
index.html files.

Both directories and the files within them are owned by an ordinary user -
danny and permissions are standard 644 for files, 755 for directories.

I'm stumped Sad

Garry
 >> Stay informed about: Virtual hosts not working 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2994



(Msg. 4) Posted: Mon Aug 13, 2007 3:26 pm
Post subject: Re: Virtual hosts not working [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
zaphod

External


Since: Aug 13, 2007
Posts: 3



(Msg. 5) Posted: Mon Aug 13, 2007 7:02 pm
Post subject: Re: Virtual hosts not working [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Davide Bianchi wrote:
> On 2007-08-13, zaphod <abc DeleteThis @def.com> wrote:
>> httpd -S output:
>>
>> VirtualHost configuration:
>> 80.68.88.120:80 is a NameVirtualHost
>> default server dannyisrael.com (/etc/httpd/conf/httpd.conf:998)
>> port 80 namevhost dannyisrael.com (/etc/httpd/conf/httpd.conf:998)
>> port 80 namevhost dannyisrael.co.uk (/etc/httpd/conf/httpd.conf:1004)
>> wildcard NameVirtualHosts and _default_ servers:
>> *:80 is a NameVirtualHost
>> default server www.therichmondstudio.co.uk
>
> Wait a minute... you have both a *:80 and a 80.68.88.120:80 ?
> That's wrong. You need only one NameVirtualHost entry.
>
> Remove the *:80 and change your VirtualHost *:80 in the same
> 80.68.88.120:80 for 'therichmondstudio'.
>
> Davide
>

Thanks Davide, I discovered I'd cut 'n pasted a duplicate of the
VirtualHosts section Sad

Garry
 >> Stay informed about: Virtual hosts not working 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
virtual hosts deny not working - Can anyone tell me what is wrong with the below or a reason why this isnt taking effect. My stats show im still getting hits from the IP's im denying Could Allow all be in the httpd and overriding this? <Directory /> Options FollowSymLinks...

Apache22 FreeBSD Install and Virtual Hosts not working - I am trying for a pretty basic install here but to no avail. FreeBSD 6.0 Apache22 (From Ports) Apache serves pages from the default folder but... I get the following error on a restart httpd: Syntax error on line 407 of..

anyone have multiple virtual hosts over SSL working on Ubu.. - I have been fighting my Apache2 config for months trying to get multiple virtual hosts working over SSL. Does anyone have this working for Ubuntu 7.10? I'd love to see how you've done it. Cheers, Scott

Vitual Hosts not working after an upgrade from apache 1.3 .. - Hi, I just upgraded a suse box from 8.2 to 9.1 and had to rewrite the apache config to suit v2.0. The problem is trying to get named based virtual hosts working. I created a file /etc/apache2/vhosts.d/vhosts.conf that includes the virtual hosts..

Virtual Hosts? - I'm wanting to use one IP address to host multiple domains, ie web hosting. I assume that "virtual hosts" are the thin I need to focus on here and is this basically a similar concept to Host Headers in IIS 5.0? I'm running Windows 2000 with Apa...
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]