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.
Once you have the user rights and the required software, you can start installing 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
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 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.
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
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