How to install Wordpress on Centos

About Wordpress

WordPress is a free and open source blog software and content management system based on PHP and MySQL as the platform. WordPress has a plugin architecture and template system. Alexa Ranking More than 16.7% of the top 1 million websites use WordPress. By August 2011, about 22% of new websites had adopted WordPress. WordPress is currently the most popular blog system on Internet. It was created in 2003 and has more than 20,000 plugins to customize its functions.

Preparation

Once you have the user rights and the required software, you can start installing wordpress!

The first step, download WordPress

We can download Wordpress directly from their website:

wget http://wordpress.org/latest.tar.gz

This command downloads the compressed wordpress package directly to the user's home directory. Next unzip it:

tar -xzvf latest.tar.gz 

The second step, create a WordPress database and users

After decompressing the wordpress file, we need to create a new MySQL database for wordpress.

Continue to log in to MySQL Shell:

mysql -u root -p

Log in with your MySQL root password, then we need to create a wordpress database and set a new password for a user in the database. Remember, all MySQL commands must end with a semicolon. First, let's create the database (for simplicity, I call it wordpress, you can give it any name you choose):

CREATE DATABASE wordpress;
Query OK,1 row affected(0.00 sec)

Next we need to create a new user. You can replace the database with your favorite name and password and content:

CREATE USER wordpressuser@localhost;
Query OK,0 rows affected(0.00 sec)

Set the password of the new user:

SET PASSWORD FOR wordpressuser@localhost=PASSWORD("password");
Query OK,0 rows affected(0.00 sec)

Next, grant all permissions to the new user to complete. Without this command, the wordpress installer will not start:

GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
Query OK,0 rows affected(0.00 sec)

Refresh MySQL:

FLUSH PRIVILEGES;
Query OK,0 rows affected(0.00 sec)

Exit the MySQL shell:

exit

The third step, configure WordPress

The first step is to copy the sample wordpress configuration file located in the wordpress directory to the new file we will edit to create a new available wordpress configuration:

cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php

Then open the wordpress configuration:

vi ~/wordpress/wp-config.php

Find the section that contains the following fields and replace your database, username and password with the correct name:

// ** MySQL settings - You can get this info from your web host ** ///** The name of the database for WordPress */define('DB_NAME','wordpress');
​
/** MySQL database username */define('DB_USER','wordpressuser');
​
/** MySQL database password */define('DB_PASSWORD','password');

Save and exit.

The fourth step, copy files

We have almost completed the steps of uploading Wordpress to the server. The last remaining step is to copy the unzipped WordPress file to the root directory of the website.

sudo cp -r ~/wordpress/* /var/www/html

From here, WordPress has its own online installation form.

However, wordpress needs to run a specific php module. If it is not installed on your server, please download php-gd:

sudo cp -r ~/wordpress/* /var/www/html

Finally restart Apache:

sudo service httpd restart

Step 5, visit WordPress installation

After completing all operations, you can use your server IP to open your wordpress installation page in your browser!

WordPress installation is very simple, you can use the free Tencent Cloud Developer Lab for practical operation, the tutorial is in: Build a WordPress personal blog based on CentOS


Reference: "How To Install Wordpress on Centos 6"

Recommended Posts

How to install Wordpress on Centos
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Memcached on CentOS 8
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8
How to install PHP on CentOS 8
How to install MongoDB on CentOS 8
How to install Apache Maven on CentOS 8
How to install Apache Kafka on CentOS 7
[Graphic] How to install tomcat on centos
How to install GCC compiler on CentOS 7
How to install offline JDK1.8 on centos7.0
How to install and configure Elasticsearch on CentOS 7
How to install and use Docker on CentOS 7
How to install RPM packages on CentOS Linux
How to install and configure VNC on CentOS 8
How to install and use Composer on CentOS 8
How to install and configure Redis on CentOS 8
How to install Node.js and npm on CentOS 8
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install and configure phpMyAdmin on CentOS 6
How to install and use Curl on CentOS 8
How to install and configure Owncloud on CentOS 8
How to install VirtualBox client extension on CentOS 8
How to install Docker CE on RHEL 8 / CentOS 8
How to install and uninstall tomcat on centos
How to install and configure Redmine on CentOS 8
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04