Nginx安装-Linux
操作系统:CentOS7
下载安装Nginx的方式
- rpm包安装
- yum自动化工具安装
- 获取源代码,手动编译安装nginx(指定安装路径,额外的开启nginx的第三方功能。)
# 以下为源代码安装
1.安装依赖环境(使用yum之前需要提前配置好yum源)
yum -y install gcc gcc-c++ autoconf automake make pcre openssl openssl-devel
2.下载nginx包
wget https://nginx.org/download/nginx-1.22.0.tar.gz
3.解压
tar -zxvf nginx-1.22.0.tar.gz
4.编译
cd nginx-1.22.0
./configure
make
make install
5.查看默认安装位置
whereis nginx
6.启动nginx
cd /usr/local/nginx/sbin
./nginx
7.查看nginx进程
ps -ef | grep ginx
浙公网安备 33010602011771号