nginx1.2.4安装

本文记录了安装nginx 1.2.4的过程,包括下载pcre 8.31,安装过程中遇到的libpcre.so.1缺失错误以及如何手动添加系统链接的详细步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

研究了一下安装步骤,实践了一把,以下是全过程

1、下载相关安装包


pcre 8.31   http://pcre.org/

nginx 1.2.4 http://nginx.org/en/download.html



2、安装pcre

tar zxvf pcre-8.31.gz
cd pcre-8.31
./configure
make
make install

3、安装nginx

tar zxvf nginx-1.2.4.tar.gz
cd nginx-1.2.4
./configure --with-http_stub_status_module --with-http_gzip_static_module --prefix=/usr/local/nginx
make
make install


4、启动nginx

/usr/local/nginx/sbin/nginx


出现以下错误:

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


上网查了,是因为某些链接缺失,查到缺失的信息:


ldd $(which /usr/local/nginx/sbin/nginx)


libpcre.so.1 => not found


手动加上链接

网上好多没有说明如何详细添加链接,这里着重介绍:

首先查看系统的版本:

file /sbin/init


分32位和64位,以64位为例

以下是添加链接的命令:

cd /lib
ln -s /usr/local/lib/libpcre.so.1 /lib64


然后再次启动nginx

/usr/local/nginx/sbin/nginx


确认已经启动

netstat -ntpl



tcp        0      0 0.0.0.0:80


访问服务器,出现以下提示,即安装成功

Welcome to nginx!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值