Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We currently use name-based virtual hosting for two websites on one IP. The DNS entries for both point to the same IP at a 3rd party web host.

We've purchased SSL certificates for both which means name-based virtual hosting is no longer an option for us. It looks like we'll need to do ip-based virtual hosting instead. Due to this, we also purchased an additional IP to use for the 2nd website.

I'd like to verify these are the correct steps for making the change with minimal downtime:

1) Add the new IP at the Linux level Copy /etc/sysconfig/network-scripts/ifcfg-eth0 to /etc/sysconfig/network-scripts/ifcfg-eth0:1 and edit accordingly for the new IP. Then do an "ifdown eth0" and "ifup eth0". Ensure the new IP shows using "/sbin/ifconfig".

2) Edit httpd.conf. Remove "NameVirtualHost" directive and revise "VirtualHost" to be IP-specific. Verify using "/usr/sbin/apachectl configtest" and restart Apache.

3) Change the DNS A record for the 2nd website to point to the new IP.

Some questions:

1) From what I understand, #1 wouldn't involve any downtime and the existing IP on eth0 would remain intact. Is that correct?

2) In #2 above, are we able to set things so that either the old IP or new IP still direct to the correct websites? It sounds like this would temporarily be a mixed environment. I'm thinking this could provide a seamless option while DNS propagates.

3) Would I need to revise any routing? The only thing changing is the addition of the new IP and having that correctly point to the 2nd website.

4) Anything I missed?


share|improve this question
up vote 1 down vote accepted

Your questions:

  1. Yes, it will technically result in down time. Issuing that command remotely (e.g., via SSH) will result in you losing access to the server, which will result in much more downtime. What you want is service network restart (I assume this because of the /etc/sysconfig/network-scripts path)

  2. Keep your old VirtualHost intact, create a new VirtualHost for your new IP and copy the config for the site. Test, reload, update DNS. After x hrs to account for propagation remove your old config.

  3. Is your new IP in the same subnet as your old one? Does it have a different gateway?

  4. Do you have a firewall - external hardware, or internal software like iptables? You may need to update or add new rules for the new IP address

share|improve this answer
Thanks. I've read that #1 ("service network restart") is not recommended over SSH. This may be something we'll want to try having our remote host help out with. Yes, all other settings should be the same in #3 from what I understand from our web host. It's just another IP for SSL. Yes, it looks like iptables is enabled. Just need to figure out how to view the current configuration to check. – MattB Oct 25 '10 at 13:43
service network restart is technically not recommended because if there's an issue in your networking scripts, your interface will fail to come back up. However, calling ifdown on your primary interface is guaranteed to kill your SSH connection. If you don't have remote console through your provider, any modifications to your primary interface can involve risk. You can view your current iptables setup with iptables -nL as root. – brent Oct 25 '10 at 16:04
For the firewall, it doesn't look like anything too restrictive is in place. Our host has made the network interface change for us so that we can now concentrate on Apache. Thanks again. – MattB Oct 25 '10 at 21:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.