LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-13-2006, 01:44 PM   #1
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
Multi-Websites Hosted with /etc/hosts File?


Hi,

This may be a dumb question, but the following not clear to me:

I want to host a couple of public vanity web sites. Just a couple. I don't want to run DNS at all if I can help it. One is my domain, another for running another for a crazy site idea I had. If I get my dns/domain provider to point both domains to my server, then what I -think- should happen on my server is:

/etc/network/interfaces
Add a second virtual IP address off of eth0.
eth0 192.168.XX.YY
#static IP and everything else I need to add

eth0:1 192.168.XX.YY+1
#static IP and ...

/etc/hosts
revise file for two IP/names.
127.0.0.1 localhost
192.168.XX.YY Myvanitydomain.com
192.168.XX.YY+1 Mycrazywebsite.com

/etc/apache2/virtual-hosts
myvanitydomain.com pointing to /home/dir1
mycrazysite.com pointing to /home/dir2.

Firewall
Currently my firewall correctly forwards webserver traffic to my server where a single place holder sits. I don't think I need to do anything with the firewall.

Let me know if my logic/steps are right.

Any advice would be appreciated.

Michael
 
Old 11-13-2006, 02:09 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
hmmm, not really where you want to be going at all really... not sure how multiple ip's are supposed to help you on an internal LAN. if you had multiple *public* ip's then that's a different A record in DSN for each domain, which is fine, but under a private LAN they're no use unless your router can proxy at http level.

essentially all you need to do is read up on virtualhosts a bit more and you'll see it's actaully a *lot* easier to do than you think. a virtualhost will take the host header of an http request and match that to a different site, so one ip is all you need.
 
Old 11-13-2006, 02:48 PM   #3
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Original Poster
Rep: Reputation: 72
Thanks

That's great. Easier is better.

Thanks a whole lot.

Quote:
Originally Posted by acid_kewpie
hmmm, not really where you want to be going at all really... not sure how multiple ip's are supposed to help you on an internal LAN. if you had multiple *public* ip's then that's a different A record in DSN for each domain, which is fine, but under a private LAN they're no use unless your router can proxy at http level.

essentially all you need to do is read up on virtualhosts a bit more and you'll see it's actaully a *lot* easier to do than you think. a virtualhost will take the host header of an http request and match that to a different site, so one ip is all you need.
 
  


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
using iptables how do i block file listing of websites? murphydims Linux - Security 4 04-26-2006 11:49 AM
How do I create a windows hosted file sharing that can share files with suse 10.0?? winstone5000 Linux - Networking 3 12-18-2005 03:39 PM
multiple file upload for websites? sohmc Linux - Networking 4 02-23-2005 07:43 AM
can not see websites from my lan, hosted by me siweb Linux - Networking 12 07-30-2004 01:51 PM
does the /etc/hosts file work same as the M$ hosts file? Lleb_KCir Linux - Software 6 04-03-2004 04:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:24 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