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

Help with using Apache to host 3 sites off of one server
Click here to go to the original topic

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



Joined: 03 May 2006
Posts: 47

Posted: Mon Dec 25, 2006 4:17 am    Post subject: Help with using Apache to host 3 sites off of one server  

I am wanting to host 3 sites off of my local server and I was wondering if someone could help me setup my apache to communicate to all three sites. I would greatly appreciate any help with this.

*** UPDATE ***

These are my three sites.
qwertytech.bounceme.net
redbeardcustoms.no-ip.info
sinistergrin.no-ip.info


Can someone please help me with my Virtual Host setup. I would greatly appreciate it.
Back to top  
lku homer



Joined: 29 May 2006
Posts: 104

Posted: Mon Jan 01, 2007 11:51 pm    Post subject:  

There are many topics about this, but I shall help you none the less:

In your httpd.conf this is what you want for your VirtualHosts
Code:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80


<VirtualHost localhost:80>
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot C:/apache2triad/htdocs
ErrorLog logs/error.log
CustomLog logs/access.log common

#display php errors
php_value register_globals 0
php_value error_reporting 2047
php_value display_errors 1
</VirtualHost>

<VirtualHost *:80>
ServerName www.domain1.com
ServerAlias domain1.com
ServerAdmin webmaster@domain1.com
DocumentRoot C:/apache2triad/htdocs/www/domain1
ErrorLog logs/domain1.com-error.log
CustomLog logs/domain1.com-access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName www.domain2.com
ServerAlias domain2.com
ServerAdmin webmaster@domain2.com
DocumentRoot C:/apache2triad/htdocs/www/domain2
ErrorLog logs/domain2-error.log
CustomLog logs/domain2-access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName www.domain3.com
ServerAlias domain3.com
ServerAdmin webmaster@domain3.com
DocumentRoot C:/apache2triad/htdocs/www/domain3
ErrorLog logs/domain3-error.log
CustomLog logs/domain3-access.log common
</VirtualHost>

Using, DirectoryIndex index.html, gave me either a file not found, or if I went to a sub-folder inside the domain it would give me just the folder structure, so I don't use that.

Also make sure you have your C:\WINDOWS\system32\drivers\ect\host file have the three domains listed. Different routers give you different gateways, so you may have to change this:
Code:
192.168.1.1 <tab> localhost
192.168.1.1 <tab> www.domain1.com
192.168.1.1 <tab> www.domain2.com
192.168.1.1 <tab> www.domain3.com

That is assuming you have Windows of course, I don't know about Unix.

I believe that should get you going, assuming that you already have the domains pointed to your computers external IP, and router(if applicable) ports opened up.

If there are more problems post here, if not, let me know if it worked ok.

Homer
Back to top  
 
       Apache2Triad Help, Support and Development Forum Index -> Hosting
Page 1 of 1


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