作者:聂勇 欢迎转载,请保留作者信息并说明文章来源!
- 一、预备 | Prerequisites
- 二、配置依赖组件 | Setup Dependents
- 三、安装Nginx | Install Nginx
- 四、Nginx启动和停止 | How to start and stop nginx
- 五、参考资料 | References
一、预备 | Prerequisites
- CentOS5 / RedHat5 /CentOS6 / RedHat6
- GCC-4.1.2
- Nginx-1.9.2
- pcre-8.21
- zlib-1.2.5
- openssl-1.0.2c
二、配置依赖组件 | Setup Dependents
|
|
三、安装Nginx | Install Nginx
1、下载Nginx源码并解压。
2、编译三步曲。
1)编译配置。
配置成功,系统输出类似如下信息:
Configuration summary + using PCRE library: /home/sdkserver/build/pcre-8.21 + using OpenSSL library: /home/sdkserver/build/openssl-1.0.2c + md5: using OpenSSL library + sha1: using OpenSSL library + using zlib library: /home/sdkserver/build/zlib-1.2.5 nginx path prefix: "/home/sdkserver/local/nginx-1.9.2" nginx binary file: "/home/sdkserver/local/nginx-1.9.2/sbin/nginx" nginx configuration prefix: "/home/sdkserver/local/nginx-1.9.2/conf" nginx configuration file: "/home/sdkserver/local/nginx-1.9.2/conf/nginx.conf" nginx pid file: "/home/sdkserver/local/nginx-1.9.2/logs/nginx.pid" nginx error log file: "/home/sdkserver/local/nginx-1.9.2/logs/error.log" nginx http access log file: "/home/sdkserver/local/nginx-1.9.2/logs/access.log" nginx http client request body temporary files: "/home/sdkserver/local/nginx-1.9.2/temp/body" nginx http proxy temporary files: "/home/sdkserver/local/nginx-1.9.2/temp/proxy" nginx http fastcgi temporary files: "/home/sdkserver/local/nginx-1.9.2/temp/fastcgi" nginx http uwsgi temporary files: "/home/sdkserver/local/nginx-1.9.2/temp/uwsgi" nginx http scgi temporary files: "/home/sdkserver/local/nginx-1.9.2/temp/scgi"
2)编译安装。
四、Nginx启动和停止 | How to start and stop nginx
1、启动Nginx。
2、停止Nginx。
1)安全停止。
或
2)快速停止。
或
或
3、重启Nginx。
或
4、检查配置文件的语法是否正确。