rajatarya.com website

rajatarya.com website

rajatarya.com website


This page describes the construction and ingredients involved in this website.  It also describes the process I’ve put in place to make the site more modular.  The major application on this site is WordPress.  Additionally WebSVN provides the SVN viewer and hopefully I’ll have some other fun web applications hosted here soon enough.


Plugins Being Used

Let me know if you have similar functionality on your site and are using different plugins.  I’m always on the lookout for an ‘upgrade’.  Drop me a line at raj...@rajatarya.com or one of the other methods listed here.


The site is built with a modified TwentyTen theme along with custom CSS.

Site Environment Setup and Deployment Process

After breaking this site for weeks on end by trying out a new plugin and then walking away from my system I got tired of being scared to try new things on my site.  That is one the main reasons to have a website so it seemed stupid for me to keep from doing tinkering.

My approach to this problem was to modularize the components of the site so I could work on them in a development environment (playground) that mimicked the production environment and then deploy the site to production when I felt good about adding a feature.  I hadn’t read anything about modularizing WordPress or Gallery, but figured they can’t be that hard to modularize (considering they are pretty easy to install).

Path to Modularization:

  1. Backup existing WordPress DB and Gallery DB (I had MySQL as my backend for both of these on Site5, so I had to back them up to move them to Dreamhost anyway).
  2. Backup all files for WordPress and Gallery (for me this meant a cleverly constructed tar statement excluding some cruft I didn’t want to carry forward)
  3. Create an SVN repository for the website project
  4. Remove all the files that you don’t want to make part of the project (especially wp-config.php and gallery2/config.php), but for me that also included: wp-cache cached files, last.fm cached images, unused themes and plugins from both WordPress and Gallery.
  5. Import the file backups to the repository, making sure to remove the wp-config.php and gallery2/config.php files (important!).
  6. Now you have a repository with all the files you would want.
  7. Create a developer environment somewhere (you can use a subdomain if you would like or I recommend XAMPP).  Remember to check out the files from the SVN repository for the developer environment.
  8. Import the DBs to the developer environment MySQL.  I used different db names to help differentiate things.
  9. Manually copy over the wp-config.php and gallery2/config.php into the developer environment and modify it to point to the developer instances of the databases
  10. If you are using a publicly facing dev environment (like playground.domainname.com or something) then make sure to add a robots.txt that disallows everyone, like the following (look here for more info):
    User-agent: *
    Disallow: /
  11. Add an .htaccess file for the directory so that nosy folks won’t be poking at stuff that isn’t ready yet.  Lots of docs on how to do this, referring to Dreamhost docs here.
  12. To keep from having extraneous files “deployed” to production I created a “clean” local repository that I used for deployments, meaning that I had the following:
    playground environment DocumentRoot: #HOME/playground
    playground SVN path: $HOME/code/playground/trunk
    production environment DocumentRoot: $HOME/production
  13. Create some scripts, or use the ones I document below to deploy code changes from the developer environment to the production environment.
  14. Rejoice!

Deployment Scripts Involved

I created two little scripts to help with my setup:

  • webcompare.sh – compares the playground SVN path with the production site to help me see what files are actually going to get deployed to production with the release, and to make sure something I don’t want to deploy is easy to spot.  I also run this after a deployment to make sure I didn’t miss anything.
  • deploysite.sh – tars up the site from the playground SVN path and then untars it over the production path, and finally tags the release in SVN.

These little scripts are nothing too exciting but they have provided me with enough of a process that I can test/try/play with new features on my site without worrying about breaking existing functionality.  It was a little work (especially because my bash programming skills are so weak) but now I am significantly happier with the site’s longevity.

Let me know how you maintain your site to allow for flexibility and feel free to suggest additional ways I can improve this process.  Shoot me a note at raj...@rajatarya.com.

The Nitty Gritty

If you want to see the files modified for the site then check out the WebSVN look at the repository below.  I have only exposed up the trunk branch because I’m not sure why looking at the tagged releases would be useful to anyone besides me.