Server administration WordPress, quick install on CentOS

Underground Forum

Underground Forum

  • #1

What is wordpress?​

WordPress is the most popular CMS (Content Management System) in the world.

WordPress installation​

Server preparation​

# Install LAMP (Apache, MySQL, PHP)
sudo yum install httpd mariadb-server php php-mysql
# Install php-gd
sudo yum install php-gd
# Start Apache
sudo systemctl start httpd
sudo systemctl enable httpd
# Start the MySQL service
sudo systemctl start mariadb
sudo systemctl enable mariadb
# Next, set the MySQL root password
sudo mysql_secure_installation
# Log in to MySQL as the root user
mysql -u root -p
# Create a new database
# Create a new user
CREATE USER wp_user@localhost IDENTIFIED BY 'password';
# Give wp_user permission to use the wp database
GRANT ALL PRIVILEGES ON wp.* TO wp_user@localhost IDENTIFIED BY 'password';
# Confirm action
# Exit
# Restart Apache
sudo service httpd restart

Install the WordPress​

# Download the archive with the wordpress and extract it's contents to the directory /var/www/html/

yum install tar
tar xzvf latest.tar.gz
yum install rsync rsync-daemon
sudo rsync -avP ~/wordpress/ /var/www/html/
mkdir /var/www/html/wp-content/uploads

# Transfer permissions to /var/www/html/ to the root user
sudo chown -R root:root /var/www/html/*

# Copy the wp-config-sample.php file under /var/www/html and save it as wp-config.php
cd /var/www/html
cp wp-config-sample.php wp-config.php

# Open and uncomment the wp-config.php configuration file, write in it the data for connecting to your database and save.
define('DB_NAME', 'wp');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'password');

# Allow Apache to serve requests over http: and https:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https

# Restart firewall
sudo firewall-cmd --reload

WordPress will be available at:
http://[ip address]

Wordpress install