ITeye博客

Nginx安装

crane.ding · 2014-04-07 11:43 · Linux · nginx · 互联网 · nginx · Markdown

Nginx的了解和下载请看百度百科-Nginx和Nginx官网,这里主要是讲其安装的步骤。 Nginx基本会用到的模块有rewrite、gzip和ssl,这三个模块都是需要安装相关依赖的包,rewrite需要先安装pcre、gzip需要先安装zlib、ssl需要先安装openssl。这里就以pcre-8.34、zlib-1.2.8和openssl-1.0.0l、nginx-1.4.7版本为例子来讲解其安装步骤。

** 1. pcre的安装**


wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.34/pcre-8.34.tar.bz2
tar -xvf pcre-8.34.tar.bz2
cd pcre-8.34
./configure
make
make install 

** 2. pcre的安装**


wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8/
./configure
make
make install

** 3. openssl的安装**


wget http://www.openssl.org/source/openssl-1.0.0l.tar.gz
tar -zxvf openssl-1.0.0l.tar.gz
cd openssl-1.0.0l
./configure
make
make install

** 4. nginx的安装**


wget http://nginx.org/download/nginx-1.4.7.tar.gz
tar -zxvf nginx-1.4.7.tar.gz
cd nginx-1.4.7/
./configure --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/usr/src/openssl-1.0.0l
make
make install
# --with-openssl=/usr/src/openssl-1.0.0l 这里指的是openssl的源代码目录,即刚刚下载openssl的目录

** 5. nginx的启动**


cd /usr/local/nginx/sbin
./nginx
# Nginx默认的安装目录是/usr/local/nginx

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。