= TolkienSetupWordpress =
This TolkienSetup sub-guide describes the steps necessary to make the computer a [http://wordpress.org/ WordPress] server.
== Installing LAMP ==
The LAMP stack is required to host !WordPress.
If you selected the "LAMP server" task during OS install, this should already be installed. To verify, run the following command:
{{{
$ tasksel --list-tasks | grep lamp
}}}
To see the packages installed for the task, run:
{{{
$ tasksel --task-packages lamp-server
}}}
If you need to install this task, run:
{{{
# tasksel install lamp-server
}}}
== Installing !WordPress ==
References:
* http://www.supriyadisw.net/2006/12/wordpress-installation-on-ubuntu-with-lamp
* http://codex.wordpress.org/Installing_WordPress#Using_the_MySQL_Client
Download and extract the latest version of !WordPress:
{{{
$ wget http://wordpress.org/latest.tar.gz
$ mv latest.tar.gz wordpress-2.7.1.tar.gz
$ tar xvzf wordpress-2.7.1.tar.gz
}}}
"Install" !WordPress in your Apache install:
{{{
# mv wordpress/ /var/www/blog
}}}
Setup a MySQL database for !WordPress to use (be sure to write down the username and password somewhere safe):
{{{
$ mysql -u root -p
mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO "wordpressuser"@"localhost"
-> IDENTIFIED BY "supersecretpassword";
mysql> FLUSH PRIVILEGES;
mysql> EXIT
}}}
Edit the `/var/www/blog/wp-config-sample.php` file and save a copy of it as `/var/www/blog/wp-config.php` after setting the value of the `DB_NAME`, `DB_USER`, and `DB_PASSWORD` variables. e.g.:
{{{
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'wordpressuser');
/** MySQL database password */
define('DB_PASSWORD', 'supersecretpassword');
}}}
Edit `/var/www/blog/wp-config.php` again and replace the four "Authentication Unique Keys" values with some generated by [https://api.wordpress.org/secret-key/1.1/]. These will ensure that you DB encryption is harder to break. e.g.:
{{{
define('AUTH_KEY', 'IJ)|.e+A>4b TNh|e_BlRzzhij||n-7d&K-SUE/yg@^gg_]h7NBQgk=)}gK]QvcS');
define('SECURE_AUTH_KEY', 'R?@|aF+N^,Dasqz]_g~EB>kd&H+m-+,o3tl| -cip-s@jE{2)bUF*]PM1P_#tuv|');
define('LOGGED_IN_KEY', 'L@bUv)C:kkUW;FBb8?nQU_iEW`~|+m*-aJ{mE&0{]o?8MC{Yw$/j9{2+H*8O|t9|');
define('NONCE_KEY', 'Gn|[GsYA}/v9bBV6B28JAhxL>dq)V{Xhp1 /A;dWX;#gI/K|2RBYQ4;-Ep[');
}}}
Visit [http://madrivercode.com/blog/wp-admin/install.php] and finish up the install.
=== Apache Configuration ===
Enable Apache's `mod_rewrite`:
{{{
# a2enmod rewrite
}}}
Add the following section to `/etc/apache2/sites-enabled/000-default`:
{{{
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
}}}
Restart Apache:
{{{
# /etc/init.d/apache2 restart
}}}
== !WordPress Permissions ==
References:
* http://codex.wordpress.org/Changing_File_Permissions
The following commands will configure !WordPress' permissions correctly for normal use (replace `serveruser` with the user account that installed !WordPress on the server)):
{{{
# chown -R serveruser:www-data blog/
# chmod -R u=rwX,g=rX,o=rX blog/
# chmod g+w blog/.htaccess
# chmod -R g+w blog/wp-content/uploads/
}}}
Before using the automatic updater, run the following command to give the `www-data` user write access to the installation:
{{{
# chown -R www-data:www-data blog/
}}}
Revert back to the normal permissions after the upgrade is complete:
{{{
# chown -R serveruser:www-data blog/
}}}
== !WordPress Themes ==
References:
* http://wordpress.org/extend/themes/
Download, extract, and drop-in a new theme. e.g.:
{{{
$ wget http://wordpress.org/extend/themes/download/inove.1.2.3.zip
$ unzip inove.1.2.3.zip
$ cp -r inove/ /var/www/blog/wp-content/themes/
}}}
Themes I've downloaded to try out:
* http://wordpress.org/extend/themes/inove
* http://wordpress.org/extend/themes/corporate
* http://cutline.tubetorial.com/
== !WordPress Plugins ==
References:
* http://madrivercode.com/blog/wp-admin/plugin-install.php
Download, extract, and drop-in a new plugin. e.g.:
{{{
$ wget http://downloads.wordpress.org/plugin/wp-syntax.0.9.2.zip
$ unzip wp-syntax.0.9.2.zip
$ cp -r wp-syntax/ /var/www/blog/wp-content/plugins/
}}}
"Activate" the plugin via [http://madrivercode.com/blog/wp-admin/plugins.php].
Plugins I've downloaded to try out:
* http://wordpress.org/extend/plugins/wp-syntax/