Setting a second IP address to the same device.
Hi,
I have apache2 running and am playing with virtual hosts and having 192.168.1.255 and 192.168.1.254 (and 192.168.1.253 etc) as two (or more) hosts so that they can point to different websites. For the virtual hosts to work I have to add the IP address to the ethernet device using the following command. Code:
/sbin/ifconfig eth0:0 192.168.1.254 But I have to do that before Apache is started. Is there a way that I can have the computer do that command when it boots up before it starts Apache? |
I don't know about SUSE specifically but Slackware has /etc/rc.d/rc.local for local custom startup commands.
Check around for something similar, and put the command there (or wait for someone who knows SUSE to tell you ;) ) |
I only know how to do it graphically, but on FC3 with GDE, you can use system-config-network to add a new (logical) ethernet device and give it any IP address you want. Then just check the box that says, "activate this device when computer starts". But it seems like it would be easier for you to use name based virtual hosting and run all the sites on the same IP address.
Sorry I can't be more helpful, but I'm a newbie at this stuff myself. |
Graphically is good, I am a newbie too :) (although being a programmer I dont mind text if I have instructions)
Ive gone to the YAST control centre and to yast-system-config and looked at most of the settings including the ones in hardware-network. I think I might have to set a setting to run a script and then go and edit that script. I'll have another look later but in the mean time anyone who knows SuSE would really help. |
Hi,
here it is : http://portal.suse.com/sdb/en/2002/0...network80.html they explain what config files are used at boot time and how to configure them. as for the alias, have a look at : http://www.ambidexter.com/unix-model/redhatip.htm |
Don't configure a host with 192.168.1.255, this is a broadcast address for the 192.168.1.0 network and you will get all sort of weirdities if you attempt to connect to it.
|
Thanks, those links helped and I made my config file needed. It works great, I got to see it set the IP address as I watched it quickly boot up everything.
I did relise later that 192.168.1.255 was my broadcast address and not my default IP address as I had thought. Thanks for the warning though pete. |
All times are GMT -5. The time now is 03:29 PM. |