linux下nginx的安装
http://nginx.org/en/download.html
nginx官网下载
进入服务器下载
[[email protected] src]# cd /usr/local/src/
[[email protected] src]# wget http://nginx.org/download/nginx-1.14.0.tar.gz
[[email protected] src]# tar xf nginx-1.14.0.tar.gz
[[email protected] src]# cd nginx-1.14.0
然后安装依赖
[[email protected] 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
然后编译安装
[[email protected] nginx-1.14.0]# ./configure --prefix=/usr/local/nginx
[[email protected] nginx-1.14.0]# make
[[email protected] nginx-1.14.0]# make install
[[email protected] nginx-1.14.0]# cd /usr/local/nginx/
[[email protected] sbin]# ./nginx
[[email protected] sbin]# cp nginx /usr/bin/nginx
[[email protected] 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
[[email protected] sbin]# killall nginx
[[email protected] sbin]# ps -ef | grep nginx
root 6439 2475 0 20:39 pts/0 00:00:00 grep --color=auto nginx
启动
[[email protected] sbin]# nginx
[[email protected] sbin]# ps -ef | grep nginx