We help IT Professionals succeed at work.

HTTP  virtual host question

mokkan
mokkan asked
on
Hello,

We are running  webserver on production and during the DR we need to put diffrent IP address in the vurtual host httpd.conf file.  Can we automate without touching the httpd.conf file?
Comment
Watch Question

Chris HInfrastructure Manager

Commented:
Create two files httpd.1 httpd.2
Set the ip adress in .1 to your normal production IP
Set the ip adress in .2 to your DR IP
Create 2 scripts, one which copies httpd.1 to httpd.conf and vice versa.
Schedule 2 cron jobs or launch the scripts manually.

What distro is it?

Author

Commented:
The problem is we do San copy before we launch Apache instance. DR servers will have same httpd.conf file as prod  and it will have prd IP. We don't want to keep 2 http Conf file.

Any other solution?
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016
Commented:
You don't want to touch httpd.conf AND you don't want to keep 2 httpd.conf files?

I'm thinking we should be able to do one or the other, or we can't help you further?

Author

Commented:
Is there way  we can put the prod IP in /etc/hosts file and resolve to  DR host?
Top Expert 2015
Commented:
All modern browsers will connect to next server in DNS pool when one is down. I think active/passive cluster and HA at this level actually makes it less available and more complex than 2 apache servers mostly independent with small session synchronisation.
Chris HInfrastructure Manager
Commented:
we need to put diffrent IP address in the vurtual host httpd.conf file

echo. > httpd.conf
echo new contents of file >> httpd.conf

This is pretty cut and dry.
Commented:
Thank you what we did we changed the informaiton on PROD to point it to hostname instead and IP and did FC and worked.

Author

Commented:
Thank you all