Installing WordPress Locally on Gentoo Linux
If you have Apache, PHP and MySQL installed, you can skip right down to Installing WordPress.
Installing Apache
Just type
# emerge apache
Installing MySQL
MySQL is free database for personal use. First you need to emerge MySQL.
# emerge mysql
Now create the main MySQL database which contains administrative information and add password for root user on MySQL server.
# emerge --config =mysql-[version]
Next check if MySQL demon has started correctly.
# /etc/init.d/myslq start * Starting mysqld (/etc/mysql/my.cnf) ... [ ok ]
If there aren’t any errors, you’ve installed MySQL correctly.
Installing PHP
OK, next we’ll install PHP as Apache module.
# emerge dev-php/php mod_php
Now PHP is installed, but not active. To enable PHP, edit Apache configuration file
# vi /etc/conf.d/apache2
and put there this line
APACHE2_OPTS="-D DEFAULT_VHOST -D PHP4 -D USERDIR "
to browsing the directory where you keep your data add -D USERDIR
To check PHP, start the apache2 demon
# /etc/init.d/apache2 start
and make example test page
# vi /var/www/localhost/htdocs/test.php <?php phpinfo(); ?>
When you type in your favorite browser http://localhost/test.php, you should see settings of your Apache server. The next step is Installing WordPress!
Installing WordPress (using emerge)
Go to command line, and log to MySQL as root user.
# mysql -u root -p
Create WordPress database, example name wordpress
mysql> create database wordpress;
and WordPress user, example wordpress and add to him all privileges.
mysql> grant all on wordpress.* to wordpress@localhost identified by 'password_here';
Refresh privileges.
flush privileges
Now, leave MySQL command line.
mysql> exit
Installing WordPress is really easy
# emerge wordpress
Go to WordPress directory /var/www/localhost/htdocs/wordpress/ and edit wp-config-sample.php file. Change your code as in example.
// ** 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');
define('DB_HOST', 'localhost'); 99% chance you won’t need
to change this value, but if you crated MySQL user at 127.0.0.1
you have to change localhost to 127.0.0.1
Rename the file wp-config-sample.php to wp-config.php
Using your favorite web browser, visit wp-admin/install.php (example http://localhost/wordpress/wp-admin/install.php) and run the installing script.
This is really simple.
If you get an error about the database while running that script, check username, password etc., in wp-config.php file and be sure the MySQL is running ;)
Installing WordPress (development)
If you need more than one instalation of WordPress, you can copy emerge instalation (directory /var/www/localhost/htdocs/wordpress/) where do you need and modify config.php and create new database of course.
Also you can download the latest stable version WordPress and extract wordpress.tar.gz to your favourite directory. (or directories)
tar -xvvzf wordpress-[version].tar.gz
Thursday, 16 March 2006, 3:48 pm Pingback 山里的野å©å » Installing WordPress Locally on Gentoo Linux
[...] 转载:http://wojciechbednarski.com/articles/
installing-wordpress-locally-on-gentoo-linux [...]
Wednesday, 19 April 2006, 2:29 am by Bill Thielman
Well, based on your suggestions, I assumed the installation would be rather easy - and much to my surprise, it was even easier than I assumed! So far, it is a very attractive package, thanks!
Friday, 12 May 2006, 3:39 am by Joseph
Why not just emerge wordpress?
This out-of-date howto is still much easier than the above
http://gentoo-wiki.com/HOWTO_Apache2_with_WordPress
Friday, 2 June 2006, 8:57 am by Michael Lohmann
Why don’t you just emerge wordpress ??
You don’t have to download an extract the package.
Wednesday, 28 June 2006, 11:43 am Pingback How to Install Wordpress Locally on Your Computer « Quick Online Tips
[...] And more about Installing WordPress Locally on Gentoo Linux. Liked this article? Then grab our feed and get new posts instantly in your news reader, or get updates via email in your inbox or track with Technorati. [...]
Friday, 30 June 2006, 12:31 am by Wojciech Bednarski
Because I need more than one WordPress.
But you have right, most people use only one instalation of WordPress, so
emerge wordpressis more simple for them.I refresh my HOWTO for that. Thanks.
Monday, 20 November 2006, 1:48 pm by westi
Don’t forget if you need more than one WordPress install you can add “vhost” to your USE flags and use webapp-config to install multiple WordPress installs.
Wednesday, 3 January 2007, 8:59 am by László Patai
Thank for the excellent instructions. Happy NEw Year.