LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-29-2005, 07:06 AM   #1
kuplo
Member
 
Registered: Oct 2005
Posts: 123

Rep: Reputation: 15
virtual hosts, virtual ip's?


I run everything on virtual host name, but IM wondering if there is a way to give out virtual ip's off of my one ip on this linux box. Because I did this to my etho (1 ethernet card in my box)

eth0 Ethernet 192.168.1.100 255.255.255.0 Up
eth0:1 Ethernet (Virtual) 192.168.1.101 255.255.255.0 Up
eth0:2 Ethernet (Virtual) 192.168.1.102 255.255.255.0 Up
eth0:3 Ethernet (Virtual) 192.168.1.103 255.255.255.0 Up
eth0:4 Ethernet (Virtual) 192.168.1.104 255.255.255.0 Up
eth0:5 Ethernet (Virtual) 192.168.1.105 255.255.255.0 Up
eth0:6 Ethernet (Virtual) 192.168.1.106 255.255.255.0 Up
eth0:7 Ethernet (Virtual) 192.168.1.107 255.255.255.0 Up
eth0:8 Ethernet (Virtual) 192.168.1.108 255.255.255.0 Up
lo Loopback 127.0.0.1 255.0.0.0 Up

Is it possible to use one of these ip's a a virtual ip or as a serveralias to get to a site that hasnt propegated yet?So if I put ServerAlias 192.168.1.105 for a new domain would it be accessible by that, or do people just have to wait till it propegates.

Thanks,

Last edited by kuplo; 11-29-2005 at 07:09 AM.
 
Old 11-29-2005, 01:43 PM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Quote:
but IM wondering if there is a way to give out virtual ip's off of my one ip on this linux box
Because 192.168 is a private class C ip address, you can't give that out. You can give out that 1 public ip address that you have and then forward any http requests to your 192.168.x.x address.

Also, why do you want so many virtual ip's? You can set up virtual hosting for many domains to point to one interface. I don't use ip alias whatsoever. That's how I'm doing mine.

-twantrd
 
Old 11-29-2005, 02:48 PM   #3
kuplo
Member
 
Registered: Oct 2005
Posts: 123

Original Poster
Rep: Reputation: 15
Im a newbiew, I thought I had to setup one virtual ip per virtual host even though all virtual hosts use 192.168.1.100

What would happen if I switched one over to a virtual ip, so instead of 192.168.1.100 I put 192.168.1.108 Would they be able to reach their site by that ip, or even reach that site by name anymore. I guess not since you said it's a class C ip address. How do I go about forwarding my regular 1 ip to the virtual ip's seperatly so they dont all go to the same place, assuming I can assign each virtual host its own virtual IP?

Last edited by kuplo; 11-29-2005 at 04:51 PM.
 
Old 11-29-2005, 09:44 PM   #4
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Something like this is probably what you're looking for:

Code:
BindAddress 192.168.1.100
Listen 192.168.1.100:80

<VirtualHost 192.168.1.100>
ServerName blah.com
ServerAlias blah
DocumentRoot /var/www/docroot
HostNameLookups off
TransferLog logs/access.blah
ErrorLog logs/errors.blah
</VirtualHost>

<VirtualHost 192.168.1.100>
ServerName blah1.com
ServerAlias blah1
DocumentRoot /var/www/docroot1
HostNameLookups off
TransferLog logs/access.blah1
ErrorLog logs/errors.blah1
</VirtualHost>
So, whenever someone hits "blah.com" they will see whatever pages you setup in /var/www/docroot, while someone else that hits "blah1.com" will see whatever is in /var/www/docroot1. I don't use ip based virtual host, I use name based virtual host. To me, that's easier but it's really up to you.

How are people hitting your site now? Just people on your internal network or outside as well? If people from the outside are hitting your site, then you must be forwarding httpd requests from your router to your linux box.

-twantrd

Last edited by twantrd; 11-29-2005 at 09:45 PM.
 
  


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
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 07:29 AM
virtual hosts snu Linux - Software 7 05-04-2004 03:13 PM
virtual hosts... Digital_Err0r Linux - Newbie 25 03-25-2004 04:58 PM
Multiple IP's / virtual interfaces cliffyman Linux - Networking 1 02-07-2003 08:14 AM
Virtual Hosts!! chris Linux - General 4 02-03-2003 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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