简单源码安装nginx

1,安装所需依赖

[root@localhost ~] yum -y install gcc pcre-devel zlib-devel

2,解压nginx源码包,检测 编译 安装

[root@localhost ~] tar -zxf nginx-1.12.2.tar.gz #解压
[root@localhost ~] cd nginx-1.12.2
[root@localhost nginx-1.12.2] ./configure #环境检测,默认按照到/usr/local/下
[root@localhost nginx-1.12.2] make && make install #编译 和 安装

3,启动nginx

[root@localhost nginx-1.12.2] /usr/local/nginx/sbin/nginx 

4,关闭防火墙和selinux

[root@localhost ~] systemctl stop firewalld
[root@localhost ~] setenforce 0

5,浏览器测试
在这里插入图片描述
简单实用!!!

发布了56 篇原创文章 · 获赞 65 · 访问量 2007

猜你喜欢

转载自blog.csdn.net/xiaohuai0444167/article/details/105350244