X
    Categories: service

NGINX 安装

##wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz
wget https://o3cex9zsl.qnssl.com/libs/nginx/pcre-8.36.tar.gz
tar -zxvf pcre-8.36.tar.gz
cd pcre-8.36/
./configure
make
make installwget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0/
./configure --prefix=/usr/local/nginx --with-http_ssl_module
    #追加尾巴 --with-http_addition_module --with-http_sub_module
 
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_addition_module --with-http_sub_module

make
make install
##################################################################
【nginx: [emerg] unknown directive “ssl”】

首先确保机器上安装了openssl和openssl-devel

#yum install openssl
#yum install openssl-devel

然后就是自己颁发证书给自己

#cd /usr/local/nginx/conf
#openssl genrsa -des3 -out server.key 1024
#openssl req -new -key server.key -out server.csr
#openssl rsa -in server.key -out server_nopwd.key
#openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt

###################################################################

【启动】
 
/usr/local/nginx/sbin/nginx
 
/usr/local/nginx/sbin/nginx -s reload

 

打赏
微信扫一扫,打赏作者吧~
admin :