您的位置:首页 > 运维架构 > Linux

阿里云 Centos 7安装PHP7 配置LNMP

2016-06-03 17:58 441 查看
1、安装教程:

http://www.thinkcmf.com/topic/topic/index/id/351.html

2、增加文件解析

修改文件:/etc/nginx/conf.d/default.conf;

index index.php index.html index.htm;

3、测试网页性能工具:

https://developers.google.com/speed/pagespeed/insights/

经测试,需要开启 gzip、启用浏览器缓存

开启gzip,修改 /etc/nginx/nginx.conf 添加:

gzip  on;
gzip_comp_level  2;    # 压缩比例,比例越大,压缩时间越长。默认是1
gzip_types    text/xml text/plain text/css application/javascript application/x-javascript application/rss+xml;     # 哪些文件可以被压缩
gzip_disable  "MSIE [1-6]\.";     # IE6无效


4、开启静态文件浏览器缓存:

修改文件:/etc/nginx/conf.d/default.conf;

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$
{
expires      30d;
}

location ~ .*\.(js|css)?$
{
expires      7d;
}


5、开启 opCache(重要!性能增加 70%)

http://www.tuicool.com/articles/NjmQNj6
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: