Linux环境下安装nginx

1.进入local目录下安装nginx

cd /usr/local/ 

2.安装wget

yum -y install wget

3.下载nginx

wget -c https://nginx.org/download/nginx-1.18.0.tar.gz

4.解压nginx

tar -zxvf nginx-1.8.0.tar.gz 

5.编译

图片.png
./configure

6.初始化

 make && make install

7.启动或关闭nginx

 /usr/local/nginx/sbin/nginx 
 /usr/local/nginx/sbin/nginx -s stop

8.查看是否启动成功

curl http://127.0.0.1
显示此信息启动nginx成功.png

你可能感兴趣的:(Linux环境下安装nginx)