1

I'm looking to do a blue-green(ish) deployment on a single server (single server due to various factors like having a very simple static site, upcoming infra overhaul, among others). Would the following design be adequate for having minimal/no downtime on an apache server?

/var/www/vhosts/site -> ./site-blue
/var/www/vhosts/site-blue/
/var/www/vhosts/site-green/
/var/www/vhosts/swap.sh

For deployment, we would update the inactive site slot then swap the symlink to point to the other color, then restart the server. I'm pretty sure the symlink will work fine (I see a +FollowSymLinks option for the <Directory> tag in the apache conf file) little uncertain about the swap+restart step.

3
  • 2
    Having a single apache server is not the way to achieve little to no downtime.
    – user143703
    Commented Aug 24, 2017 at 20:42
  • I guess you need more details - I actually have two (with replication between them), but don't want four (which would allow a true blue-green setup). Our site is pretty low traffic (low impact to the company if something goes wrong) and we're moving to an entirely new infrastructure (which is more robust) in a week so there's no sense in overbuilding right now. Our deployment time just went from a second to an hour, hence the need to have this active/inactive solution (because we don't want to be serving out of a directory that is being actively modified during a deployment)
    – s g
    Commented Aug 24, 2017 at 22:40
  • As far as the symlinking goes, that looks to be pretty close to what I've seen in use at several companies. At my last job we did exactly the same thing except we'd deploy new versions into the directory and symlink to the version we want. That eliminates having to worry about which version is the right one in an emergency.
    – user143703
    Commented Aug 24, 2017 at 22:59

0

You must log in to answer this question.

Browse other questions tagged .