Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 10th April 2008, 01:01
badgerbox76 badgerbox76 is offline
Senior Member
 
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
Smile Hosting two sites from one domain?

So I have one site hosted and I want another hosted on the same domain.

So how can I set this up

My Main Site
www.mysite.com
/var/www/maindir

My Development Site
dev.mysite.com
/var/www/dev


Reply With Quote
Sponsored Links
  #2  
Old 10th April 2008, 11:09
rainydayz rainydayz is offline
Junior Member
 
Join Date: Apr 2008
Location: Bergen, Norway
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via ICQ to rainydayz Send a message via AIM to rainydayz Send a message via MSN to rainydayz Send a message via Yahoo to rainydayz
Default Hosting two sites from one domain?

The configuration varies slightly from distro to distro and depending upon the version of apache you're running. You want to check the documentation for virtualhosts.
Reply With Quote
The Following User Says Thank You to rainydayz For This Useful Post:
badgerbox76 (10th April 2008)
  #3  
Old 10th April 2008, 12:16
zcworld zcworld is offline
Senior Member
 
Join Date: Jul 2006
Location: South Australia
Posts: 329
Thanks: 2
Thanked 37 Times in 37 Posts
Send a message via MSN to zcworld Send a message via Skype™ to zcworld
 
Default

this is what i use for my vhost site
just copy and paste and update the info for your needs
and make sure you got the htdocs / log folder made as well


step1
open your ur httpd.conf file
and add to the bottom of it
NameVirtualHost *
include /var/www/conf.d/*.conf

save it

mkdir -p /var/www/conf.d
cd /var/www/conf.d/

vi www.mysite.com.conf


<VirtualHost *>
ServerName www.mysite.com
DocumentRoot /var/www/vhosts/www.mysite.com/htdocs
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/vhosts/www.mysite.com/htdocs/>
Options Indexes FollowSymLinks MultiViews
</Directory>

CustomLog /var/www/vhosts/www.mysite.com/logs/access.log combined
ErrorLog /var/www/vhosts/www.mysite.com/logs/error.log
</VirtualHost>

save the file

mkdir -p /var/www/vhosts/www.mysite.com/htdocs
mkdir -p /var/www/vhosts/www.mysite.com/log

repeart as many time as you need (update the info on the fly as you need )
than restart apache

make sure you set in your hosts file
IP <TAB> www.mysite.com

if you dont have your own DNS server
__________________
Shane Ebert :: Facebok
Reply With Quote
The Following User Says Thank You to zcworld For This Useful Post:
badgerbox76 (10th April 2008)
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Different web sites... same domain celtic HOWTO-Related Questions 5 15th May 2007 13:15
one domain, many sites atoulis General 3 28th February 2007 18:53
all sites are getting "Index of /" page instead of the domain directory jagnag1 Installation/Configuration 3 17th December 2006 12:18
Hosting sites bobsta63 General 4 29th November 2006 14:33
Viewing web sites without using their domain name? jameso General 3 21st November 2006 03:59


All times are GMT +2. The time now is 20:20.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.