My AWS EC2 free tier is expired, so I switched to a fully-dotcloud-hosted site (originally I’ve host MySQL on dotcloud). Here are some notes we need to take care.
First, create a new directory and execute ‘dotcloud create’ command:
1 2 3 4 5 |
% mkdir blog % cd blog % dotcloud create blog |
Second, download latest wordpress tar ball and unpack it:
1 2 3 |
% curl -O http://wordpress.org/latest.zip % unzip latest.zip |
Since I prefer to isolate the whole wordpress directory from root directory, here is the dotcloud.yml I used:
1 2 3 |
www: type: php approot: wordpress # <- latest.zip unpacked in here. |
According to official documentation, the nginx.conf contains only one line:
1 |
try_files $uri $uri/ /index.php; |
So the current directory look is:
1 2 3 |
% ls -al . .. dotcloud.yml nginx.conf wordpress |
Next, put the postinstall script (with chmod u+x) in wordpress/:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
!/bin/bash if [ -d ~/data/wp-content ]; then echo "have old data" mv -n ~/current/wp-content/plugins/* ~/data/wp-content/plugins mv -n ~/current/wp-content/themes/* ~/data/wp-content/themes rm -rf ~/current/wp-content else echo "create data" mkdir -p ~/data/wp-content mv ~/current/wp-content ~/data fi cp -Rp ~/data/wp-content/* ~/current/wp-content/ # <- <strong>I use cp instead of ln here because the dirname() problem</strong> |
Finally, modify your wp-config.php properly, then push to dotcloud, rock!
dotcloud push blo