Symlink hell

I’ve been tasked with writing up an easily supportable deployment method that is ~90% idiot proof. Going off what most of our bigger dev partners use, this is going to be capistrano based with lots of symlinks. Also realized that I don’t even have a development version of my sites setup, so I’m taking care of that too.

Created a new vhost … something simple, dev.nerdifymylife.com (password protected and mod_pagespeed disabled) and some extra databases. I’m going to to use one vhost to host both my WordPress and Magento sites. I’m not super familiar with WordPress’ config files so I’ll start with Magento’s symlink hell.

 

Magento symlink structure:

Root dir: /www/sites/dev.nerdifymylife.com/files/

Webroot: /www/sites/dev.nerdifymylife.com/files/html/magento =>/www/sites/dev.nerdifymylife.com/files/magento_current/

Lets use some version control, we setup different dirs to support this.

Site version dir: /www/sites/dev.nerdifymylife.com/files/magento_release/

We symlink our app location in the webroot to magento_current and then symlink that to our present “version”.

ln -s /www/sites/dev.nerdifymylife.com/files/magento_release/011514/ /www/sites/dev.nerdifymylife.com/files/magento_current

ln -s /www/sites/dev.nerdifymylife.com/files/magento_current/ /www/sites/dev.nerdifymylife.com/files/html/magento

There are some files that will stay the same between versions of the site.

CE Config file: /www/sites/dev.nerdifymylife.com/files/html/magento/app/etc/local.xml => /www/sites/dev.nerdifymylife.com/files/magento_shared/app/etc/local.xml

Var dir: /www/sites/dev.nerdifymylife.com/files/html/magento/var/ => /www/sites/dev.nerdifymylife.com/files/magento_shared/var/

Media dir: /www/sites/dev.nerdifymylife.com/files/html/magento/media/ => /www/sites/dev.nerdifymylife.com/files/magento_shared/media/

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.