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
>


Reply via email to