您的位置:首页 > 运维架构 > Nginx

centos7 nginx安装 yum

2018-08-09 20:48 525 查看
1.到/etc/yum.repos.d下新建nginx的yum源文件nginx.repo (touch nginx.repo),内容为:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

2.查看nginx版本 yum list | grep nginx
安装 yum install nginx

3.nginx -v 查看nginx版本

4:nginx -V 查看nginx的编译参数 :
--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 执行对应模块时,nginx所保留的临时性文件
--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 设定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

设置额外的参数将被添加到CFLAGS变量
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC'

设置附加的参数,链接系统库
--with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Nginx FastCGI CentOS uWSGI SCGi