Installing WordPress on Gentoo Linux

The following steps need to be performed

  1. emerge WordPress
  2. Install WordPress using webapp-config
  3. Configure the MySql database
  4. Edit the wp-config.php file

1. emerge WordPress

Before emerging WordPress, add “vhosts” to your use variables in your /etc/make.conf file. This will allow multiple copies of WordPress to be installed, updated and deleted using the webapp-config tool.

emerge -av wordpress

2. Install WordPress using webapp-config

Since we are using the “vhost” use variable, emerging WordPress does not fully install it. We need to use the webapp-config tool to complete the installation.

webapp-config -I wordpress 1.5.2 -h yourhostname.org

This will install a copy of WordPress in the directory /var/www/yourhostname.org/htdocs. If you wish to install wordpress in another location, you can edit the /etc/vhosts/webapp-config file and change the VHOST_ROOT settings. Note that “1.5.2” refers to the version of WordPress that you have previously emerged.

3. Configure the MySql database

Firstly login to Mysql.

mysql -uroot -p

Next we need to create a database for WordPress to use. Keep a note of this information as we will need it later to configure the wp-config.php file.

CREATE DATABASE yourdatabase;

We also need to create a user to access this database.

GRANT ALL PRIVILEGES ON yourdatabase.* TO 'yourusername'@'localhost' IDENTIFIED by 'yourpassword';

Now flush the privileges and exit.

FLUSH PRIVILEGES;
exit

4. Edit the wp-config.php file

In the directory where you have installed WordPress copy the example config file to w-config.php.

cp wp-config-sample.php wp-config.php

My copy of wp-config.php had those nasty control-m characters at the end so let’s remove them just in case.

dos2unix wp-config.php

Now edit this file and enter the information for the database you created in the previous step. Assuming you have set up your web server correctly, you can now use a browser to navigate to http://yourhostname.org/wp-admin/install.php.

Congratulations, you should now have a working WordPress installation.

Useful Links

Leave a Reply