LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-27-2005, 12:46 PM   #1
kihtap
LQ Newbie
 
Registered: Jun 2004
Posts: 15

Rep: Reputation: 0
IP Based Virtul Hosts


I have a server with Red Hat 9 Installed and am trying to add a new Virtual Site. I used the HTTP Server Configuration Tool and tried adding it on there. I then went to the SERVER Configuration Tool and restarted the httpd service. I can access the server IP from an outside network. But can not access the new IP I added.

From the looks of it, it seems that the configuration is not correct. I also looked into the httpd.conf file, but I do not see anything obviously incorrect. What is the best way to add the IP Based Virtual Site? I do not mind editing the httpd.conf manually.

Please Help.

kihtap
 
Old 01-27-2005, 01:02 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
I am trying to understand your question. You are adding a second IP address to the same machine? If that is the case, then you first need to add an alias interface first, with the new IP.
 
Old 01-27-2005, 02:02 PM   #3
kihtap
LQ Newbie
 
Registered: Jun 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Yes, I am trying to add another ip address. how would I go about adding an alias?

Thanks.
 
Old 01-27-2005, 03:41 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
From http://www.siliconvalleyccie.com/lin...ork-linux.htm:
Multiple IP Addresses on a Single NIC

In the previous section "Determining Your IP Address" you may have noticed that there were two wireless interfaces: wlan0 and wlan0:0. Interface wlan0:0 is actually a child interface wlan0, a virtual subinterface also known as an IP alias. IP aliasing is one of the most common ways of creating multiple IP addresses associated with a single NIC. Aliases have the name format parent-interface-name:X, where X is the sub-interface number of your choice.

The process for creating an IP alias is very similar to the steps outlined for the real interface in the previous section, "Changing Your IP Address":



1. First ensure the parent real interface exists

2. Verify that no other IP aliases with the same name exists with the name you plan to use. In this we want to create interface wlan0:0.

3. Create the virtual interface with the ifconfig command



[root@bigboy tmp]# ifconfig wlan0:0 192.168.1.99 \

netmask 255.255.255.0 up



4. You should also create a /etc/sysconfig/network-scripts/ifcfg-wlan0:0 file so that the aliases will all be managed automatically with the ifup and ifdown commands. Here is a sample configuration:



DEVICE=wlan0:0

ONBOOT=yes

BOOTPROTO=static

IPADDR=192.168.1.99

NETMASK=255.255.255.0



The commands to activate and deactivate the alias interface would therefore be:



[root@bigboy tmp]# ifup wlan0:0

[root@bigboy tmp]# ifdown wlan0:0



Note: Shutting down the main interface also shuts down all its aliases too. Aliases can be shutdown independently of other interfaces.
 
Old 01-27-2005, 11:00 PM   #5
kihtap
LQ Newbie
 
Registered: Jun 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for your reply but I am not sure how to go about this. The link and info talk about a wireless network, I have a regular wired LAN. Plus they talk about having a subinterface wlan0:0 that already exsists. I dont have that, or a subinterface like eth0:0 Below is what I have:

eth0 Link encap:Ethernet HWaddr 00:0E:0C:09:54:C5
inet addr:xx.xx.xx.xx Bcast:xx.xx.xx.255 Mask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:191339 errors:0 dropped:0 overruns:0 frame:0
TX packets:18083 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:14556718 (13.8 Mb) TX bytes:2209251 (2.1 Mb)
Interrupt:31 Base address:0x2000 Memory:fe6e0000-fe700000

eth1 Link encap:Ethernet HWaddr 00:0E:0C:09:54:C4
inet addr:192.168.5.207 Bcast:192.168.5.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:643 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:148444 (144.9 Kb) TX bytes:256 (256.0 b)
Interrupt:30 Base address:0x2040 Memory:fe6c0000-fe6e0000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2105146 errors:0 dropped:0 overruns:0 frame:0
TX packets:2105146 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:135478695 (129.2 Mb) TX bytes:135478695 (129.2 Mb)

My eth0 is for www internet where I am hosting live public domains. I do not need to create sites for my local network (eth1). For example if I was to host yahoo.com and google.com on this server I would need to have to server respond to those 2 serarate ips and domains. I have a dedicated connection to the internet backbone.

Hope this helps.
kihtap
 
  


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
Can I route web traffic to 2 different hosts based on URL under 1 IP Address? Marshalle Linux - Networking 5 05-14-2005 03:02 AM
Apache - name based virtual hosts? Moses420ca Linux - Software 7 01-26-2005 11:04 AM
IP based virtual hosts problem adm1329 Linux - Networking 4 03-11-2004 10:40 AM
Adding shell commands to hosts.deny and hosts.allow ridertech Linux - Security 3 12-29-2003 03:52 PM
RH9 & Apache Named Based Virt Hosts mwmethe Linux - Networking 1 11-03-2003 09:17 AM

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

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