WordPress on Centos 6.3

Home » Computer Articles » Linux » WordPress on Centos 6.3
November 5, 2012 Linux No Comments

Do a basic installation of Centos 6

Normally I will go with the defaults.

 

Once the server is installed, make sure and do all updates.

# yum update click the enter key.

 

You will need to install Apache, PHP and MySQL

# yum install httpd php php-mysql mysql-server mysql-client click the enter key.

 

Start MySQL and setup a secure installation.

# service mysqld start click the enter key.

# mysql_secure_installation click the enter key and answer the questions.

# chkconfig mysqld on start mysql when server restarts.

 

Edit the Apache config file to enable htaccess.

# vi /etc/httpd/conf/httpd.conf search for htaccess and change AllowOverride None to AllowOverride All (You can also put the directives you need. Like Options FileInfo AuthConfig Limit)

Also we need to adjust apache to run better on VPS (Virtual Private Servers). Of course if you have one.

Edit your /etc/httpd/conf/httpd.conf and change the parameters below.

Timeout 100

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5

StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 150
MaxClients 150
MaxRequestsPerChild 300

Go to the reference area and click on link to have a better explanation on the adjustments.

 

Start Apache and test for php

# service httpd start

# vi /var/www/html/phpinfo.php and put information below.

<?php
phpinfo();
?>

If you go the the website do you see PHP Info page. If you do then everything is working so far.

 

Lets download and install WordPress

Change into your web servers root directory, default is below.

# cd /var/www/html

 

Download WordPress

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

Extract the files

# tar -zxvf latest.tar.gz

Copy all the files to the root directory.

# cd wordpress

# mv * ../

# rm -rf wordpress This removes the WordPress directory.

 

Lets install WordPress on the server.

First we need to create a database for the new installation.

Login into mysql, # mysql -p

mysql> CREATE DATABASE wordpress;

mysql> CREATE USER wpuser@localhost;

mysql> SET PASSWORD FOR wpuser@localhost= PASSWORD("password");

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wpuser@localhost IDENTIFIED BY 'password';

mysql> FLUSH PRIVILEGES;

 

Go to a web browser and go to your url, http://yoururl and you should see the WordPress installation. Go through the WordPress installation until you are finished.

You will need to create a wp-config.php file and copy the information from the installation script.

 

Make sure you are in the /var/www/html directory and set the owner of the files to apache.

# chown -R apache:apache * If you don't do this you will have problems with permalinks later. This should have been done before the start of the WordPress installation. So you don't have to manually create the wp-config.php.

 

At the end you should see a fresh new WordPress Installation.

Of course now you can download and install new themes, plugins and customize to whatever to want.

 

References:

http://www.liquidweb.com/kb/apache-optimization/

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.