http://nginx.org/en/download.html
nginx官网下载
进入服务器下载
[root@jiaxin-ceshi src]# cd /usr/local/src/
[root@jiaxin-ceshi src]# wget http://nginx.org/download/nginx-1.14.0.tar.gz
[root@jiaxin-ceshi src]# tar xf nginx-1.14.0.tar.gz
[root@jiaxin-ceshi src]# cd nginx-1.14.0
然后安装依赖
[root@jiaxin-ceshi nginx-1.14.0yum -y install gcc* autoconf libjpeg* libpng* freetype* libxml2* zlib* glibc* glib2* bzip2* ncurses* curl* e2fsprogs* krb5* libidn-devel openssl* openldap* nss_ldap
然后编译安装
[root@jiaxin-ceshi nginx-1.14.0]# ./configure --prefix=/usr/local/nginx
[root@jiaxin-ceshi nginx-1.14.0]# make
[root@jiaxin-ceshi nginx-1.14.0]# make install
[root@jiaxin-ceshi nginx-1.14.0]# cd /usr/local/nginx/
[root@jiaxin-ceshi sbin]# ./nginx
[root@jiaxin-ceshi sbin]# cp nginx /usr/bin/nginx
[root@jiaxin-ceshi sbin]# ps -ef | grep nginx
root 6425 1 0 20:37 ? 00:00:00 nginx: master process ./nginx
nobody 6426 6425 0 20:37 ? 00:00:00 nginx: worker process
root 6436 2475 0 20:39 pts/0 00:00:00 grep --color=auto nginx
[root@jiaxin-ceshi sbin]# killall nginx
[root@jiaxin-ceshi sbin]# ps -ef | grep nginx
root 6439 2475 0 20:39 pts/0 00:00:00 grep --color=auto nginx
启动
[root@jiaxin-ceshi sbin]# nginx
[root@jiaxin-ceshi sbin]# ps -ef | grep nginx