Nginx install

本人系统环境为 CentOS6.4

yum 安方步骤

1、考考框中代码格式,生成文件 /etc/yum.repos.d/nginx.repo    

格式示例:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1

重点解释:

baseurl=http://nginx.org/packages/mainline/OS/OSRELEASE/$basearch/

OS=你的系统

OSRELEASE = 系统版本号

x86_64  = 系统平台位数

baseurl=http://nginx.org/packages/mainline/centos/6/x86_64/

我的格式 /etc/yum.repos.d/nginx.repo    

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/6/x86_64/
gpgcheck=0
enabled=1

 

yum  install -y nginx        //安装即可,注意依赖关系包必须要安装这里就不做解释了

----------------------------------------------------

安装成功后

查看nginx具体配置   nginx -V

configure arguments:
 --prefix=/etc/nginx
 --sbin-path=/usr/sbin/nginx 
--modules-path=/usr/lib64/nginx/modules 
--conf-path=/etc/nginx/nginx.conf 
--error-log-path=/var/log/nginx/error.log 
--http-log-path=/var/log/nginx/access.log 
--pid-path=/var/run/nginx.pid 
--lock-path=/var/run/nginx.lock 
--http-client-body-temp-path=/var/cache/nginx/client_temp 
--http-proxy-temp-path=/var/cache/nginx/proxy_temp 
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp 
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp 
--http-scgi-temp-path=/var/cache/nginx/scgi_temp 
--user=nginx 
--group=nginx 
--with-compat 
--with-file-aio 
--with-threads 
--with-http_addition_module 
--with-http_auth_request_module 
--with-http_dav_module 
--with-http_flv_module 
--with-http_gunzip_module 
--with-http_gzip_static_module 
--with-http_mp4_module 
--with-http_random_index_module 
--with-http_realip_module
--with-http_secure_link_module 
--with-http_slice_module 
--with-http_ssl_module 
--with-http_stub_status_module 
--with-http_sub_module 
--with-http_v2_module 
--with-mail 
--with-mail_ssl_module 
--with-stream 
--with-stream_realip_module 
--with-stream_ssl_module 
--with-stream_ssl_preread_module 
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

 

 

 

 

PHP7:  php-fpm 和 nginx 合体配置

打开nginx配置文件

vim /etc/nginx/conf.d/default.conf

1、

//root : 表示你的http服务的主目录是哪,可以自定义

//添加 index.php

101741_V5cn_2346720.png

 

2、  $document_root$fastcgi_script_name;

101948_0U2E_2346720.png

 

/etc/init.d/nginx start   启动就能解析php文件了

转载于:https://my.oschina.net/ssvnet/blog/1529562

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值