一、下载Nginx的
可以到Nginx官网下载Nginx官网
[或者]
[root
@localhost home]
二、安装gcc和Nginx的依赖包
[root
@localhost home]
[root
@localhost home]
[root
@localhost home]
[root
@localhost home]
三、安装Nginx
[root@localhost src]# tar -zxvf nginx-
1.13.2.tar.gz
[root@localhost src]# cd nginx-
1.13.2
[root@localhost nginx-
1.13.2]# ./configure
Configuration summary
+ using system PCRE
library
+ OpenSSL
library is not used
+ using system zlib
library
nginx path prefix:
"/usr/local/mysoftware/nginx"
nginx binary
file:
"/usr/local/mysoftware/nginx/sbin/nginx"
nginx modules path:
"/usr/local/mysoftware/nginx/modules"
nginx
configuration prefix:
"/usr/local/mysoftware/nginx/conf"
nginx
configuration file:
"/usr/local/mysoftware/nginx/conf/nginx.conf"
nginx pid
file:
"/usr/local/mysoftware/nginx/logs/nginx.pid"
nginx error log
file:
"/usr/local/mysoftware/nginx/logs/error.log"
nginx http
access log
file:
"/usr/local/mysoftware/nginx/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"
[root@localhost nginx-
1.13.2]# make && make install
四、操作Nginx
[root
@localhost ~]
[root
@localhost ~]
[root
@localhost ~]
[root
@localhost ~]
[root
@localhost ~]
[root
@www sbin]
root
4659 0.
0 0.
0 20480 608 ? Ss
23:
43 0:
00 nginx: master process ./nginx
nobody
4660 0.
0 0.
1 20924 1588 ? S
23:
43 0:
00 nginx: worker process
root
4731 0.
0 0.
0 112660 976 pts/
0 R+
23:
51 0:
00 grep --color=auto nginx
设置开机自启
[root
@localhost ~]
/usr/bin/nginx
[root
@localhost ~]
chmod +
x /etc/rc.d/rc.
local