centos安装nginx

mkdir /usr/local/nginx
cd /usr/local/nginx/
yum install wget
wget http://nginx.org/download/nginx-1.5.9.tar.gz
tar -zxvf nginx-1.5.9.tar.gz
cd nginx-1.5.9/
#安装make编译环境 yum
-y install gcc gcc-c++ autoconf automake make yum install -y zlib-devel ./configure --prefix=/usr/local/nginx
make
#编译安装
make install
#启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
#关闭防火墙
systemctl stop firewalld.service    
curl http://localhost

 参考 https://www.cnblogs.com/zzjdbk/p/13281907.html

posted @ 2021-06-18 10:37  雨V幕  阅读(40)  评论(0编辑  收藏  举报