Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My website runs on a dedicated Debian LAMP server . I would like to update the system (let's say I have a pretty old Debian version and I want to reinstall everything from scratch)

What strategy can I use to not have my website down while I am reinstalling everything?

Addendum

Of course I know I can buy another server in the meanwhile and change the DNS whenever it's done. But this doubles my work.

Aren't some service that maybe can act as a proxy-cacher for a limited amount of time? Maybe what does CloudFlare but caching everything not just images.

share|improve this question
    
If you aren't asking how to do this yourself, and instead looking for a service to do this for you, then your question probably is either a shopping question, or more appropriate for site like webapps.se. –  Zoredache Jun 2 '11 at 23:28

5 Answers 5

up vote 2 down vote accepted

Aren't some service that maybe can act as a proxy-cacher for a limited amount of time?

If your site is purely static, or at least is somewhat useful when setup read-only. Then you temporarily pay for some web-hosting, and then use something like wget, or similar tools to spider the static portion of your web site.

You could setup a proxy in the cloud, setup squid as a proxy to your site, adjust DNS temporarily so all access goes through the proxy, then configure Squid to operate in offline mode, after you have everything cached. You would probably want to script something that would have a browser visit all the important pages via the proxy, so everything gets into the cache.

share|improve this answer
    
A proxy in the cloud? Does cloud offer this? I don't think –  dynamic Jun 2 '11 at 23:35
2  
The cloud offers you base OS images where you can install any application you want to install. This blog post shows how to setup squid on Amazon EC2. kiragiannis.com/cloud-computing/… it is a bit out of date though. Also see forums.aws.amazon.com/message.jspa?messageID=75229 –  Zoredache Jun 2 '11 at 23:44
    
awesome link... i guess this is the way to do it –  dynamic Jun 2 '11 at 23:45
1  
AWS is a great plan. Pay a couple cents to have Amazon host your site for a couple hours. –  Brendan Long Jun 3 '11 at 4:15

If you don't want any downtime, then really the only option is to build your new install on separate hardware and when you're happy that it's all working correctly, alter your DNS settings to point to the new server.

If you don't have another physical server, you might consider running your app on a cloud server while you do the upgrade of your physical server.

share|improve this answer
    
I already knew of course to buy another server just for the swap. I wanted to know if there were simpler alternative... (because If I have to buy another server just for the excanghe I will have to doulbe the work) –  dynamic Jun 2 '11 at 21:36
    
I added some infos from the question. –  dynamic Jun 2 '11 at 21:38

Have a second server take the load, using a load-balancer or just by re-pointing the IP for the duration of the update. In fact, if you use a load-balancer, you can then leave both servers up afterwards.

This is assuming the site isn't database-dependent. So, given the limited set of facts you gave us, this is my simple answer.

share|improve this answer

If on a real crusade against new hardware (reasonable if you really, really don't have the budget) I would do this:

  1. Install a virtualization system. This can be Xen if the Debian install is old, but not old enough not to have Xen. Use VirtualBox or even QEMU if necessary.
  2. Install a virtualized Debian Squeeze system on a real system partition or logical volume. This will make it possible to "upgrade" this VM to primary OS later on. If you're using VirtualBox or QEMU your easiest choice will be to install to a separate hard disk. dedicating it fully to this VM.
  3. Install all services on the VM and test everything accordingly.
  4. When the time comes to switch, edit your grub.conf and boot into the new system. The VM (now physical server) will probably have to reconfigure itself because of the change of "hardware", but Linux is good at this. Remember to install grub on the new hardisk if there is one.

Have you considered upgrading Debian up to the latest version, though? Debian upgrades are remarkably good most of the time. If your current distribution is old enough not to be widely available on mirrors you can always use archive.debian.org until you reach a semi-current one.

share|improve this answer
    
Thanks for this answer. I am myself looking into this possibility; using virtualization for the only purpose to be able to upgrade OS / MySQL / etc without having to use new hardware. –  Rafa May 10 '12 at 21:36

I would start with a Virtual Machine. Build up a system and then move over your current website. That should let you know what is going to give you trouble in porting your app to a new version. If you don't have another server machine at some point you are going to have to take it down to do the upgrade but knowing ahead of time where your problems are is a big step towards minimizing downtime.

share|improve this answer
    
That sounds like doing dev and QA work, not planning for an actual cutover. Those are important steps, but it's not what he asked for. As a sysadmin, I'd assume that the dev team had tested their stuff on the updated platform. And if they hadn't but were requesting it anyway, I'd know who's heads would roll. –  mfinni Jun 2 '11 at 21:33

Your Answer

 
discard

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.