Centos7.6 lnmp1.5 添加域名、绑定域名 备忘录(教程)
TIME 2019-04-24 08:33
添加域名
lnmp vhost add
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-01.png)
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-01.png)
Please enter domain(example: www.lnmp.org):
请输入域名(例如:www.lnmp.org):
要说明一点的是,这里输入的域名就是创建域名根目录名
比如说你的域名是www.inthesun.cn
你这里输入的是www.inthesun.cn
那么域名根目录名就是www.inthesun.cn
如果你这里输入的是inthesun.cn
那么域名根目录名就是inthesun.cn
为了方便管理我这里就设置带www的域名了
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-02.png)
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-02.png)
然后要求你键入更多的域名,这里就设置不带www的域名
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-03.png)
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-03.png)
这里询问我们域名绑定的根目录是否设置为/home/wwwroot/www.inthesun.cn
回车确认是
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-04.png)
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-04.png)
Allow Rewrite rule? (y/n)
允许重写规则吗?(y / n)
回复n
这个是设置伪静态的配置文件,如果有需要就回复y,然后选择相应web程序
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-05.png)
PHP Pathinfo是个啥我都不知道
回复n
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-06.png)
问是否创建日志
回复y
不需要则回复n
接着让你输入日志名称,敲回车键默认即可
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-07.png)
如果需要就键入y然后回车
这里我不需要,因为我可以自己在PHPmyadmin里面自己创建
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-08.png)
这里我不需要,回复n
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-09.png)
回复y
然后你有两个选择
1: Use your own SSL Certificate and Key
2: Use Let’s Encrypt to create SSL Certificate and Key
这里因为我们没有自己的SSL安全证书
那我们就只能用Let’s Encrypt创建一个免费的安全证书
所以这里选择2
然后
Press any key to start create virtul host…
按任意键开始创建虚拟主机…
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-10.png)
则说明SSL安全证书已经创建完成
虚拟主机也创建完成
要说明一点的就是
在创建安全证书之前
域名必须先要解析到申请安全证书的服务器IP上
否者安装证书会失败
如果当你看到以下界面![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-11.png)
![](https://inthesun.cn/wp-content/uploads/2019/04/2019-04-24-C-11.png)
Sign failed, finalize code is not 200.
{
“type”: “urn:ietf:params:acme:error:rateLimited”,
“detail”: “Error finalizing order :: too many certificates already issued for exact set of domains: inthesun.cn,www.inthesun.cn: see https://letsencrypt.org/docs/rate-limits/”,
“status”: 429
}
Please check log file for more details: /usr/local/acme.sh/acme.sh.log
Let’s Encrypt SSL Certificate create failed!
就是说创建安全证书超限了
详情让你看 https://letsencrypt.org/docs/rate-limits
里面说
在一周内,同一IP地址,只能创建5份同一域名的安全证书
所以也就是说过一礼拜就可以再次申请创建
点击数:269