linux编译apache,mod_wsgi

每次在redhat上编译apache,总是提示configure: error: APR not found . Please read the documentation类似这样的问题。
简单的方案:
编译apache需要依赖apr,apr-util,pcre。
先下载这三个软件,解压缩,去掉名称后面的版本号,把他们移到apache/srclib目录下,
./configure --prefix=/usr/local/apache2/ --with-included-apr
如果提示缺少pcre,那么先安装pcre,再执行
./configure --prefix=/usr/local/apache2/ --with-included-apr --with-pcre=/usr/local/pcre


2 安装mod_wsgi
./configure –with-apxs=/usr/local/apache2/bin/apxs
make && make install && make clean&& make distclean

如果出现:/usr/bin/ld: /usr/local/lib/libpython2.7.a(node.o): relocation R_X86_64_32 against `a local symbol’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
这是32位和64位版本搞混的问题。需要重新编译python。
或者
vi /etc/ld.so.conf 添加/usr/local/Python2.7/lib
/sbin/ldconfig
/sbin/ldconfig -v

进入python安装文件目录:./configure –enable-shared
make && make install && make clean&& make distclean.
执行完后测试python是否安装完毕。在命令行敲python,如果出现Python 2.7.5 (default, Dec 9 2013, 18:39:56)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
表示安装成功。如果出现 python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory。此时需用ldconfig指定库路径
sudo ldconfig /usr/local/lib

完成后继续编译mod_wsgi。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值