From Zero to Web2Ireland using Wordpress on Digital Mines in 15 mins

#“From Zero to Web2Ireland using Wordpress on Digital Mines in 15 mins”

We decided to move Web2Ireland.org over to Digital Mines for AWS hosting. I'm a big fan of how easy Digital Mines has made the deployment of Amazon servers. I thought it might be useful to show the steps to get a Wordpress blog up and running with such a setup. 

Note this doesn't include the incredibly simple steps to sign-up for Digital Mines itself and to click "Deploy" to get your server. All of the steps below were carried out in Putty on Windows connected by SSH to the deployed server.
  • Setup Apache, MySQL and PHP
    sudo tasksel
    Select LAMP server
    Give a root password for MySQL when asked
  • Create directory for Wordpress
    cd /var/www
    sudo mkdir vhosts
    cd vhosts/
    sudo mkdir blahblahblah.com
    cd blahblahblah.com
  • Get and uncompress Wordpress
    sudo wget http://wordpress.org/latest.zip
    sudo apt-get install unzip
    sudo unzip latest.zip
    sudo rm latest.zip
    sudo chown -R www-data.www-data *
    cd wordpress/
    sudo mv * ..
    cd ..
    sudo rm -rf wordpress/
  • Create a database for Wordpress
    mysql -u root -p
    create database blahblah;
    GRANT ALL PRIVILEGES ON blahblah.* TO "blahblahuser"@"localhost" IDENTIFIED BY "blahblahpassword";quit;
  • Tell Wordpress about the Database
    sudo cp wp-config-sample.php wp-config.php
    sudo vim wp-config.php
    Edit the database details in that file
  • Configure Apache
    cd /etc/apache2/sites-enabled/
    sudo cp 000-default blahblahblah.com
    sudo rm 000-default
    sudo vim blahblahblah.com 
    <VirtualHost *:80>  
    ServerAdmin conor@blahblah.com
    ServerName blahblahblah.com

    ServerAlias www.blahblahblah.com

    DocumentRoot /var/www/vhosts/blahblahblah.com

    <Directory />

    Options FollowSymLinks

    AllowOverride None

    </Directory>

    <Directory /var/www/vhosts/blahblahblah.com>

    Options Indexes FollowSymLinks MultiViews

    AllowOverride All
    Order allow,deny allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # alert, emerg.

    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    </VirtualHost>
  • Setup URL rewriting 
    sudo vim /var/www/vhosts/blahblahblah.com/.htaccess
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L] </IfModule>

    sudo a2enmod rewrite
    sudo service apache2 restart
  • Install APC for improved performance
    sudo apt-get install php-apc
    cd /etc/php5/conf.d
    sudo vim apc.ini
    extension=apc.so
    apc.enabled=1
    apc.enable_cli=1
    apc.shm_segments=1
    apc.shm_size=32
    apc.cache_by_default=1
    apc.stat=1
  • Restart Apache sudo service apache2 restart
Outside of that we had to:
  • Move DNS servers from old provider to DNSMadeEasy 
  • Add an entry to AuthSMTP to handle email sending
  • Do a Database Import/Export from existing Web2Ireland server
  • Copy over theme files and old uploads from existing Web2Ireland server
Obviously you want to install other performance doo-dahs like Donncha's WP-Supercache too. 

Done!

If you want to know the couple of steps to get Putty talking to your server, let me know in the comments.

Conor O'Neill

Tech guy who likes running slowly

Bandon, Cork, Ireland https://conoroneill.net