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?
Thanks!
Your questions:
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)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.
Is your new IP in the same subnet as your old one? Does it have a different gateway?
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