linux(centos7)下安装nginx步骤

1、进入:/usr/java/nginx位置
下载nginx: wget http://nginx.org/download/nginx-1.8.0.tar.gz
下载openssl : wget http://www.openssl.org/source/openssl-fips-2.0.9.tar.gz
下载zlib : wget http://zlib.net/zlib-1.2.11.tar.gz
下载pcre : wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
如果没有安装c++编译环境,还得安装,通过yum install gcc-c++完成安装
2、下一步,编译安装
安装openssl :
[root@localhost] tar zxvf openssl-fips-2.0.9.tar.gz
[root@localhost] cd openssl-fips-2.0.9
[root@localhost] ./config && make && make install

安装pcre:
[root@localhost] tar zxvf pcre-8.38.tar.gz
[root@localhost] cd pcre-8.38
[root@localhost] ./configure && make && make install
安装zlib:
[root@localhost]tar zxvf zlib-1.2.11.tar.gz
[root@localhost] cd zlib-1.2.11
[root@localhost] ./configure && make && make install
最后安装nginx:
[root@localhost]tar zxvf nginx-1.8.0.tar.gz
[root@localhost] cd nginx-1.8.0
[root@localhost] ./configure && make && make install
3、启动nginx:
[root@localhost]cd /usr/local/nginx/sbin
[root@localhost]./nginx
[root@localhost]./nginx
[root@localhost]# ps -ef | grep nginx
root 11393 1 0 18:20 ? 00:00:00 nginx: master process ./nginx
nobody 11394 11393 0 18:20 ? 00:00:00 nginx: worker process
root 11405 989 0 18:21 pts/0 00:00:00 grep --color=auto nginx
4、浏览器输入IP地址,可以进入nginx欢迎页面,至此nginx安装成功;


10173291-8385f85f3d0e1a80.png
image.png

转载于:https://www.jianshu.com/p/77ddc2bbb1e0

猜你喜欢

转载自blog.csdn.net/weixin_34293902/article/details/91273573