PDA

View Full Version : [ubuntu] Two websites on one Public IP address



Captainnow
January 16th, 2011, 12:46 AM
I'm running ubuntu server 10.10.

I have it set to where I have one website running and working fine.
I have a dns routing set from another site for it so people don't have to use my IP address to get to my site.

Now a friend has asked me to host a website on my server for him and he would like to have his own dns routing to the site.

Now can I run two separate sites on my box and have two domains routing to them.

www.mysite.net
www.friends-site.net

Those are just examples of course. Remember I only have one public IP. So how can I create both sites and have them each have their own public domains?

psusi
January 16th, 2011, 01:51 AM
I don't recall the exact config but you can set up apache to create virtual servers based on the host name in the http request.

Captainnow
January 16th, 2011, 02:17 AM
I don't recall the exact config but you can set up apache to create virtual servers based on the host name in the http request.

Anyone know where I can find some steps on setting that up?

stlsaint
January 16th, 2011, 04:16 AM
Start with the apache site docs.

http://httpd.apache.org/docs/current/

there you can also find the guide on vhost.

sj1410
January 16th, 2011, 06:26 AM
a very basic example that i use to do that and works for me


http://blog.swapnil.me/2011/01/hosting-multiple-websites-with-apache.html

SeijiSensei
January 16th, 2011, 03:30 PM
See http://ubuntuforums.org/showpost.php?p=10016541&postcount=3.