TODO List
Main reference: Build website using WordPress
- Buy VPS
- Register a domain (recommend: .com)
- Set up LNMP in VPS
- Build your website
1. Buy Hostwinds VPS
Don’t know how to choose Virtual Hosting (Shared Hosting) or Virtual Private Server? Please check the reference blog.
Here I choose Hostwinds VPS because I have multiple uses.
The detailed guide of buying steps and problems you may have are here
Problems:
- Can’t finish payment via Alipay.
Solution:
Use Credit Card. - IP is blocked.
Solution:- Make sure account region is set as China. (Only China can change IP for free.)
- VPS CMS -> Manage IP’s -> Fix ISP Block –>> Confirm
2. Buy & Register Domain in Namesilo
When waiting installation: Set up your domain name
2.1 Buy
- Sign Up (Make sure activate account via email)
- Choose a Domain
- Finish payment (Pay attention to Renew Privacy)
2.2 Register
- Enter Domain Manager tag
- Remove the existing record
- Create two new A record
Done! Just need to wait for update.
3.Connect VPS via SSH & Download FileZilla
Mac OS is very simple:$ ssh root@vpsip
Security Settings
- For security reason, change SSH port: 22 -> 3752
After modification, connect command is:$ ssh -p portnum root@ip
- Remove those two lines to enable longer login duration.
$ vi /etc/ssh/sshd_config
$ service sshd restart (Redirect to)
$ systemctl restart sshd.service
- Update system
Make sure all software/kernel are updated.$ yum -y update
Connect VPS via FileZilla
In order to transfer files between local computer and cloud server.
4.Install LNMP on VPS
Install LNMP in one step. Detailed steps can be found here.
In this tutorial, install lnmp1.6 version.
1. Download Installation Package
Use the following command to install.
$ wget http://soft.vpser.net/lnmp/lnmp1.6.tar.gz -cO lnmp1.6.tar.gz && tar zxf lnmp1.6.tar.gz && cd lnmp1.6 && ./install.sh lnmp
2. Install Procedures
MySQL 5.5.60 (Default)
- MySQL 5.6,5.7 and MariaDB 10 require > 1G RAM. Input your version number and press enter.
- Enter your database password.
- Enable InnoDB.
PHP 7.2.18 (Default is PHP 5.6.40)
- Recommend PHP 7 version. (Will end support PHP 5. More info here ).
Press any key to continue… Enter and wait.
Problems:
- Nginx and MySQL are stopped. Can’t restart.
Solution:
- Check error log first.
- Edit the
/etc/my.cnf
file. - Then restart service to see if successes.
Here is the related problem.
$ vi /etc/my.cnf
// modify dist of socket
socket = /var/lib/mysql/mysql.sock
Done! LNMP installed successfully!
5.Install WordPress
Prerequisite
Install eAccelerator and memcached to improve PHP speed.
Here we install OPcache and Memcached.
$cd /root/lnmp1.6
$./addons.sh install opcache
// select 2: php-memcached
$./addons.sh install memcached
5.1 Add virtual host
lnmp add
has many functions, likeadd/edit/del
.
$ lnmp vhost add
5.2 Add SSL/HTTPS
Oops! Haven’t finished yet. Will update soon or later.
Problems:
- can’t start MySQL
Solution - can’t start LNMP & open www.miawy.com
When successfully start LNMP: - Sth wrong when connecting database:
Failed to create database. - PHP error
// error.log is in php-fpm.log
/usr/local/php/var/log/php-fpm.log
// error.log setting is in php-fpm.conf
/usr/local/php/etc/php-fpm.conf
Remember to clear logs regularly!
6.Move HTTP to HTTPS
This is the Tutorial.
Can’t connect MySQL because the connect
command!! Higher than PHP7.0 should use mysqli
command!
Hello, yes this piece of writing is truly nice and I have learned
lot of things from it regarding blogging. thanks.
Hello! I just wanted to ask if you ever have any issues with hackers?
My last blog (wordpress) was hacked and I ended up losing a
few months of hard work due to no back up. Do you have any solutions to stop hackers?
Hi! Yes, I also have been having this issue from about few months ago but I couldn’t find any solutions.
I was thinking about searching some wordpress anti-hackers plugins maybe?
My friend recommended me Akismet and Wordfence these two plugins. Maybe you can download and have a try.
Hope this will help!
Howdy! This post couldn’t be written much better!
Reading through this post reminds me of my previous roommate!
He always kept preaching about this. I most certainly will forward this post to him.
Pretty sure he’ll have a good read. Thank you for
sharing!
Thank you and glad to help! I’ve been busy these days and I will try to update more in the near future.
Thank you again! That encourges me a lot!