1、更新系统
yum update -y
2、重启
reboot
3、安装LNMP执行
可以访问http://soft.vpser.net/lnmp查看最新版本,这里是nmp1.6-full.tar.gz
wget -c http://soft.vpser.net/lnmp/lnmp1.6-full.tar.gz && tar zxf lnmp1.6-full.tar.gz && cd lnmp1.6-full && ./install.sh lnmp && cd /root/ && rm -rf lnmp1.6-full.tar.gz && rm -rf lnmp1.6-full && rm -rf lnmp-install.log
上传你的网站到/home/wwwroot/default目录下
如果出现500错误,修改php.ini配置(/usr/local/php/etc)
display_errors = On #显示错误
short_open_tag = Off #关闭短标签
重启服务
lnmp restart
4、安装certbot
yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
yum install certbot python2-certbot-nginx -y
certbot --nginx --nginx-server-root=/usr/local/nginx/conf
5、配置计划任务
crontab -e
添加以下内容后保存并退出
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew