Tag Archives: php

How to set up RHEL or CentOS 5.5 with Apache, MySQL, PHP 5.3 and WordPress

This is just a short how-to on what I did to set up WordPress on my VPS server. This assumes you’re running RHEL, CentOS or Scientific Linux 5.5.

These instructions assume that you know how and when to use root. Whether it be via sudo or not.

Rather than going with the minimum requirements(*) from WordPress I went with PHP 5.3.

PHP version 4.3 or greater
MySQL version 4.1.2 or greater

Installing MySQL and Apache

1) Install MySQL and Apache

# yum install mysql-server httpd

2) Add MySQL and Apache to the appropriate run levels

# chkconfig --level 345 mysqld on
# chkconfig --level 345 httpd on

3) Adding the PHP 5.3 repository

# rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm

4) Installing PHP 5.3 via YUM

# yum --enablerepo=webtatic install php php-mysql

Set up MySQL

1) Start MySQL.

# service mysqld start

2) Set the root password.

# mysqladmin -u root password 'your password'

The 5th step is to set up the database and database user for WordPress 

1) Log in to mysql

# mysql -u root -p

Enter your password when prompted.

2) Create the database

> CREATE DATABASE wordpress CHARACTER SET = utf8 COLLATE = utf8_general_ci;

3) Create the database user and assign appropriate rights. In the example the user is called “wp”.

> CREATE USER 'wp'@'localhost' IDENTIFIED BY 'db_passwd';
> GRANT ALL PRIVILEGES ON wordpress.* TO 'wp'@'localhost' IDENTIFIED BY 'db_passwd';
> FLUSH PRIVILEGES;

The 6th step is to download and install WordPress

1) Download

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

2) Create the wordpress folder.

# mkdir /var/www/html/wordpress

3) Extract

# tar -xzvf latest.tar.gz -C /var/www/html

4) Modify folder ownership.

# chown apache:apache /var/www/html/wordpress -R

-R, –recursive change files and directories recursively

5) Go to http://your site/wordpress and follow the on screen instructions.



// CrashMAG