Setting up a wordpress website, some instructions consolidated (tested on EC2)


Along with the stuff easily available on google, here goes more shit that needs to be taken care of.

  1. sudo apt-get install php5-mysql php5-common libapache2-mod-php5 php5-tidy php5-xmlrpc php5-mcrypt php5-curl php5-gd php5-mhash php5-cli
  2. sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
  3. sudo apt-get install libapache2-mod-auth-mysql php5-mysql
  4. sudo apt-get install php5-gd libssh2-php
  5. sudo a2enmod rewrite

Some useful links

  1. Create a default .htaccess on the wordpress folder (same level as wp-content)
  2. Ensure chmod 666 .htaccess and chwon www-data:www-data .htaccess
  3. On the wordpress folder, ensure chwon www-data:www-data -R /var/www/html
  4. .htaccess should be in /var/www/html/ folder
  5. Check .htaccess, should have# BEGIN WordPress

    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]

    # END WordPress

  6. .htaccess should be in wordpress folder
  7. phpinfo() should report mod_rewrite in Loaded Modules
    Loaded Modules core mod_log_config mod_logio prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_reqtimeout mod_rewrite mod_setenvif mod_status
  8. sudo a2enmod rewrite
  9. # sudo apachectl -t -D DUMP_MODULES
  10. sudo nano /etc/apache2/sites-enabled/000-default or 000-default.conf
    That opened a document which contained the following where I changed the ALLOWOVERRIDE from NONE to ALL.Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all
  11. If 000-default file does not have the lines add these
    #Include conf-available/serve-cgi-bin.conf<Directory /var/www/html >

    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted

    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted


  12. Ensure sudo /etc/init.d/apache2 restart

After you install WP Total Cache, this link is important to help setup memcached
3) Dont forget to update /etc/php5/apache2/php.ini (not the cli/php.ini)

  1. Setting up auto backups
  2. Dont forget to change the automysqlbackup directory to Dropbox folder
  3. sudo vi /etc/crontab
  4. #MySQL Daily backup
    00 00 * * * root /opt/ >/dev/null 2>&1
  5. sudo vi /opt/
    Add one line sudo automysqlbackup
    sudo /etc/init.d/cron restart