Basic wordpress installation

Installs a basic wordpress with mysql

WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL.

Installs the latest wordpress version available at wordpress.org along with mysql database using default credentials (connecting only from localhost, default user root, password is blank)

Configuration summary

Debian Wheezy 7.0 Debian Wheezy 7.0
Package apache2.2-common install
Files

/etc/apache2/sites-enabled/wordpress.conf ensure file exist

<VirtualHost _default_:80>
        DocumentRoot /var/www/wordpress
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

/etc/apache2/sites-enabled ensure directory exist

/var/www/wordpress Permissions: www-data : www-data ensure directory exist

/var/www ensure directory exist

Package apache2 install
Hooks

Post download-wordpress-source

- parameter 1: https://wordpress.org/latest.tar.gz
#!/bin/bash
# make sure you do not use an uninitialised variable
set -u

# script will exit at first error
set -e

tar xzf  $1 -C /var/www

chown -R www-data:www-data /var/www/wordpress

Post configure-apache

#!/bin/bash
# make sure you do not use an uninitialised variable
set -u

# script will exit at first error
set -e

#!/bin/bash

a2enmod rewrite
a2dissite 000-default

/etc/init.d/apache2 reload
Package mysql-server install
Hooks

Post wordpress-database

#!/bin/bash
# make sure you do not use an uninitialised variable
set -u

# script will exit at first error
set -e

echo "CREATE DATABASE wordpress;" | mysql

echo "CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';" | mysql
echo "GRANT ALL PRIVILEGES ON * . * TO 'username'@'localhost';" | mysql
echo "FLUSH PRIVILEGES;"

Package libapache2-mod-php5 install
Package php5 install
Package php5-mysql install

Quick Deployment
Advanced Deployment