NOTE: You must have the LAMP stack installed before installing WordPress.
Create the WordPress database, user, and password
mysql -u root -p |
Now, create the database and user for your WordPress installation. You can replace WPdatabase, WPuser, and WPpassword with your own database name, username, and password in the following commands:
CREATE DATABASE wordpressdb; |
Â
CREATE USER WPuser@localhost IDENTIFIED BY 'WPpassword'; |
Â
GRANT ALL PRIVILEGES ON WPdatabase.* TO WPuser@localhost; |
Now, flush the privileges and restart the service:
FLUSH PRIVILEGES; |
Â
exit |
Download WordPress
wget http://wordpress.org/latest.tar.gz |
Now, extract the compressed file to your home directory:
tar -xzvf latest.tar.gz |
Configure WordPress
Begin by copying the sample config file into a new file:
cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php |
Now open the file in Nano so that it can be edited:
vi ~/wordpress/wp-config.php |
Once you have the wp-config.php file open in vi, go through it and replace wpdatabase, wpuser and dbpassword with the database name, username and password you created in the first step. Then save your changes and exit vi.
Move WordPress to the web root
Now that WordPress is configured, you will need to move the contents of the WordPress directory to your website's web root directory:
sudo cp -r ~/wordpress/* /var/www/html |
Install php-gd
If you have not already installed php-gd, you will need to do so for WordPress:
sudo yum install php-gd |
Restart Apache
sudo service httpd restart |
Now complete the WordPress setup now located at http://yourdomain.com/wp-admin/install.php, where 'yourdomain.com' is replaced with your actual domain.