ngnix的安装

 

1.安装make:
yum -y install gcc automake autoconf libtool make
2.安装g++:
yum install gcc gcc-c++
3.安装目录
cd /usr/local/src
4.安装PCRE库
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

安装zlib库
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

安装openssl
cd /usr/local/src
tar -zxvf openssl-1.0.1t.tar.gz
./config&&make&&makeinstall
5.查看pcre版本
pcre-config --version
6.安装nginx
cd /usr/local/src
wget http://nginx.org/download/nginx-1.6.2.tar.gz
tar -zxvf nginx-1.6.2.tar.gz
cd ./nginx-1.6.2

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.39
make 如果make执行出错就先执行 yum install pcre-devel zlib zlib-devel openssl openssl-devel 再执行上面一步再make

make install

7.进入目录
cd /usr/local/nginx/conf/
8.创建目录存放秘钥
mkdir cert
9.修改nginx.conf
server下面 listen 端口 和server_name ip

启动

sudo  /usr/local/nginx/sbin/nginx

重启nginx

service nginx restart

重载nginx

service nginx reload

posted on 2019-05-17 17:31  传奇星际  阅读(176)  评论(0编辑  收藏  举报

导航