Apache2Triad Help, Support and Development Forum Index Apache2Triad Help, Support and Development
The apache2triad help , support and development forums
 

Virtual Hosts
Click here to go to the original topic

 
       Apache2Triad Help, Support and Development Forum Index -> Apache
View previous topic :: View next topic  
Author Message
smithster



Joined: 06 Jan 2007
Posts: 4

Posted: Sat Jan 06, 2007 11:19 pm    Post subject: Virtual Hosts  

I have tried and tried using the given tutorials and I just cannot set up the virtual hosts. Perhaps someone can tell me where I am going wrong!

Here's the code I used.....

Quote:
NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost 87.81.28.214:8000>
ServerAdmin webmaster@87.81.28.214:8000
DocumentRoot g:/web1
ServerName 87.81.28.214:8000
ErrorLog /www/apache2triad/logs/localhost-error_log
CustomLog /www/apache2triad/logs/localhost-access_log common
</VirtualHost>
#
<VirtualHost 87.81.28.214:8080>
ServerAdmin webmaster@87.81.28.214:8080
DocumentRoot g:/web2
ServerName 87.81.28.214:8080
ErrorLog /www/apache2triad/logs/arena-error_log
CustomLog /www/apache2triad/logs/arena-access_log common
</VirtualHost>


Thanks in advance. 8)
Back to top  
lku homer



Joined: 29 May 2006
Posts: 104

Posted: Sat Jan 06, 2007 11:46 pm    Post subject:  

Make sure you make the listen ports 8000 and 8080. And why do you have 2 VirtualHosts for the same IP? I also find it best to set up the localhost VirtualHost. If you changed the code for this example we can't help you because by having the IP's the same, we think that is your problem.

Also, make the log files:
Code:
logs/localhost-error_log
logs/localhost-acces_log common
Back to top  
smithster



Joined: 06 Jan 2007
Posts: 4

Posted: Sun Jan 07, 2007 12:15 am    Post subject:  

Well, believe me there is a method in the madness!!!

Anyway, I figured it out, and I now have 5 websites running!! For the benefit of others, here is the coding for the 5 sites......

Quote:
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#

NameVirtualHost *:5000

<VirtualHost *:5000>
DocumentRoot g:/web1
ServerName 87.81.28.214:5000
ErrorLog /www/apache2triad/logs/web1-error_log
CustomLog /www/apache2triad/logs/web1-access_log common
</VirtualHost>

NameVirtualHost *:6000

<VirtualHost *:6000>
DocumentRoot g:/web2
ServerName 87.81.28.214:6000
ErrorLog /www/apache2triad/logs/web2-error_log
CustomLog /www/apache2triad/logs/web2-access_log common
</VirtualHost>

NameVirtualHost *:7000

<VirtualHost *:7000>
DocumentRoot g:/web3
ServerName 87.81.28.214:7000
ErrorLog /www/apache2triad/logs/web3-error_log
CustomLog /www/apache2triad/logs/web3-access_log common
</VirtualHost>

NameVirtualHost *:8000

<VirtualHost *:8000>
DocumentRoot g:/web4
ServerName 87.81.28.214:8000
ErrorLog /www/apache2triad/logs/web4-error_log
CustomLog /www/apache2triad/logs/web4-access_log common
</VirtualHost>

NameVirtualHost *:9000

<VirtualHost *:9000>
DocumentRoot g:/web5
ServerName 87.81.28.214:9000
ErrorLog /www/apache2triad/logs/web5-error_log
CustomLog /www/apache2triad/logs/web5-access_log common
</VirtualHost>



I hope that this helps other people out. Good luck!! 8)
Back to top  
lku homer



Joined: 29 May 2006
Posts: 104

Posted: Sun Jan 07, 2007 12:21 am    Post subject:  

Grats!
Back to top  
 
       Apache2Triad Help, Support and Development Forum Index -> Apache
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.13 © 2001, 2002 phpBB Group