Ubuntu 安装ngixn

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

wget http://nginx.org/download/nginx-1.13.6.tar.gz
tar -zxvf nginx-1.13.6.tar.gz
cd nginx-1.13.6
./configure --prefix=/usr/local/nginx 
make
sudo make install
sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
#注意:-c 指定配置文件的路径,不加的话,nginx会自动加载默认路径的配置文件,可以通过-h查看帮助命令。

sudo ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
#配置软链接

nginx -s reload

你可能感兴趣的:(Ubuntu 安装ngixn)