我的博客已迁移到xdoujiang.com请去那边和我交流
一、基础环境
1、cat /etc/debian_version
7.82、uname -r
3.2.0-4-amd643、ip(eth0)
10.0.0.1094、nginx版本
1.4.7二、安装nginx
1、安装所需要的基础包
apt-get -y install libpcre3-dev libpcre3 libssl-dev zlib1g-dev make2、建立nginx用户
1)groupadd nginx
2)useradd nginx -g nginx -s /bin/false3、下载nginx
axel -n 10 http://nginx.org/download/nginx-1.4.7.tar.gz4、解压
tar zxvf nginx-1.4.7.tar.gz && cd nginx-1.4.75、编译三部曲
1)./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-http_ssl_module
2)make && make install6、参数说明
--prefix=/opt/nginx    将安装路径指定在/opt/nginx
http_ssl_module         https协议模块
http_gzip_module        压缩的HTTP服务器的响应模块
http_rewrite_module     重写模块
--user=nginx            nginx用户
--group=nginx           nginx组7、为了方便 弄个软链接
ln -s /opt/nginx/sbin/nginx /usr/local/sbin/nginx8、修改nginx配置文件以支持php-fpm
1)先备份下
cp /opt/nginx/conf/nginx.conf /opt/nginx/conf/nginx.conf.bak
2)修改以下内容
2c2
< user nginx;
---
> #user  nobody;
36,39c36,38
<         listen       10.0.0.109:80;
<         server_name  10.0.0.109;
<         access_log /opt/nginx/logs/10.0.0.109.access.log;
<         error_log /opt/nginx/logs/10.0.0.109.error.log;
---
>         listen       80;
>         server_name  localhost;
>
66,72c65,71
<         location ~ \.php$ {
<             root           html;
<             fastcgi_pass   unix:/run/shm/php5-fpm.sock;
<             fastcgi_index  index.php;
<             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
<             include        fastcgi_params;
<         }
---
>         #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;
>         #}9、启动nginx服务
nginx10、查看端口和进程
1)netstat -tupnl|grep nginx
tcp        0      0 10.0.0.109:80           0.0.0.0:*               LISTEN      13852/nginx: master
2)ps -ef |grep nginx
root     13852     1  0 22:51 ?        00:00:00 nginx: master process nginx
nginx    13853 13852  0 22:51 ?        00:00:00 nginx: worker process
nginx    13907 13906  0 22:52 ?        00:00:00 php-fpm: pool www
nginx    13908 13906  0 22:52 ?        00:00:00 php-fpm: pool www  PS:
1、停止nginx服务
nginx -s quit
2、重新加载配置
nginx -s reload三、安装php5-fpm
1、安装php5-fpm及php
apt-get -y install php5-cli
apt-get -y install php5-fpm2、修改php-fpm配置文件
1)先备份下
cp /etc/php5/fpm/pool.d/www.conf /etc/php5/fpm/pool.d/www.conf.bak
2)修改以下内容
diff /etc/php5/fpm/pool.d/www.conf /etc/php5/fpm/pool.d/www.conf.bak
22,23c22,23
< user = nginx
< group = nginx
---
> user = www-data
> group = www-data
33c33
< listen = /run/shm/php5-fpm.sock
---
> listen = /var/run/php5-fpm.sock
44,46c44,46
< listen.owner = nginx
< listen.group = nginx
< listen.mode = 0660
---
> listen.owner = www-data
> listen.group = www-data
> ;listen.mode = 06603、重启php-fpm服务
/etc/init.d/php5-fpm restart4、查看进程
ps -ef |grep php
root     13906     1  0 22:52 ?        00:00:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
nginx    13907 13906  0 22:52 ?        00:00:00 php-fpm: pool www
nginx    13908 13906  0 22:52 ?        00:00:00 php-fpm: pool www   四、写个php文件测试
cat /opt/nginx/html/info.php
<?php
phpinfo();
?>;五、nginx相关模块及参考文章
1、nginx相关模块
ngx_http_core_module
ngx_http_access_module
ngx_http_addition_module
ngx_http_auth_basic_module
ngx_http_auth_request_module
ngx_http_autoindex_module
ngx_http_browser_module
ngx_http_charset_module
ngx_http_dav_module
ngx_http_empty_gif_module
ngx_http_f4f_module
ngx_http_fastcgi_module
ngx_http_flv_module
ngx_http_geo_module
ngx_http_geoip_module
ngx_http_gunzip_module
ngx_http_gzip_module
ngx_http_gzip_static_module
ngx_http_headers_module
ngx_http_hls_module
ngx_http_p_w_picpath_filter_module
ngx_http_index_module
ngx_http_limit_conn_module
ngx_http_limit_req_module
ngx_http_log_module
ngx_http_map_module
ngx_http_memcached_module
ngx_http_mp4_module
ngx_http_perl_module
ngx_http_proxy_module
ngx_http_random_index_module
ngx_http_realip_module
ngx_http_referer_module
ngx_http_rewrite_module
ngx_http_scgi_module
ngx_http_secure_link_module
ngx_http_session_log_module
ngx_http_spdy_module
ngx_http_split_clients_module
ngx_http_ssi_module
ngx_http_ssl_module
ngx_http_status_module
ngx_http_stub_status_module
ngx_http_sub_module
ngx_http_upstream_module
ngx_http_upstream_conf_module
ngx_http_userid_module
ngx_http_uwsgi_module
ngx_http_xslt_modulengx_mail_core_module
ngx_mail_auth_http_module
ngx_mail_proxy_module
ngx_mail_ssl_module
ngx_mail_imap_module
ngx_mail_pop3_module
ngx_mail_smtp_modulengx_stream_core_module
ngx_stream_access_module
ngx_stream_limit_conn_module
ngx_stream_proxy_module
ngx_stream_ssl_module
ngx_stream_upstream_module2、参考文章
http://nginx.org/en/docs
http://tengine.taobao.org/nginx_docs/cn/docs/http/ngx_http_core_module.html六、效果

