文章目录
- 一、软件下载和安装Nginx相关依赖
- 1. 安装Nginx相关依赖
- 2. 下载Nginx
- 二、源码安装Nginx
- 2.1. 解压
- 2.2. nginx默认配置
- 2.3. 编译安装
- 2.3. 查找安装路径
- 2.4.启动nginx
- 2.5. 查看是否启动成功
一、软件下载和安装Nginx相关依赖
1. 安装Nginx相关依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2. 下载Nginx
官网:https://nginx.org/download/
wget https://nginx.org/download/nginx-1.9.9.tar.gz
二、源码安装Nginx
2.1. 解压
tar -zxvf nginx-1.9.9.tar.gz
2.2. nginx默认配置
cd nginx-1.9.9/
./configure
2.3. 编译安装
make
make install
2.3. 查找安装路径
whereis nginx
[root@bogon nginx-1.9.9]# whereis nginx
nginx: /usr/local/nginx
2.4.启动nginx
cd /usr/local/nginx/sbin
./nginx
2.5. 查看是否启动成功
ps -ef | grep nginx
然后在网页上访问自己的IP就可以了默认端口为80(出现如下欢迎界面就成功了!)
遇到make[1]: *** [objs/Makefile:445: objs/src/core/ngx_murmurhash.o] Error 1
https://blog.csdn.net/weixin_40816738/article/details/11997892