64位系统上安装apache

原文出处:http://johnly.blog.51cto.com/742359/159679

查看系统是多少位:

# getconf LONG_BIT  

显示:

# 64

如果在64位系统上安装apache 正常情况下会报一下错误

/usr/lib/libexpat.so: could not read symbols: File in wrong format

原因是:编译的时候默认连接库是32位的库文件,所以需要手工指定64位库文件的位置

# cd /usr/local/src/

# tar -zxvf httpd-2.2.8.tar.gz

# cd httpd-2.2.8

#  ./configure LDFLAGS="-L/usr/lib64 -L/lib64" --prefix=/usr/local/apache --enable-so --enable-expires --enable-rewrite --enable-headers --enable-deflate  --enable-dav --enable-maintainer-mode

# vi ./srclib/apr-util/Makefile

修改

# APRUTIL_LIBS = -lsqlite3 -lexpat /usr/local/src/httpd-2.2.8/srclib/apr/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl

APRUTIL_LIBS = -lsqlite3 /usr/lib64/libexpat.la /usr/local/src/httpd-2.2.8/srclib/apr/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl

# make

# make install

安装jpeg 报错 make: ./libtool: Command not found

解决方案

由于libtool版本过低导致的,重新下载新版本的libtool以默认方式安装,执行以下命令:

./configure

make

make install

然后进入jpeg-6b的源码目录,然后执行以下步骤,切记!

cp /usr/share/libtool/config.sub .

cp /usr/share/libtool/config.guess .

./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static