转载于:https://blog.51cto.com/7938217/1675483

nginx+php5-fpm安装相关推荐

  1. cygwin nginx php mysql_Windows 下 Nginx + PHP5 的安装与配置

    Nginx 是一个轻量级的高性能 Http WebServer,以事件驱动方式编写,因此相比 Apache 而言,Nginx 更加稳定.性能更好,而且配置简单,资源占用较低.以下是我在 Windows ...

  2. Windows 下 Nginx + PHP5 的安装与配置

    本文转载至:www.phpvim.net/web/php/installing-nginx-with-php5-on-windows.html Nginx 是一个轻量级的高性能 Http WebSer ...

  3. ubuntu nginx php-fpm mysql_Ubuntu下安装Nginx,PHP5(及PHP-FPM),MySQL

    环境:Ubuntu 12.0.4 LTS nginx(发音"engine x")是一个自由,开放源码,高性能的HTTP server.Nginx以稳定性,丰富的功能集,简单的配置, ...

  4. Ubuntu下安装Nginx,PHP5(及PHP-FPM),MySQL

     Ubuntu下安装Nginx,PHP5(及PHP-FPM),MySQL 2012-09-15 11:12:31 标签:php mysql ubuntu nginx php-fpm 原创作品,允许转载 ...

  5. php fpm安装curl后,nginx出现connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied)的错误...

    这里选择直接apt-get安装,因为比起自己编译简单多了,不需要自己配置什么 #sudo apt-get install curl libcurl3 libcurl3-dev php5-curl 安装 ...

  6. Ubuntu16.04用源安装Nginx+PHP5.6+MySQL5.6

    安装Nginx 1.首先添加nginx_signing.key(必须,否则出错) $ wget http://nginx.org/keys/nginx_signing.key$ sudo apt-ke ...

  7. php5.3+for+linux,Centos 安装 nginx + php5.3

    Centos 安装 nginx + php5.3,点开查看详情. #查看系统版本信息cat /etc/issue uname -a#设置时区 rm -rf /etc/localtime ln -s / ...

  8. lnmp php 5.4,linux下搭建LNMP(linux+nginx+mysql+php)环境之php5.4安装

    安装准备:依赖包下载wget http://ah1.down.chinaz.com/201303/PHP-v5.4.13.tar.gz wget http://soft.7dot.com/soft/l ...

  9. ubuntu下nginx+php5的部署

    ubuntu下nginx+php5环境的部署和centos系统下的部署稍有不同,废话不多说,以下为操作记录: 1)nginx安装 root@ubuntutest01-KVM:~# sudo apt-g ...

  10. ubuntu nginx php5fpm,Ubuntu安装nginx + php5-fpm

    1.安装$apt-get install mysql-server $apt-get install nginx $apt-get install php5-fpm $apt-get install ...

最新文章

  1. java enumerable_java - Java相当于C#的'Enumerable.Any' - 堆栈内存溢出
  2. vue常见知识点整理
  3. kettle在linux定时任务_在Linux下设置Kettle的定时任务
  4. leetcode--872. 叶子相似的树
  5. Oracle 中 decode 函数用法
  6. 再见了,余!额!宝!!!
  7. 宁德时代:拟70亿投建储能电池项目
  8. linux方面的杂谈
  9. 校招真题练习009 配比(京东)
  10. oracle 快照过旧怎么回退_我的世界20w45a:1.17首个快照!加入水晶、蜡烛、口袋、铜锭……...
  11. 3ds max制作宋惠乔的教程----作者: 火星时代 来源: 火星时代
  12. 删除控制面板java无效图标_win7系统删除控制面板中无效的图标的操作方法
  13. masm32快速编辑器菜单翻译整理
  14. R如何查看缺失值和处理缺失值
  15. 游戏介绍——《逆转裁判》
  16. 网站服务器到期后 内容释放,服务器到期后多久释放
  17. 球体动画Android,使用CSS创建一个炫酷的球体动画效果
  18. html内嵌式的语言,为何说PHP是一种HTML内嵌式的语言
  19. VSFTPD配置方法手册
  20. Java-Eclipse折叠代码插件 code folding 使用方法

热门文章

  1. 一个老测试给想入行测试行业新人的二十条建议
  2. 关于“稳定”的相爱相杀:负载测试和压力测试
  3. python制作的游戏如何转化为swf_PYTHON实现swf提取
  4. 《我的第一本算法书》读书笔记
  5. python数据库模式_python – 如何测试django数据库模式?
  6. python动态运行py代码_Python 动态执行
  7. 游戏与计算机系统不兼容,电脑安装游戏时提示此文件版本与正在运行Windows不兼容的解决方法...
  8. VS2017更改设置目录一劳永逸的方法
  9. java实现EXcel的RC地址变成常规地址
  10. c语言实现通讯录_C语言实现双人猜数字游戏