apt+get+php7+mysql,Ubuntu 16.04 安装Nginx+PHP7+mysql5.7

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值