OK... I've confirmed that it works.
I have 3 different domain names resolving to one IP with a different web
page for each (each in its own directory).
There is a correction to the information below...
The line that reads
<VirtualHost IPADDRESS>
needs to read
<VirtualHost www.yourdomain.com>
The rest is fine. Plus it really helps to have your local DNS admin put
the proper entries in the DNS server for your domain names. It took me
a while to get the domain names to resolve properly, but it works.
Now I can host as many sites as I'd like... pretty cool huh? No point
in paying for multiple IP addresses!!!
Jason
-----Original Message-----
From: fredws.snb [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 2:01 PM
To: newbie
Subject: Re: [newbie] Apache/virtual hosts
Put the following in your httpd.conf file. (of course replacing what you
need to to make it fit your system)
NameVirtualHost IPADDRESS
<VirtualHost IPADDRESS>
ServerAdmin Admin_email_address
ServerName www.first.com
DocumentRoot /home/www/first
ErrorLog /var/log/first-error
TransferLog /var/log/first-transfer
AgentLog /var/log/first-agent
RefererLog /var/log/first-referer
</VirtualHost>
<VirtualHost IPADDRESS>
ServerAdmin Admin_email_address
ServerName www.second.net
DocumentRoot /home/html/second
ErrorLog /var/log/2nd-log
TransferLog /var/log/2nd-transfer
AgentLog /var/log/2nd-agent
RefererLog /var/log/2nd-referer
</VirtualHost>
<VirtualHost IPADDRESS>
ServerAdmin Admin_email_address
ServerName www.second.net
DocumentRoot /home/html/second
ErrorLog /var/log/2nd-log
TransferLog /var/log/2nd-transfer
AgentLog /var/log/2nd-agent
RefererLog /var/log/2nd-referer
</VirtualHost>
<VirtualHost IPADDRESS>
ServerAdmin Admin_email_address
ServerName www.third.org
DocumentRoot /home/html/third
ErrorLog /var/log/3rd-log
TransferLog /var/log/3rd-transfer
AgentLog /var/log/3rd-agent
RefererLog /var/log/3rd-referer
</VirtualHost>
where IPADDRESS is of course replaced with the actual IP address of your
site. This is also for where the last two are aliases to the first
site.
Notice that if you have a virtual host, that you must have an entry for
each
site, including the main one.
hope this helps.
Fred
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 12:54 PM
Subject: [newbie] Apache/virtual hosts
> Does anyone have any real (working) experience in setting up virtual
> hosts on an apache server?
>
> I have my main web up and running and what I'm trying to do is run 2
> other web sites from the same server...
>
> For example
>
> Main site = www.first.com
> Second site = www.second.net
> Third site = www.third.org
>
>
> Can some one help me with the httpd.conf file and what the appropriate
> settings would be?
>
> I've read through the Apache site and I can't quite figure it out.
> I've also used Comanche and I'm in the same spot...
>
>
>
> Regards,
> Jason
>