目录
1.下载nginx
2.将下载的tar.gz文件上传到服务器
我的存放位置为 /usr/local/
3.安装gcc环境(已安装的跳过)
yum install openssl-devel pcre-devel gcc -y
yum install -y openssl*
yum -y install ncurses-devel
4.解压tar.gz文件
tar -zxvf nginx-1.22.1.tar.gz
修改文件名,美观易记
mv nginx-1.22.1 nginx
5.创建logs文件
mkdir -p /usr/local/nginx/logs
6.编译nginx
在 /usr/local/nginx 目录执行下列命令
./configure
需要配置https的执行以下命令
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
再执行:
make
7.运行nginx
cd /usr/local/nginx/sbin
./nginx
通过 ip 访问,出现此页面代表成功
over!