linux系统中单网卡添加多个ip
2011-11-22 15:58
337 查看
安装php5-fpm
# apt-get install php5-fpm
安装完成以后修改/etc/php5/fpm/conf.d/www.conf:
;listen = /var/run/php5-fpm.sock
listen = 127.0.0.1:9000
重载php5-fpm配置
# /etc/init.d/php5-fpm reload
检查一下是否监听了9000端口:
# netstat -tln
如果出现了9000端口,说明php5-fpm正常启动。
安装nginx(参考Ubuntu 14.04安装Nginx1.60)
安装完成之后配置/etc/nginx/conf.d/default.conf:
要执行php关键要修改如下部分:
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
# }
去掉前面的#号,修改root为你自己目录,修改/scripts$fastcgi_script_name为$document_root$fastcgi_script_name。修改之后如下:
location ~ \.php$ {
root /var/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
注意:
root如果不指定会出现找不到文件的错误。
/scripts如果不修改会出现如下错误
[error] 5152#0: *7 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
也可以不指定root直接把$document_root写成真实地址。
如果不修改/etc/php5/fpm/conf.d/www.conf的话,也可以设置fastcgi_pass 后的127.0.0.1:9000;为unix:/var/run/php5-fpm.sock;
然后重载nginx配置:
# /etc/init.d/nginx reload
在/var/www目录中新建一个index.php文件,在浏览器地址栏输入localhost,回车!
本文出自 “贝壳” 博客,请务必保留此出处http://shellofyou.blog.51cto.com/4292127/1418037
# apt-get install php5-fpm
安装完成以后修改/etc/php5/fpm/conf.d/www.conf:
;listen = /var/run/php5-fpm.sock
listen = 127.0.0.1:9000
重载php5-fpm配置
# /etc/init.d/php5-fpm reload
检查一下是否监听了9000端口:
# netstat -tln
如果出现了9000端口,说明php5-fpm正常启动。
安装nginx(参考Ubuntu 14.04安装Nginx1.60)
安装完成之后配置/etc/nginx/conf.d/default.conf:
要执行php关键要修改如下部分:
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
# }
去掉前面的#号,修改root为你自己目录,修改/scripts$fastcgi_script_name为$document_root$fastcgi_script_name。修改之后如下:
location ~ \.php$ {
root /var/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
注意:
root如果不指定会出现找不到文件的错误。
/scripts如果不修改会出现如下错误
[error] 5152#0: *7 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
也可以不指定root直接把$document_root写成真实地址。
如果不修改/etc/php5/fpm/conf.d/www.conf的话,也可以设置fastcgi_pass 后的127.0.0.1:9000;为unix:/var/run/php5-fpm.sock;
然后重载nginx配置:
# /etc/init.d/nginx reload
在/var/www目录中新建一个index.php文件,在浏览器地址栏输入localhost,回车!
本文出自 “贝壳” 博客,请务必保留此出处http://shellofyou.blog.51cto.com/4292127/1418037
相关文章推荐
- 在linux系统下单网卡的双静态IP配置
- linux系统添加和删除IP,批量添加IP
- linux 为网卡添加多个IP
- LINUX系统一个网卡绑定多个IP的方法
- python linux系统中获取网卡IP
- 在Linux系统下一个网卡设置多个IP的方法
- linux 系统中安装网卡驱动及配置IP
- 如何在linux网卡上添加多个IP
- linux系统批量添加IP的shell脚本
- Linux 装完系统后,后添加网卡
- 在基于ZedBoard的Linux系统下添加自定义硬件IP(4) ——驱动程序和应用程序编写
- 在linux系统添加ip别名 .
- Linux系统安装完成后启动网卡会自动获取一个ip
- 在基于ZedBoard的Linux系统下添加自定义硬件IP(1)——启动Linux系统
- linux系统单网卡绑定双IP的方法
- Centos系统下 批量添加IP到网卡上
- Linux系统下用单网卡设置双IP的方法
- linux系统单网卡绑定双IP的方法
- LINUX系统一个网卡绑定多个IP的方法