ubuntu 源码安装 nginx

本文介绍如何从源码编译安装 Nginx 1.8.0 版本,并详细列出所需的依赖库及模块配置。涵盖了安装依赖库、下载源码、编译配置等步骤。

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

1.安装所需库

sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev 

2.下载源码并解压缩
http://nginx.org/download/
3.编译安装

./configure --prefix=/usr/local/nginx-1.8.0 \
--with-http_ssl_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-ipv6 \
--with-http_spdy_module \
--with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' \
--with-debug

编译结果..设定的目录为:

  nginx path prefix: "/usr/local/nginx-1.8.0"
  nginx binary file: "/usr/local/nginx-1.8.0/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx-1.8.0/conf"
  nginx configuration file: "/usr/local/nginx-1.8.0/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx-1.8.0/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx-1.8.0/logs/error.log"
  nginx http access log file: "/usr/local/nginx-1.8.0/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

sudo make && sudo make install
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值