nginx源码安装

sudo apt-get install zlib1g-dev

sudo apt-get install unzip

unzip nginx_install_file.zip 

tar -xzvf nginx-1.11.3.tar.gz 

tar -xzvf openssl-1.0.1.tar.gz 

 tar -xzvf pcre-8.41.tar.gz 

//cd nginx 目录

./configure  --prefix=/usr/local/nginx  --with-http_ssl_module  --with-http_flv_module  --with-http_stub_status_module  --with-http_gzip_static_module  --with-pcre=../pcre-8.41  --with-openssl=../openssl-1.0.1

make

sudo make install

sudo /etc/

启动
sudo /usr/local/nginx/sbin/nginx 
关闭
sudo /usr/local/nginx/sbin/nginx -s stop
重新加载配置
sudo /usr/local/nginx/sbin/nginx -s reload
指定配置文件
sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
查看80端口占用
netstat -ano | grep 90
关闭占用80端口的程序
sudo fuser -k 80/tcp

猜你喜欢

转载自blog.csdn.net/weixin_35993084/article/details/80667886