Linux上快捷安装nginx整流程

1.确认gcc g++开发类库是否安装,默认已经安装

apt-get update
apt-get install build-essential
apt-get install libtool

2.安装PRCR库

cd /usr/local
apt-get install wget
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
tar -zxvf pcre-8.39.tar.gz
cd pcre-8.39
./configure
make
make install

3.安装zlib库

cd /usr/local
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
make install

4.安装openssl

cd /usr/local
wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
tar -zxvf openssl-1.0.1t.tar.gz

5.安装nginx

cd /usr/local
wget http://nginx.org/download/nginx-1.1.10.tar.gz
tar -zxvf nginx-1.1.10.tar.gz
cd nginx-1.1.10
./configure
make
make install

#### 如果出现报错
apt-get install openssl
apt-get install libssl-dev

6.nginx重启、关闭、启动

#启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

# 关闭
ps -ef|grep nginx
kill -f xxxxx

# 重启
/usr/local/nginx/sbin/nginx -s reload

# 检测配置是否正确
/usr/local/nginx/sbin/nginx -t

文章来源:www.rakbuluo.com/p77

原文链接:,转发请注明来源!

回复 匿名 点击这里取消回复。

要发表评论,您必须先登录