deepin安装nginx debian最好不要换源,我换了阿里源导致安装失败 (1)安装gcc g++的依赖库 sudo apt-get install build-essential && sudo apt-get install libtool (2)安装pcre依赖库 sudo apt-get install libpcre3 libpcre3-dev (3)安装zlib依赖库 sudo apt-get install zlib1g-dev (4)安装ssl依赖库 sudo apt-get install openssl libssl-dev (5)下载安装包 wget http://nginx.org/download/nginx-1.16.0.tar.gz (6)解压 tar zxvf nginx-1.16.0.tar.gz (7)进入解压目录 cd nginx-1.16.0/ (8)安装 ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
--prefix=/usr/local/nginx安装后的所有资源文件都会被放在/usr/local/nginx目录中
sudo make sudo make install (9)启动 /usr/local/nginx/sbin/nginx 配置环境变量 sudo vim /etc/profile
export NGINX_HOME=/usr/local/nginx PATH=$PATH:$NGINX_HOME/sbin export PATH 重启 source /etc/profile 查看是否安装成功 nginx -v