Mysql
apt-get -y install mysql-server mysql-client
#中间需要设置下root密码
mysql_secure_installation
#移除root的远程访问
2.Nginx
apt-get -y install nginx
3.PHP7
apt-get -y install php7.0-fpm
apt-get -y install php7.0-xml
配置PHP
修改配置文件/etc/php/7.0/fpm/php.ini
cgi.fix_pathinfo=0
原因:PHP CGI 中 fix_pathinfo 会引起的安全隐患
#重载 php
service php7.0-fpm reload
5.配置Nginx
server
server_name lleg.gl6.cc;
}
server
{
listen 443 ssl;
ssl on;
#Nginx 所需要 ssl_certificate 文件
ssl_certificate /etc/letsencrypt/live/lleg.gl6.cc/fullchain.pem;
#安全证书 KEY 文件;
ssl_certificate_key /etc/letsencrypt/live/lleg.gl6.cc/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
server_name lleg.gl6.cc;
index index.html index.htm index.php default.html default.htm default.php;
root /var/www/html;
location ~\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~/\.ht {
deny all;
}
}
#重载nginx
nginx -t
nginx -s reload