ubuntu server 10.04 下nginx的安装

为了确保能在 Nginx 中使用正则表达式进行更灵活的配置,安装之前需要确定系统是否安装有 PCRE(Perl Compatible Regular Expressions)包。您可以到 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ 下载最新的 PCRE 源码包,使用下面命令下载编译和安装 PCRE 包:

# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.01.tar.gz 

# tar zxvf pcre-8.01.tar.gz 

# cd pcre-8.01 

# ./configure 

# make 

# sudo make install

 

 

 

下面开始nginx的安装:

# tar zxvf nginx-0.8.48.tar.gz

# cd nginx-0.8.48

# ./configure

# make

# sudo make install

 

 

如果你在make 的时候出现 make: *** 没有规则可以创建“default”需要的目标“build”。 停止。那么说明你跟我犯了同一个错误,你一定没有注意configure时的错误提示:

./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library.  You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl= options.

看清楚否?没有opensll library!怎么办?装呗!

# sudo apt-get install openssl

# sudo apt-get install libssl-dev

安装成功后 /usr/local/nginx 目录下有四个子目录分别是:conf、html、logs、sbin 。其中 Nginx 
的配置文件存放于 conf/nginx.conf,Nginx 只有一个程序文件位于 sbin 目录下的 nginx 文件。确保系统的 80 
端口没被其他程序占用,运行 sbin/nginx 命令来启动 Nginx,打开浏览器访问此机器的 IP,如果浏览器出现 Welcome to 
nginx! 则表示 Nginx 已经安装并运行成功。


启动nginx时,提示:error while loading shared libraries: libpcre.so.0: 

error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

# sudo ln -s /usr/local/lib/libpcre.so.0 /usr/lib/libpcre.so.0 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值