LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-31-2014, 09:39 AM   #1
andros84
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Rep: Reputation: Disabled
Hosting multiple sites on a single IP address


Most people use control panels to automate hosting tasks. I would like to set up a server (CentOS/Apache/wsFTPd/PHP/MySQL/Postfix) that will host a few web sites, each on its own domain, on a single public IP address (my own), WITHOUT USING CONTROL PANELS.

So far, CentOS/Apache/wsFTPd/PHP/MySQL/Postfix is set up and I am hosting a website on main domain.

Can you please help me answer a few questions regarding hosting multi sites/domains on a single IP address:
1. Can multi domain web hosting be achieved just with editing apache's configuration file? For example:
123.123.123.123 www.first.com
123.123.123.123 www.second.com
2. Can one machine host web and email server for multiple domains on a single server with the same IP without using a DNS server (e.g. BIND)?
3. If Bind has to be used, can you please write or point me to an instruction how to achieve this?

PS. I've look on Google for a few days, but could not find any useful tutorial.
 
Old 10-31-2014, 09:49 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Multiple web sites on a single IP are usually done with "named virtual hosts" in apache.
https://httpd.apache.org/docs/curren...ame-based.html

I do not like web and mail on the same server because your firewall rules will allow outbound connections (although you could limit these to your ISP's smarthost).
 
Old 10-31-2014, 09:51 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Name-based Virtual Hosts
You only need bind if your box is a nameserver.

See also http://www.cyberciti.biz/faq/apache-...lhost-example/
 
Old 10-31-2014, 04:03 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,128

Rep: Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639
Generally you also put a default index page for older browsers that don't use "host headers". Not a real deal since those are older or modest browsers. Just a nice to do thing. Host header will direct to correct web site. Almost all web sites run multiple domains on a single real ip.
 
Old 11-03-2014, 06:37 AM   #5
andros84
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
By default index page you mean DirectoryIndex index.html default.htm index.cgi index.php, right?
 
Old 11-03-2014, 07:00 AM   #6
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by andros84 View Post
By default index page you mean DirectoryIndex index.html default.htm index.cgi index.php, right?
I think he means one of your virtual hosts will be a default for clients contacting your server but omitting to state what hostname they want. So to show N hosts you'll have N+1 vh sections the apache config.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
multiple sites in single ip soumalya Linux - Server 4 08-13-2011 02:55 AM
NameVirtualHost *:80 has no virtual hosts apache2 hosting multiple sites without DNS tkmsr Linux - Server 9 06-21-2010 10:27 AM
Doubt Regarding Multiple site hosting on single server priyadarshan Linux - Networking 4 09-04-2009 10:34 AM
Creating single realm for multiple sites access mlewis Linux - General 1 07-18-2007 09:27 AM
hosting multiple sites w/ apache pH* Linux - Networking 2 10-15-2004 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:26 PM.

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