Steps of setting up my WordPress blog on VPS

WordPress Theme

Here are the full steps I took to install and configure the WordPress blog on my VPS.

WordPress

The blog system I used before are Typecho and Emlog. In fact, I really like this kind of lightweight blog. The cost of code change is cheap, but the development community is too small. I could not really find some plugins at all. Even if I want to write a plugin, I can’t find any developer documentation. So, back to WordPress.

Vultr VPS

The VPS I used today is from Vultr. This platform was recommended to me by Jim last year (poke him: http://jimschenchen.com, or this: http://www.probejfury.com/).

Download the installation package

Download the latest WordPress zip file from https://wordpress.org/download/, upload the zip file directly to the server directory.

If you try to unzip the file and then upload it, it takes forever.

Upload and unzip

Use server client software, such as PUTTY, to connect to the server with username and password. Change the current directory to the directory where you just uploaded the zip file, and this directory will also be the directory where WordPress is going to be installed. In my case, my directory is a vhost directory called “www.cloudyyoung.com”.

cd /home/wwwroot/www.cloudyyoung.com

Then, unzip the zip file just uploaded.

unzip wordpress-5.2.1.zip

Move files to the root directory

Now, WordPress has unzipped into the directory, but it is actually located in a secondary directory called “wordpress”. I want to move all the files in the “wordpress” directory to the root directory “www.cloudyyoung.com”.

Change the current directory to “wordpress” and move all files to the root directory.

cd wordpress/
mv * ../

After moving all the files, the “wordpress” folder should be empty and I can just delete it.

Install WordPress

Open browser and visit site http://www.cloudyyoung.com to run the installer.

Provide the database, username, password, and data table prefix, then click “Install”.

After successfully installing WordPress, visit http://www.cloudyyoung.com/wp-admin, provide account and password which was set by the installer, and then you can log in to the WordPress backend.

Modify directory permissions

At this point, if you try to install a theme or plugin in WordPress, you might be prompted not to install it automatically and you will need to manually provide an account and password to access FTP, and this happens every time. The reason is because WordPress does not have sufficient permissions to modify the contents of the plugin and theme directory, so this problem can only be prevented by modifying the permissions.

There are many people on the Internet trying to change the permissions of the file directory to 777. Although this can organize the problem right away, also means that all the files in the directory can be read by anyone, so it is a very unsecure way to solve.

The following is the solution I have taken:

sudo chown -R www:www /home/wwwroot/www.cloudyyoung.com

Executing the above code will replace the owner “root” with “www” of all files and folders under the WordPress directory, and WordPress will execute normally.

Customize blog

There are some custom steps that need to be completed before people visit my site.

Theme

By May 2019, my current theme is called “Simplent”. Search in the theme center, install and then activate. I have tried a lot of seemingly good-looking themes before, the solution given in the screenshot is very good, but after installation and use, I feel very general, repeated so that I am tired. Simplent is relatively simple. Since I can’t find something very beautiful, use something straightforward and simple.

Plugin

So far, there are two plugins I really need:

WPGlobus

This is a more flexible multi-language plugin. I only use English and Simplified Chinese. All articles can be written in both two languages ​​and the display changes depending on the browser’s browser language settings.

Aliyun OSS

This plugin allows WordPress to upload all the images and files to the Alibaba Cloud OSS bucket instead of directly to the server. The reason for using this is to prevent server movement from causing image breaks, and OSS access is faster than direct access to server images.

After there may be plugins to add.