How I deploy static sites
We’ve all heard over and over about how we should be keeping things under source control – and for important sites, you probably do. But what about static sites? Do you keep them under source control, or do you just edit them manually?
I’ve recently been busy moving some of my own static sites from one server to another, which has given me a good opportunity to examine my own server (mis)configuration. With that in mind, I think I’ve now found the best way(for me, at least) to deploy static sites.
First off, create a source control repository for your site. I like Git, so that’s what I used:
Once that’s done, create the folders that you need for all of your site’s files(I like conf, logs, and public):
At this point I tend to create whatever configuration files I need, and store them all in conf. I also like to create empty log files and keep them in source control, so that anytime I do a fresh deploy of my site I also get blanked log files.
Once your configuration files are set up how you like them, and you’re happy with how your local version of the static site has turned out, it’s time to deploy. Commit your changes to your repository, and then log into your server so that you can check out the code for your site. Once that’s done, all you have to do is check out your code and symlink some config files:
With that done, restart your server, and…you’re good to go! And anytime you need to update your site, you can make all the changes locally, commit them, and then just update it on the server. (I wrote a script that retrieves any new changes, and then restarts the servers it needs to)
Posted by Luke on December 14, 2009 | Comments (0)
Recent Posts
-
If you love your users, set them free.February 6, 2010
-
Let a professional at itFebruary 4, 2010
-
Micro RentalsJanuary 19, 2010
-
Lift on Venture's Fast Growth 50!January 6, 2010
-
How I deploy static sitesDecember 14, 2009
Heavy Lifting
-
A Rose by Any Other Name...June 8, 2009
-
Keep your head up.October 22, 2008
-
Keep It Simple StupidAugust 22, 2008
-
Turning green isn’t only for the HulkJuly 28, 2008
-
The shoemaker’s kids are walking around barefoot.June 20, 2008
Monthly Archives
- February 2010
- January 2010
- December 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009

Add the first comment...