Linux重装(准备端口80、3306、443等;准备域名并申请ssl)
--------------------------------------------------------------------
vim .vimrc
输入:set nu
set tabstop=4
--------------------------------------------------------------------
yum -y install screen
--------------------------------------------------------------------
screen -S lnmp
mkdir lnmp
---------------------------------------------------------------------
wget -c http://soft.vpser.net/lnmp/lnmp1.5-full.tar.gz
tar -zxvf lnmp1.5-full.tar.gz
---------------------------------------------------------------------
cd lnmp1.5-full
./install.sh lnmp
---------------------------------------------------------------------
(1)选择安装mysql版本,注意:mysql5.6以上需要服务器内存2G
2
(2)设置数据库root管理员密码
root
(3)安装mysql的InnerDB引擎
y
(4)选择安装的php版本
8
(5)选择安装软件优化内存
3
(6)键入任意键安装,安装时间 40分钟左右。
---------------------------------------------------------------------
Ctrl+A+D (把安装窗口隐藏到后台运行)
---------------------------------------------------------------------
lnmp vhost add
---------------------------------------------------------------------
在/usr/local/nginx/conf/中fastcgi.conf 最下面一行加#
---------------------------------------------------------------------
在/usr/local/nginx/conf/vhost中XXX.XXX.com.conf 加/public
---------------------------------------------------------------------
本机连navica
mysql -u root -p
(输入密码)
mysql>grant all privileges on *.* to 'root'@'%' identified by 'youpassword' with grant option;
mysql>flush privileges;
---------------------------------------------------------------------
开启防火墙
rpm -qa |grep iptables
netstat -ntpl
iptables -vnL
iptables -F
---------------------------------------------------------------------
把项目拉进home/wwwroot下建立的文件夹中
chmod -R 777 runtime
修改application/database.php
---------------------------------------------------------------------
lnmp restart
(这步做好了就可以用域名登陆了)
---------------------------------------------------------------------
添加ssl
(选择nginx证书下载。然后在nginx目录下创建文件夹,比如我创建了cert然后把证书上传到此文件夹内)
/usr/local/nginx/中建立cert文件夹,把证书放进去
---------------------------------------------------------------------
cd /usr/local/nginx/conf/vhost/中.conf文件加
listen 443 ssl;
ssl off;
ssl_certificate /你上传的证书目录和证书名称.crt;
ssl_certificate_key /你上传的证书目录和证书名称.key;
if ($scheme = http ) {return 301 https://$host$request_uri;}
---------------------------------------------------------------------
lnmp restart