环境安装备忘录 Nginx

1.1. 配置Nginx

  1. 建立nginx安装目录

mkdir /usr/local/nginx

 

  1. 将目录访问权限更改至tomcat用户

chown -R -v tomcat /usr/local/nginx

 

  1. 解压缩redis源代码包

tar -xvf nginx-1.9.0.tar.gz

 

  1. 编译nginx

编译准备

yum -y install gcc gcc-c++ autoconf automake make

yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel 

 

编译nginx

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module 

make && make install

 

  1. Nginx环境配置

 

 

  1. Nginx SSL

非生产环境

 

安装openssl

#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

 

Nginx.conf配置

 

 

 

 

 

 

  1. Nginx伪静态缓存

 

 

  1. Nginx启动与停止

进入/usr/local/nginx/sbin目录

启动 :./nginx

停止 :./ nginx -s stop

posted @ 2015-12-23 14:00  kaye0110  阅读(154)  评论(0编辑  收藏  举报