Debian8开启锐速/升级到nginx官网新版1.14/php7.2
黑五剁了台新机器,终于换了个高配置的,做下迁移。
首先为了开锐速,要求的内核版本都很低,没有办法我选择了Debian 8,使用了这个博客的脚本全新安装了一下Debian 8 64位:
https://moeclub.org/2018/04/03/603/?v=390
锐速:https://www.91yun.co/archives/683
可以看到Debian 8要求内核是Debian/8/3.16.0-4-amd64,而新装完是3.16.0-6,所以先
$ apt install linux-image-3.16.0-4-amd64
进后台VNC看着它重启手动进旧版内核,再去把较新的卸载了
$ apt purge linux-image-3.16.0-6-amd64 linux-image-amd64
这样锐速就可以用上面网址的脚本搞定了
nginx安装很简单,在这里
http://nginx.org/en/linux_packages.html#stable
debian8官方源里是经典的php5.6,第三方php源有两个选择,dotdeb和sury,前者对于debian8只有php7.0。后者就比较全了,我直接选择换上7.2。
sury用法在这里:https://deb.sury.org/
由于nginx原版和debian的配置文件组织方式不同,记录一下
php当然还是装fpm版,在/etc/nginx/conf.d中以default.conf举例,留意注释掉的部分:
server {
listen 80;
server_name test.domain.com;
charset utf-8;
#access_log /var/log/nginx/host.access.log main;
location / {
root /srv/test;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /srv/test;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
发表于 2018-11-27 15:57:00 并被添加「」标签,阅读量: 907 。
此处评论已关闭