Practical mod_perl / HTML Book /



previous page: 5.8.2.2.1. Upgrading live server components by swapping machines
  
page up: HTML Version of the book
  
next page: 5.8.2.2.3. Upgrading a live server with prepackaged components

5.8.2.2.2. Upgrading a live server with port forwarding


Using more than one machine to perform an update may not be convenient, or even possible. An alternative solution is to use the port-forwarding capabilities of the host's operating system.

One approach is to configure the web server to listen on an unprivileged port, such as 8000, instead of 80. Then, using a firewalling tool such as iptables, ipchains, or ipfwadm, redirect all traffic coming for port 80 to port 8000. Keeping a rule like this enabled at all times on a production machine will not noticeably affect performance.

Once this rule is in place, it's a matter of getting the new code in place, adjusting the web server configuration to point to the new location, and picking a new unused port, such as 8001. This way, you can start the "new" server listening on that port and not affect the current setup.

To check that everything is working, you could test the server by accessing it directly by port number. However, this might break links and redirections. Instead, add another port forwarding rule before the first one, redirecting traffic for port 80 from your test machine or network to port 8001.

Once satisfied with the new server, publishing the change is just a matter of changing the port-forwarding rules one last time. You can then stop the now old server and everything is done.

Now you have your primary server listening on port 8001, answering requests coming in through port 80, and nobody will have noticed the change.

 

Continue to:

  • prev: 5.8.2.2.1. Upgrading live server components by swapping machines
  • Table of Contents
  • next: 5.8.2.2.3. Upgrading a live server with prepackaged components







TOP
previous page: 5.8.2.2.1. Upgrading live server components by swapping machines
  
page up: HTML Version of the book
  
next page: 5.8.2.2.3. Upgrading a live server with prepackaged components


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com