Ubantu18.04 nginx 安装启动

安装

sudo apt update
sudo apt install build-essential
sudo apt install libtool
sudo apt install libpcre3 libpcre3-dev
sudo apt install zlib1g zlib1g-dev
sudo apt install openssl libssl-dev

sudo wget http://nginx.org/download/nginx-1.17.10.tar.gz -P /usr/src
cd /usr/src
sudo tar xf nginx-1.17.10.tar.gz
cd nginx-1.17.10/
sudo ./configure --prefix=/usr/local/nginx
sudo make
sudo make install

检查端口占用情况

sudo netstat -nptl

启动

sudo /usr/local/nginx/sbin/nginx

验证是否安装成功

sudo apt install elinks
elinks http://127.0.0.1 --dump

你可能感兴趣的:(Ubantu18.04 nginx 安装启动)