bainternet
9/29/2011 - 9:45 PM

Install WordPress On clean centos

Install WordPress On clean centos

#Install the required system packages
yum -y install mysql-server httpd php php-mysql unzip wget

#update php since WordPress 3.2.1 needs php5.2 and up
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
yum --enablerepo=webtatic install php php-common php-eaccelerator php-mysql php-devel -y

#to install git uncomment this next line
#yum install --enablerepo=webtatic git-all -y

#start apache and mysql
chkconfig httpd on
chkconfig mysqld on

/etc/init.d/mysqld start
/etc/init.d/httpd start

#configure Mysql root password
mysql -u root
use mysql;
#change root password (replace NEWPASSWORD with your new password)
update user set password=PASSWORD("NEWPASSWORD") where User='root';
flush privileges;

#Create a WordPress database and MySQL User 
#you default is database: wordpress user: wordpress_User pass: DataBase_pass 
#you can and should change this to what ever you want

CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress_User'@'localhost' IDENTIFIED BY 'DataBase_pass';
FLUSH PRIVILEGES;
quit;

#Download WordPress

cd /var/www/html
wget http://wordpress.org/latest.zip

#Extract WordPress

unzip latest.zip
rm latest.zip

#Move WordPress to Root Directory

mv wordpress/* ./
rmdir wordpress/

#Give WordPress permissions to write

mkdir wp-content/uploads wp-content/cache 
chown apache:apache wp-content/uploads wp-content/cache ./
chown -Rf apache *

##############################
#         all DONE !!!       #
#Open and configure WordPress#
##############################
# http://your-server-ip-or-hostname/ or http://your-server-ip-or-hostname/wp-admin/install.php