- Only tested Alibaba Cloud Tencent Cloud Centos7 student machine
- The system is very clean, preferably just reinstalled
- Use root privileges
## A key installation
Boring to write a one-click build script, use the following commands to run (see [github][2] for details)
````
$ wget https://yimian-setup.obs.myhwclouds.com/sh/auto.sh && sh auto.sh
````
If nothing happens, the installation will proceed automatically. At the end of the installation, you need to manually enter the following database configuration instructions.
````
use mysql
UPDATE user SET Password ='Your password' WHERE User ='root';
create database typecho;
quit
````
## Easy start
After the installation is complete, use your browser to visit the following link
````
http://your server ip
````
Install typecho according to the page prompt
Leave most of the content as default, just fill in:
- Database password (the one you just set)
- Administrator username
- Administrator login password
- Administrator email address
## Custom domain configuration
First, resolve your domain name A to your server ip at your domain name service provider (Tencent Cloud, Alibaba Cloud)
**Open the nginx configuration file on the server**
````
$ vi /etc/nginx/nginx.conf
````
Just replace your_domain on lines 42, 47, and 48 in the file with your own domain name.
**Restart nginx service**
````
$ systemctl nginx -t # nginx.conf syntax check
$ systemctl restart nginx # restart nginx
````
Then after about 10 minutes, you can access typecho via `https://your domain name`
## https configuration
If you are still unable to access and are directed to a filing page, then you may need to use https
### Method One
For configuring automatic renewal of ssl certificate, please refer to my other article ([Nginx under Centos7 configure ssl certificate automatic renewal][3])
### Method two
- Apply for and download a certificate from Tencent Cloud, etc., and then upload the two certificates in the nginx folder to the server
- Remove the comments on lines 39, 47-54 in nginx.conf mentioned earlier
- Replace the second half of lines 47 and 48 with the addresses of your own .crt and .key certificate files respectively
-`systemctl restart nginx` restart nginx
- Use a browser to visit `https://your domain name`