WordPress installation – 16 commands from start to finish

The 16 commands you need for a fully functional WordPress installation.

Install the required packages:

yum -y install mysql-server httpd php php-mysql php-gd unzip wget
service mysqld start
mysql_secure_installation

Commands suggested by the mysql installer for setting the root passwords are below; if you run mysql_secure_installation as shown above, these are not necessary:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h optics.eng.ox.ac.uk password 'new-password'

Activate the database and web server services:

chkconfig --levels 345 httpd on
chkconfig --levels 345 mysqld on
service mysqld restart
service httpd restart

Add WordPress tables to the MtSQL database:

mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER wordpressuser@localhost;
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("your_wp_password");
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'your_wp_password';
FLUSH PRIVILEGES;
exit

Install WordPress and edit config file:

cd /var/www/html/
wget http://wordpress.org/latest.tar.gz
tar xvzf latest.tar.gz
chown -R root.root wordpress
cd wordpress/
mkdir -p wp-content/{uploads,cache}
chown -R apache:apache wp-content
cp wp-config-sample.php wp-config.php
nano ~/wordpress/wp-config.php
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpressuser');
define('DB_PASSWORD', 'your_wp_password');

and add to the bottom:

/** enable updates / plugin installs without ftp access */
define('FS_METHOD','direct');

Your new WordPress site shuld now be available at http://your.domain/wordpress/

To complete the installation log in at http://your.domain/wordpress/wp-admin/, set the admin password, create new users, modify the various site defaults, select a theme and perhaps even edit the main style.css file.

Leave a Reply

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