Installing WordPress Locally on Gentoo

Posted in Gentoo, Linux, Open Source by Rahul on February 25, 2010

EDIT: New Location for post and the blog.

There are already a couple of informative articles on this. Good as they are, I managed to run into a couple of problems that are not detailed on these articles possibly due to the fact that they were written a long time ago. Therefore this article, to help others (and me) who in the future wish to achieve the same that I did.

USE Flags

  • dev-lang/php apache2 mysql (in addition to ones already enabled by default)
  • www-apps/wordpress vhosts

Emerge WordPress

  • emerge -av wordpress

Install WordPress using webapp-config

  • webapp-config -I wordpress 2.9 -d wordpress

Configure the MySql database

  • mysql -u root -p (login to MySql)
  • CREATE DATABASE databasename; (create a database, replacing databasename with the name that you wish to choose)
  • GRANT ALL PRIVILEGES ON databasename.* TO username@localhost IDENTIFIED by ‘password’; (Create a user for the above database, replacing username with the name that you intend to use. Similarly with password)
  • exit

Configure WordPress

  • vi /var/www/localhost/htdocs/wordpress/wp-config.php (and verify the following settings)
// ** MySQL settings ** //
define('DB_NAME', 'wordpress');     // The name of the database
define('DB_USER', 'username');     // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost');

Configure apache2

  • vi /etc/apache2/httpd.conf
  • Comment out the following line: LoadModule unique_id_module modules/
  • Add the following to the end: ServerName localhost
  • vi /etc/conf.d/apache2
  • Add the “-D PHP5” to the options passed in APACHE2_OPTS

You are set to go


5 Responses

Subscribe to comments with RSS.

  1. […] Here is the original: Installing WordPress Locally on Gentoo « Muses […]

  2. Warren said, on April 1, 2010 at 7:00 pm

    You misspelled privileges in the mysql part.

    • rahulthewall said, on April 2, 2010 at 1:28 pm

      Thanks. Fixed that. Also added info about “-D PHP5” that needs to be added to APACHE2_OPTS. 🙂

  3. Blog Configuration | Aaron's Blog said, on February 17, 2012 at 5:46 am

    […] far as the VM goes it runs gentoo linux and installing wordpress on it was very easy following this guide.  The only issue I ran into with wordpress is that word press uses the URL that you use to […]

  4. akismet227 said, on July 20, 2014 at 7:13 am

    hi – have there been any further updates or links to further tutorials for setting up wordpress on Gentoo as local host development, I am a real novice in linux and Gentoo – loving it but the learning curve is quite steep 🙂 any help is appreciated.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: