centos7系统nginx服务器下phalcon环境搭建方法详解
发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,本文实例讲述了centos7系统nginx服务器下phalcon环境搭建方法。分享给大家供大家参考,具体如下:之前我们采用的是Apache服务器,可是每秒响应只能达到2000,听说nginx可以轻易破
千家信息网最后更新 2024年09月22日centos7系统nginx服务器下phalcon环境搭建方法详解
本文实例讲述了centos7系统nginx服务器下phalcon环境搭建方法。分享给大家供大家参考,具体如下:
之前我们采用的是Apache服务器,可是每秒响应只能达到2000,听说nginx可以轻易破万,
于是换成nginx试试。
phalcon的官网有nginx重写规则的示例,可是却与apache的不一致,被坑了好久。
1、添加nginx源
vi /etc/yum.repos.d/nginx.repo
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
2、修改nginx的配置
vi /etc/nginx/conf.d/default.conf
server { listen 80; server_name localhost.dev; index index.php index.html index.htm; root /var/www/html; location / { root /var/www/html; #phalcon官网上是public目录,如果用这个目录就和apache的配置不一样了 index index.php index.html index.htm; # 如果文件存在就直接返回这个文件 if (-f $request_filename) { break; } # 如果不存在就重定向到public/index.php if (!-e $request_filename) { rewrite ^(.+)$ /public/index.php?_url=$1 last; break; } } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { root /var/www/html/public; } location ~ /\.ht { deny all; }}
3、php-fpm的配置
vi /etc/php-fpm.d/www.conf
修改为用户和用户组
; RPM: apache Choosed to be able to access some dir as httpduser = nginx; RPM: Keep a group allowed to write in log dir.group = nginx
4、用户组修改
chown -R nginx:nginx /var/lib/php/session/chown -R nginx:nginx /var/www/html/
重启nginx、php-fpm,
systemctl restart nginxsystemctl restart php-fpm
进一步的优化且待之后的情况
希望本文所述对大家centos服务器操作有所帮助。
服务器
服务
用户
配置
文件
用户组
目录
方法
环境
系统
一致
实例
情况
示例
规则
进一
参考
帮助
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
软件开发技术员提成
郑州市伊璞网络技术有限公司
什么是服务器管理口
归去来兮翻译软件开发
蓝牙连接别人的网络安全吗
深圳嵌入式软件开发价钱是多少
太仓口碑好的网络技术
北京大学计算机网络安全专业
长沙app软件开发有哪些
宁夏软件开发公司工资待遇
怎么改服务器主机名
服务器建设
巨野网络安全大队
国资网络安全公司
计算机网络技术ppp协议
linux 数据库表类型是
达梦数据库连接系统错误
服务器做代理服务器
虹口区专业性软件开发价格查询
网络安全所涉及到的主要技术
违反网络安全法的重大案例
赛迪研究院网络安全所位置
hp服务器 串口
恐惧与饥饿选哪个服务器
软件开发优秀员工获奖发言
服务器有关代码
上海悠越互联网科技
plsql配置数据库表结构
惠普服务器发展
樟树市政协关注网络安全治理