nginx安装(正式)
生活随笔
收集整理的这篇文章主要介绍了
nginx安装(正式)
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
一、安装说明
系统环境:CentOS Linux release 7.2.1511 (Core)系统内核:3.10.0-327.el7.x86_64
软件:nginx-1.10.1.tar.gz
其他所需软件:pcre-devel 、openssl-devel 、GeoIP-devel 、zlib-devel
安装方式:源码编译安装
安装位置:/usr/local/nginx
二、安装前提
安装nginx之前,确保系统安装了g++、gcc1.安装pcre-devel
rewrite模块需要 pcre 库$ sudo yum install pcre-devel -y
2.安装openssl-devel
ssl 功能需要openssl库
3.安装zlib-devel
gzip模块需要 zlib 库
4.安装GeoIP-devel
$ sudo yum install GeoIP-devel -y 三、安装nginx
1.创建用户
# useradd -M -s /sbin/nologin www2.解压
# tar zxf nginx-1.10.1.tar.gz -C /usr/local/3.进入源码包目录
# cd /usr/local/nginx-1.10.1/4.配置
./configure \ --user=www \ --group=www \ --prefix=/usr/local/nginx \ --sbin-path=/usr/sbin/nginx \ --http-log-path=/var/log/nginx/access.log \ --error-log-path=/var/log/nginx/error.log \ --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 \ --lock-path=/var/lock/nginx.lock \ --pid-path=/var/run/nginx.pid \ --with-debug \ --with-threads \ --with-http_ssl_module \ --with-http_geoip_module \ --with-http_gzip_static_module \ --with-http_gunzip_module \ --with-http_realip_module \ --with-http_secure_link_module \ --with-http_sub_module \ --with-http_stub_status_module \ --with-ipv65.编译安装
# make && make install6.创建目录
# mkdir -pv /var/cache/nginx/client_temp7.验证
# nginx -V8.启动、重载
启动
重载
9.停止
查询nginx主进程号
停止进程
快速停止
# kill -TERM 主进程号强制停止
10.测试
测试端口
四、配置说明
1.安装位置
/usr/local/nginx2.配置文件位置
/usr/local/nginx/conf3.二进制执行文件
/usr/sbin/nginxconfigure执行结果
Configuration summary+ using threads+ using system PCRE library+ using system OpenSSL library+ md5: using OpenSSL library+ sha1: using OpenSSL library+ using system zlib librarynginx path prefix: "/usr/local/nginx"nginx binary file: "/usr/sbin/nginx"nginx modules path: "/usr/local/nginx/modules"nginx configuration prefix: "/usr/local/nginx/conf"nginx configuration file: "/usr/local/nginx/conf/nginx.conf"nginx pid file: "/var/run/nginx.pid"nginx error log file: "/var/log/nginx/error.log"nginx http access log file: "/var/log/nginx/access.log"nginx http client request body temporary files: "/var/cache/nginx/client_temp"nginx http proxy temporary files: "/var/cache/nginx/proxy_temp"nginx http fastcgi temporary files: "/var/cache/nginx/fastcgi_temp"nginx http uwsgi temporary files: "/var/cache/nginx/uwsgi_temp"nginx http scgi temporary files: "/var/cache/nginx/scgi_temp"
来自为知笔记(Wiz)
转载于:https://www.cnblogs.com/pangguoping/p/5729173.html
总结
以上是生活随笔为你收集整理的nginx安装(正式)的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: Erdaicms旅游网站系统微信和手机端
- 下一篇: jQuery Mobile Slider