nginx应用编译安装

nginx应用编译安装:

  • 安装编译所需依赖包:
# apt-get install make gcc g++ libcurl3-openssl-dev libfreetype6-dev libmcrypt-dev
# apt-get install libpcre3 libpcre3-dev zlib1g-dev libssl-dev build-essential
# apt-get install openssl libssl-dev
  • 编译nginx:(无用户)
# cd /usr/local/src
# wget http://nginx.org/download/nginx-1.8.0.tar.gz
# tar -zxvf nginx-1.8.0.tar.gz
# cd nginx-1.8.0/
# ./configure --prefix=/Sioeye/SioApps/Environment/nginx --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre
# make && make install
# ln -sv /Sioeye/SioApps/Environment/nginx/sbin/nginx /etc/init.d/nginx
# mv /home/pengchuan/nginx /etc/init.d/ ### /home/pengchuan/nginx为上传的nginx启动文件
# chmod a+x /etc/init.d/nginx
# update-rc.d nginx defaults
# vim /etc/rc.local
/etc/init.d/nginx
exit 0
# chmod a+x /etc/rc.local
  • 编译nginx:(有用户)
# useradd -s /usr/sbin/nologin -r nginx
# cd /usr/local/src
# wget http://nginx.org/download/nginx-1.8.0.tar.gz
# tar -zxvf nginx-1.8.0.tar.gz
# cd nginx-1.8.0/
# ./configure --prefix=/Sioeye/SioApps/Environment/nginx --with-http_ssl_module --user=nginx --group=nginx --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre
# make && make install
# ln -sv /Sioeye/SioApps/Environment/nginx/sbin/nginx /etc/init.d/nginx
# update-rc.d nginx defaults 99
  • 修改配置文件
# vi nginx.conf
上一篇:Nginx服务编译安装、日志功能、状态模块及访问认证模式实操


下一篇:【nginx运维基础(1)】Nginx的编译安装与使用