Use VPS to install Nginx, PHP, Mysql, and create a WordPress blog

Use VPS to install Nginx, PHP, Mysql, and create a WordPress blog

For those who have purchased a VPS, creating a web environment and installing WordPress is not an easy task. Here is a detailed tutorial.
Prerequisite: Centos/debian system, SSH (root user) Operation here, OneinStack is recommended: lnmp, lamp, lnmpa one-click installation package, install Nginx, PHP 7.0, Mysql 5.6 below

1. Install lnmp (using OneinStack)
1. Download OneinStack and install it

 yum -y install wget screen wget http://mirrors.linuxeye.com/lnmp-full.tar.gz tar xzf lnmp-full.tar.gz cd lnmp screen -S lnmp ./install.sh

2. Port, it is recommended to default and press Enter

3. Enable the firewall

4. Install the web environment

5. Install Nginx

6. Do not install Apache (either Apache or Nginx)

7. Install MySQL 5.6 and set a password

8. Select the default option for database installation

9. Install PHP 7.0

10. Install Zend OPcache

11. ionCube, ImageMagick or GraphicsMagick, Pure-FTPd, you can install them or not, as you wish.
phpMyAdmin is recommended to be installed.
redis, memcached, HHVM, not installed.

Wait patiently for the installation to complete.

12. Restart

13. Install Let's Encrypt client to enable SSL support on the website
Reconnect SSH and install Let's Encrypt client

2. Install WordPress
The premise is that the IP has been bound to the domain name. Assume that the domain name to be built is wptest.zhujiwiki.com

1. Build a site
Under SSH, or in the lnmp directory

 ./vhost.sh

Install as shown below

This way the website is built.
Your website directory is under /data/wwwroot/, and the domain name is used as the directory.

2. Create a database
a. Browser accesses your host IP, and the following will appear:

This file is under /data/wwwroot/default and can be changed at will.

b. Visit http://your host IP/phpMyAdmin/, log in, username root, password is the password created in the first part

c. Click New in the upper left corner to create a database

Enter a database name, any name that is easy to remember

3. Set up WordPress
a. Enter the directory where you want to build WordPress, such as /data/wwwroot/wptest.zhujiwiki.com

 cd /data/wwwroot/wptest.zhujiwiki.com

b. Download WordPress 4.8.1 Chinese version

 wget https://cn.wordpress.org/wordpress-4.8.1-zh_CN.zip

Unzip

 unzip wordpress-4.8.1-zh_CN.zip

Move all files to the website root directory

 mv wordpress/* /data/wwwroot/wptest.zhujiwiki.com

c. Set the database to rename the configuration file name

 mv wp-config-sample.php wp-config.php

Edit the configuration file wp-config.php

 vi wp-config.php

Press i to edit, use the arrow keys to move the cursor, and edit the name, username, and password of the WordPress database.

Then press Esc to exit editing, press Shift + z (2 times) to save.

d. In the browser, enter the domain name, such as wptest.zhujiwiki.com, and fill it out according to your needs.

In this way, a WordPress site is built. Similarly, you can build a typecho or PHP site.

<<:  SSDHero: $72/year/2GB memory/40GB SSD space/10TB traffic/KVM/Lithuania

>>:  deinserverhost 1GB RAM German KVM VPS Review

Recommend

MS-Cloud: €24/year/1GB memory/40GB space/1TB traffic/KVM/Austria

MS-Cloud, an Austrian merchant, was established i...

LightCloud: 25% off on all items, top up 3000 and get 1000 for free

LightCloud is a Chinese IDC that was established ...

ZomboHost: $9.95/year/10GB space/100GB traffic/unlimited domain names

ZomboHost, a foreign hosting provider, was founde...

Gestion DBI: $2.54/month/512MB memory/20GB space/500GB/KVM/Los Angeles

Gestion DBI, stable merchant, and excellent servi...

Chicago VPS: $5/month/5GB RAM/100GB storage/2TB bandwidth/OpenVZ/Los Angeles

ChicagoVPS, there are 2 special prices now, which...

D9 Hosting OpenVZ VPS 12% off lifetime discount

I bought it from http://www.whcoupon.com/54.html....

TACVPS Acquired by Hostress

We just acquired GreenValueHost, and now we have ...

Yungao 2GB RAM 125Mbps Unlimited Data Taiwan KVM VPS Review

Details: Yungao: $19.5/month/2GB RAM/24GB SSD spa...