LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-15-2010, 04:07 AM   #1
sandeepthug
Member
 
Registered: Nov 2008
Posts: 38

Rep: Reputation: 15
IP based Virtual Hosting


Hi,

I need to do IP based Virtual Hosting on one of my server.

Presently it is serving only one site from the default webroot /var/www/html


I've multiple Public IP's assigned on eth interface.

I want to make a setup where in i can run multiple websites on same server and points to separate ip's that i have.

I have the dns servers where i can point my domain names to the IP addresses

All I want to know that how can i configure IP based Virtual Hosting on my server.


thanks
Sandeep
 
Old 04-15-2010, 04:25 AM   #2
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Blog Entries: 7

Rep: Reputation: 18
Hi,

you first need to edit your apache configuration file for this,

for first ip
<Virual Host your 1st ip address:80>

Document Root /var/www

then for second ip

Virual Host your 2nd ip address:80>

Document Root /var/www1

you have to manually create /var/www1 directory and put your html file inside that directory for second domain there.

This is what i have done for creating ip based virtual hosting in my ubuntu server.
 
Old 04-15-2010, 06:30 AM   #3
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
Also /etc/hosts you will need to make entries.



http://httpd.apache.org/docs/2.0/vhosts/name-based.html
http://www.ubuntugeek.com/howto-crea...in-apache.html
http://www.debianhelp.co.uk/virtualhosts.htm
http://www.debian-administration.org/articles/412
http://ubuntuforums.org/showthread.php?t=61669



and if you want to use Xen then
http://wiki.xensource.com/xenwiki/Ho..._them.#preview
this one is a bit complicated but it is exactly what you want to do.

Do not forge a2ensite as root.

Last edited by tkmsr; 04-15-2010 at 06:44 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
virtual name based hosting atomicrm Linux - Server 8 12-17-2009 09:20 AM
Iptables and Name-Based Virtual Hosting Yahooguntu Linux - Software 5 08-26-2009 07:27 PM
[SOLVED] FTP name based Virtual Hosting mwkemo Linux - Server 5 08-24-2009 09:47 AM
name based virtual hosting jkmartha Linux - Software 4 08-04-2005 09:21 AM
name based virtual hosting adm1329 Linux - Networking 5 05-05-2004 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration