Cain Manor

Your Guide To All Things Cain™

WordPress 2.5 on a fresh CentOS 5.0 install — Part 2

Now that we have the OS ready for the word­press install, let’s fin­ish up…

Go to the root direc­tory of your server

cd /

down­load the lat­est word­press (2.5 in this case.)

wget http://wordpress.org/latest.tar.gz

Unzip it and untar it.

gun­zip wordpress-2.5.tar.gz

tar xvf wordpress-2.5.tar

Now con­fig­ure mysql for wordpress

mysql –u root –p
Enter pass­word:
Wel­come to the MySQL mon­i­tor. Com­mands end with ; or \g.
Your MySQL con­nec­tion id is 4 to server ver­sion: 5.0.22

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> cre­ate data­base blog;
Query OK, 1 row affected (0.00 sec)

mysql> grant all priv­i­leges on blog.* to “<word­press User Name>”@”<localhost>” iden­ti­fied by “<your Pass­word>”;
Query OK, 0 rows affected (0.00 sec)

mysql> flush priv­i­leges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
Con­fig­ure the data­base con­nec­tion for wordpress

vi /wordpress/wp-config.php

change these lines as appropriate

[root@CainManor word­press]# cat wp-config.php
<?php
// ** MySQL set­tings ** //
define(‘DB_NAME’, ‘blog’); // The name of the data­base
define(‘DB_USER’, ‘word­press’); // Your MySQL user­name
define(‘DB_PASSWORD’, ‘<your passwd>’); // …and pass­word
define(‘DB_HOST’, ‘local­host’); // 99% chance you won’t need to change this value

I pre­fer to have my blog live under my cainmanor.com domain, rather than a sub­di­rec­tory. To do that, you have to edit your apache conf file..

vi /etc/httpd/conf/httpd.conf

look for

# Doc­u­men­t­Root: The direc­tory out of which you will serve your
# doc­u­ments. By default, all requests are taken from this direc­tory, but
# sym­bolic links and aliases may be used to point to other loca­tions.
#
#Doc­u­men­t­Root “/var/www/html”

and change Doc­u­men­t­Root to

Doc­u­men­t­Root “/wordpress”

and

# This should be changed to what­ever you set Doc­u­men­t­Root to.
#
#<Direc­tory “/var/www/html”>

to

<Direc­tory “/wordpress”>
restart httpd to pick up the changes to Doc­u­ment Root

ser­vice restart httpd

Point your browser to

http://<your IP>/wp-admin/install.php

Con­grat­u­la­tions!! You just installed Word­Press from scratch.

Comments are closed.