Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to assign multiple IP to one server?

Status
Not open for further replies.

ttest

Programmer
Jun 28, 2000
38
0
0
US
My company just signed up a Cobalt RAQ3 server from a hosting company. The hosting plan comes with 16 IP addresses. I wanted to host a few sites on this new server. I wanted to assign one IP to each sites. I know how to configure Apache, but I don't know how to configure Linux to assign these IP addresses to my server.

ttest
thum@starwarsfan.com

 
Well, if you use apache's alias stuff, you just point the IP address in the host table and your routers to the server, and apache will do the rest. This is how most people do it. You /etc/hosts file is the main one, and your httpd.conf file, and set all of your routing equipment to route the addresses to that address.

MWB>

Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
Well if you use IP based virtualhosting on a linux (posix) type system running Apache web server 1.3.9 and above, issue these commands to add interfaces to the system. These interface definitions will set up multiple IP's. I don't remember how to bind the IP's beyond a reboot, I guess you have to append the new routes to a network file in /etc.

to add an ip:
ifconfig eth0:1 192.168.1.2
to add a route for the ip:
route add -host 192.168.1.2 dev eth0:1

That's it. the eth0:1 declaration just means that it is an added ip to the nic card table.you can go higher like so:
eth0:2,eth0:3, etc...

Hope this helps!
IT ninja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top