Nginx 是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器。
特点:占有内存少,并发能力强
linux无坑安装nginx
1、安装编译工具以及库文件:
yum -y install make gcc-c++ libtool
2、下载&安装perl安装包
$ wget http://www.cpan.org/src/5.0/perl-5.16.1.tar.gz
$ tar -xzf perl-5.16.1.tar.gz
$ cd perl-5.16.1
$ ./Configure -des -Dusethreads -Dprefix=/usr/local/perl
$ make
$ make test
$ make install
3、下载&安装pcre安装包
$ wget http://downloads.sourceforge.net/project/pcre/pcre/8.41/pcre-8.41.tar.gz
$ tar -zxvf pcre-8.41.tat.gz
$ cd pcre-8.41
$ ./configure --prefix=/usr/local/pcre/
$ make && make install
4、下载&安装openssl安装包
$ wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz
$ tar -zxvf openssl-1.1.0g.tar.gz
$ cd openssl-1.1.0g
$ ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl/conf
$ make && make install
5、下载&安装zlib安装包
$ wget https://sourceforge.net/projects/libpng/files/zlib/1.2.11/zlib-1.2.11.tar.gz --no-check-certificate
$ tar -zxvf zlib-1.2.11.tar.gz
$ cd zlib-1.2.11
$ ./configure --prefix=/usr/local/zlib
$ make && make install
6、Nginx安装:
$ wget https://nginx.org/download/nginx-1.18.0.tar.gz
$ tar -zxvf nginx-1.18.0.tar.gz
$ cd nginx-1.18.0
$ ./configure --prefix=/usr/local/nginx --with-openssl=/usr/local/src/openssl-1.1.0g --with-pcre=/usr/local/src/pcre-8.41 --with-zlib=/usr/local/src/zlib-1.2.11 --with-cc-opt=-Wno-error --with-http_ssl_module --with-debug --with-http_realip_module --with-http_stub_status_module --without-http_userid_module --with-ipv6 --with-stream
$ make && make install
安装nginx之后,所有的配置都在/usr/local/nginx目录下。
7、启动nginx
$ cd /usr/local/nginx
$ sbin/nginx
8、测试nginx是否启动成功
$ sbin/nginx
页面访问:http://xxx.xxx.xx.xx:80
9、nginx安装成功~~~