无坑nginx安装

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安装成功~~~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值