如何在 Ubuntu 上将 mod_wsgi 安装到 xampp 服务器?遇到 libtool 错误
Posted
技术标签:
【中文标题】如何在 Ubuntu 上将 mod_wsgi 安装到 xampp 服务器?遇到 libtool 错误【英文标题】:How do I install mod_wsgi to xampp server on Ubuntu? Running into libtool errors 【发布时间】:2014-01-22 11:23:53 【问题描述】:我正在尝试将 Python 和 mod_wsgi
添加到 XAMPP/LAMPP 服务器。我正在运行 Ubuntu 13.10。为此,我关注these instructions。
cd /opt/lampp
wget http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgz
tar xzf Python-2.7.1.tgz -C /opt/lampp
cd Python-2.7.1
./configure --prefix=/opt/lampp --enable-shared
export LD_LIBRARY_PATH=/opt/lampp/lib:/usr/lib/:/usr/local/lib:/var/lib
export LD_RUN_PATH=/opt/lampp/lib:$LD_RUN_PATH
make
sudo make install
make
之后,出现以下错误:
mod_wsgi-3.3 $ make
/opt/lampp/bin/apxs -c -I/opt/lampp/include/python2.7 -DNDEBUG mod_wsgi.c -L/opt/lampp/lib -L/opt/lampp/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm
/opt/lampp/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic -I/opt/lampp/include/c-client -I/opt/lampp/include/libpng -I/opt/lampp/include/freetype2 -O3 -fPIC -L/opt/lampp/lib -I/opt/lampp/include -I/opt/lampp/include/ncurses -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/opt/lampp/include -I/opt/lampp/include/apr-1 -I/opt/lampp/include/apr-1 -I/opt/lampp/include -I/opt/lampp/include/python2.7 -DNDEBUG -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
/opt/lampp/build/libtool: 1555: /opt/lampp/build/libtool: preserve_args+= --silent: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= gcc: not found
/opt/lampp/build/libtool: 2419: /opt/lampp/build/libtool: later+= -prefer-pic: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -std=gnu99: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/c-client: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/libpng: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/freetype2: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -O3: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -fPIC: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -L/opt/lampp/lib: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/ncurses: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -DLINUX=2: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -D_REENTRANT: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -D_GNU_SOURCE: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -pthread: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/apr-1: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/apr-1: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/python2.7: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -DNDEBUG: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -c: not found
libtool: compile: you must specify a compilation command
libtool: compile: Try `libtool --help --mode=compile' for more information.
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1
我查找了“命令失败,rc=65536”。我读的论坛说它通常表明Python文件是32位,而服务器和mod_wsgi
是64位。我回去重新安装了 64 位版本的 Python。
另外,我使用sudo apt-get install libtool
仔细检查了我是否安装了libtool
,但我检查了/opt/lampp/build/libtool
并且该文件夹/文件不存在,所以问题可能是我没有@ 987654330@ 安装到服务器了吗?如果是这个问题,我该如何解决?
【问题讨论】:
【参考方案1】:一些 Apache 发行版(例如 lampp)不完整,并且没有提供您自己构建其他 Apache 模块所需的所有部分。这对您来说似乎包括他们最初用于构建 Apache 的 libtool 软件。您需要向 Lampp 软件维护人员投诉他们的软件包不完整的原因。更好的是,只需使用操作系统为 Apache 提供的软件包。
【讨论】:
以上是关于如何在 Ubuntu 上将 mod_wsgi 安装到 xampp 服务器?遇到 libtool 错误的主要内容,如果未能解决你的问题,请参考以下文章
如何在Ubuntu中将mod_wsgi安装到特定的python版本?
如何在 Ubuntu + Apache2.4 + mod_wsgi 上为 Ansible 配置 ARA?
使用 Python 3.6、Apache 2.4 和 Django 1.11 在 Ubuntu 上安装 mod_wsgi