=============================================================================================================
安装环境
- CentOS 6.4
- openssl:
- prce: ()
- zlib:
- nginx:
安装过程
1)编译安装openssl, pcre已经zlib这三个的安装类似,这里取openssl为例,其他类似
# tar -zxvf openssl-1.0.2e.tar.gz # cd openssl-1.0.2e # ./config --prefix=/usr/local/openssl_1_0_2e # make # make install |
2) 编译安装nginx
# tar -zxvf nginx-1.8.0.tar.gz # cd nginx-1.8.0 # ./configure --prefix=/usr/local/nginx_1_8_0 --with-http_ssl_module --with-pcre=../pcre-8.37 --with-zlib=../zlib-1.2.8 --with-openssl=../openssl-1.0.2e --with-http_stub_status_module # make # make install |
在nginx的configure过程中指定了一些选项:
--with-http_ssl_module
|
#启用支持https模块
|
--with-pcre=../pcre-8.37 |
#指向解压的源码目录
|
--with-zlib=../zlib-1.2.8 |
#指向解压的源码目录
|
--with-openssl=../openssl-1.0.2e |
#指向解压的源码目录
|
--with-http_stub_status_module
|
#启用 nginx 的 NginxStatus 功能,用来监控 Nginx 的当前状态
|
如若安装了相应库,可不指定库路径的选项。若安装时找不到上述依赖模块,就请使用--with-openssl=
=============================================================================================================
启动运行
在本文中,nginx将会安装到/usr/local/nginx_1_8_0下:
# cd /usr/local/nginx_1_8_0/sbin/ # ./nginx #运行nginx # netstat -tlnp|grep 80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 15966/nginx |
此时nginx服务已经启动,打开你的浏览器,输入http://[IP]/ 就可以看到: