- Joined
- May 16, 2014
- Messages
- 20
- Points
- 1
WordPress is a famous Content Management System(CMS) running with PHP and MySQL. We can setup WordPress in different ways. The most used method is by using a tool such as Softaculous and install it graphically. Here we are describing the steps to do the WordPress installation via command line with an Apache server and MySQL on a Centos 7 server.
- Create a database and user to use with the WordPress.
a. Login to MySQL:
mysql -u root -p
b. Create a new database:
CREATE DATABASE wordpress;
c. Create a user:
CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
d. Set up the privileges:
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
e. Then run the following commands:
FLUSH PRIVILEGES;
exit - Download and install WordPress:
a. Download WordPress:
wget :wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
cp -avr wordpress/* /var/www/html/
cd /var/www/html
chown -R apache:apache /var/www/html/
mv wp-config-sample.php wp-config.php
vi wp-config.php
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpressuser');
define('DB_PASSWORD', 'password');
Replace the DB 'wordpress',user 'wordpressuser' with actual ones and provide the correct password in the place of 'password'.
Once done save the file.
- We can access it with the site URL from the browser and you will get the WordPress initial setup page and you are done.