Centos 下安装nginx

本文详细介绍了在CentOS环境中安装Nginx并解决配置编译时遇到的问题,包括安装依赖库、配置参数设置及安装流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

刚安装完Centos并下载好nginx,在使用configure编译时提示缺少相关组件,以下为安装步骤:

1.安装依赖库


yum install gcc openssl-devel pcre-devel zlib-devel

2.运行configure


  ./configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/run/nginx/client/ \
--http-proxy-temp-path=/var/run/nginx/proxy/ \
--http-fastcgi-temp-path=/var/run/nginx/fcgi/ \
--http-uwsgi-temp-path=/var/run/nginx/uwsgi/ \
--http-scgi-temp-path=/var/run/nginx/scgi/



3.安装


make && make install
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值