Go Back   Dedicated Server Hosting | VPS Hosting | Virtual Private Servers Forum > Support > Linux Server Hosting
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 03-06-09, 07:16
BOD Member
 
Join Date: Mar 2009
Posts: 24
Default Apache configuration - multiple vhosts

Hi, I was just wondering if anyone knows how to set up apache with multiple vhosts - I want to have 3 websites, each contained in it's own folder but each separate from the other, I have looked at a couple of tutorials, but I can't really figure it out!
Reply With Quote
  #2 (permalink)  
Old 03-08-09, 07:02
BOD Member
 
Join Date: Jan 2009
Posts: 73
Default

I had problems with this - the problem was between different versions of apache - there is loads of documentation for apache 1.3 and apache 2 +
watch out depending on which version you have =)
Reply With Quote
  #3 (permalink)  
Old 03-08-09, 10:31
BOD Member
 
Join Date: Mar 2009
Posts: 24
Default

Gah, its really difficult to get working. I have a test box that I have setup and it just took me ages to get it to work properly!! I'm using 2.2.9 on ubuntu to test it out but finally I got it to work with two vhosts and then tried to add a third and it broke, you have to watch out for directory permissions and for syntax in the file =|
Reply With Quote
  #4 (permalink)  
Old 03-08-09, 10:38
BOD Member
 
Join Date: Jan 2009
Posts: 73
Default

lol! I remember moving my config from 1.3 to 2.0 it was a pain, I ended up just re-writing the entire config by hand, it was easier doing that than trying to debug the broken one!!
Reply With Quote
  #5 (permalink)  
Old 06-16-09, 16:34
BOD Member
 
Join Date: Jun 2009
Posts: 8
Default

I can help you set this up. Send a message to me on aim = onlytheinbox
Reply With Quote
  #6 (permalink)  
Old 06-17-09, 13:50
BOD Member
 
Join Date: May 2009
Posts: 85
Default

If you have a control panel, it should do this for you.

Below is an example of two functional vhosts for the domains domain1.com and site2.com.


HTML Code:
NameVirtualHost 123.123.123.123:80

<VirtualHost 123.123.123.123:80>
ServerName domain1.com
ServerAlias [url]www.domain1.com[/url]
ServerAlias ftp.domain1.com
DocumentRoot /home/domain1/public_html
</VirtualHost>
<VirtualHost 123.123.123.123:80>
ServerName site2.com
ServerAlias [url]www.site2.com[/url]
ServerAlias ftp.site2.com
DocumentRoot /home/site2/public_html
</VirtualHost>
Sorry it says that is HTML code, I had to wrap it in an HTML container on this forum to get it to show right. It goes in your httpd.conf. Of course you just need to change the IP, DocumentRoots and domains to match your needs.
__________________
Jeremy J

* Bodhost VPS Linux Account Holder
* Network Information Systems Professional
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 02:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2008, BODHost.com. All rights reserved.