LibreSpeed install on centos

LibreSpeed install on centos

项目地址:https://github.com/librespeed/speedtest

 

# 安装nginx和php
sudo yum install nginx sudo yum install php php-devel php-fpm sudo yum install php-mbstring php-dom php-pdo php-mysql

 

# 克隆测速网站源码
cd /opt/
git clone https://gitee.com/lsgx/speedtest
chown -R nginx:nginx speedtest

 

编辑 /etc/nginx/nginx.conf 配置文件

复制代码
    server {
        listen       8080;
        listen       [::]:8080;
        server_name  _;
        root         /opt/speedtest;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
                index   index.html index.htm;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }

        error_page 404 /404.html;
        location = /404.html {
        }

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
        }
    }

复制代码

编辑 /etc/php-fpm.d/www.conf  配置文件

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx

编辑 /etc/php.ini 配置文件

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A setting
; of zero causes PHP to behave as before.  Default is 1.  You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://php.net/cgi.fix-pathinfo
cgi.fix_pathinfo=0

防火墙放行指定端口

firewall-cmd --permanent --add-port=8080/tcp
firewall-cmd --reload
firewall-cmd --list-all
firewall-cmd --list-all-zones

启动服务并设置随系统启动

systemctl restart php-fpm
systemctl restart nginx
systemctl enable php-fpm
systemctl enable nginx

 

=========== End

 

posted @   lsgxeva  阅读(1011)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
历史上的今天:
2018-12-03 RSA modulus too small: 512 < minimum 768 bits
2018-12-03 VMXNET3 vs E1000E and E1000
2017-12-03 深入理解Delete(JavaScript)
2017-12-03 JavaScript方法call,apply,caller,callee,bind的使用详解及区别
2017-12-03 javascript标准对象与包装对象
2017-12-03 javascript中var let const三种变量声明方式
2017-12-03 Javascript 中 == 和 === 区别是什么?
点击右上角即可分享
微信分享提示