Apache and Virtual Hosts Question!! please help

Apache and Virtual Hosts Question!! please help

Post by Marc Dumontie » Fri, 29 Jan 1999 04:00:00



Here is my situation (btw: I'm new to apache and web serving)

I have:
    Apache 1.3.4
    one IP
    dhcp server (cable modem)
    Linux

In order to have my internet access I must run dhcpcd with the hostname
flag. therefore the official hostname is a cryptic code "CR267976-A". I
have a registered domain and run the primary DNS server for it. I have
made some aliases and my server is accessed at www.mydomain.net.

MY problem is that I want to use different document roots for different
hosts which all reside on the same machine. I have made a bunch of
CNAMES.

for ex.

    www.mydomain.com    (/home/httpd)
    host1.mydomain.com    (/home/httpd/host1)

I've reade the virtual hosts docs. and think this is the answer to my
problem. so I used the NameVirtualHost directive speciafying my one and
only IP.

I made a
<virtual host <myip>>
....
ServerName host1.mydomain.com
DocumentRoot /home/httpd/host1
...
</virtualhost>

When I go to www.mydomain.com I get the host1 page! when I go to
host1.mydomain.com , I still get that same page.

I've tried a few variations and I'm basically lost now...out of
hope...and discouraged
Anyone who can help me out..please email me ASAP before I drive myself
insane as I occasionally do..

Marc Dumontier
School of Computer Science
Carleton University
Ottawa , Canada
http://www.hexbinary.cx (temp)



 
 
 

Apache and Virtual Hosts Question!! please help

Post by F. Fernande » Fri, 29 Jan 1999 04:00:00



> I've reade the virtual hosts docs. and think this is the answer to my
> problem. so I used the NameVirtualHost directive speciafying my one and
> only IP.

> I made a
> <virtual host <myip>>
> ....
> ServerName host1.mydomain.com
> DocumentRoot /home/httpd/host1
> ...
> </virtualhost>

I've never done virt hosts whith a single IP but You can try to
use the hostname instead of the IP number in the Virtual Host header.

F.
--
Fernando Fernandez
http://despodata.pt/ddata/pessoal/ferdez.htm

 
 
 

Apache and Virtual Hosts Question!! please help

Post by Alexandre Farc » Fri, 29 Jan 1999 04:00:00



> I made a
> <virtual host <myip>>
> ....
> ServerName host1.mydomain.com
> DocumentRoot /home/httpd/host1
> ...
> </virtualhost>

> When I go to www.mydomain.com I get the host1 page! when I go to
> host1.mydomain.com , I still get that same page.

the following example works fine for me...

in httpd.conf

NameVirtualHost xxx.xxx.xxx.xxx

<VirtualHost xxx.xxx.xxx.xxx>
ServerName host1.mydomain.com
DocumentRoot /home/httpd/host1
</VirtualHost>

<VirtualHost xxx.xxx.xxx.xxx>
ServerName host2.mydomain.com
DocumentRoot /home/httpd/host2
</VirtualHost>

<VirtualHost xxx.xxx.xxx.xxx>
ServerName host3.mydomain.com
DocumentRoot /home/httpd/host1/other_roots/host3
</VirtualHost>

Alexandre
--

 
 
 

1. Apache 1.3b2: Default Host and all virtual hosts serve only first virtual hosts pages?

Hello.

Have been running 1.2b8 for a intranet and decided to move upto 1.3b2. I
have several name based virtual hosts that have been working under
1.2b8. After compiling and installing 1.3b2 my virtual hosts do not
work. In fact what happens is that even though DocumentRoot and default
server name is different, eg: www.serverA.net pointing to /www/default,
Apache 1.3b2 will always take me to the first defined virtual host as if
it's locked to it no matter what virtual host I try to browse. What
gives? Please post and E-Mail.

In /etc/hosts for my machines IP address I have

A.B.C.D         www.default.net www.virtA.net www.virtB.net

In ../conf/httpd.conf I have;

<VirtualHost www.virtA.net>

DocumentRoot /usr/local/www/virtA
ServerName www.virtA.net
ErrorLog logs/virtA.error.log
TransferLog logs/virtA.access.log
</VirtualHost>

<VirtualHost www.virtB.net>

DocumentRoot /usr/local/www/virtB
ServerName www.virtB.net
ErrorLog logs/virtB.error.log
TransferLog logs/virtB.access.log
</VirtualHost>

--

2. pcnfsd filling spool dirs

3. Mixing Apache Name Based Virtual Hosts and SSL Virtual Host

4. How do a SUN with 2 ip address work ?

5. Apache, FrontPage, and Named virtual hosts, Security, please help !

6. [Fwd: pci xclaimvr problem on 7300/233]

7. Frontpage and Apache virtual hosts - help please

8. Deleting an entire dir-structure on a Netware File Server from a Linux workstation using ncpmount (ncpfs version 2.0.5 )

9. Apache - Virtual Host or /etc/hosts

10. Apache 2.0.x virtual host ALWAYS beings up the FIRST host in the list..

11. Apache virtual hosting question

12. FrontPage virtual hosting, removal or reset of virtual host

13. running 1.3 and 2.x apache on the same system...a virtual host setup question