如何在从 xampp 包安装的 apache 服务器上安装 mod_wsgi?

Posted

技术标签:

【中文标题】如何在从 xampp 包安装的 apache 服务器上安装 mod_wsgi?【英文标题】:How do I install mod_wsgi on my apache server installed from xampp package? 【发布时间】:2020-11-11 20:52:19 【问题描述】:

我下载了 mod_wsgi 包,但在配置 make 文件时遇到了问题。我使用的命令是sudo ./configure --with-apxs=/opt/lampp/bin/apxs。我收到了以下消息。

./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for prctl... yes
checking Apache version... ./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
./configure: line 2769: /: Is a directory

checking for python... /usr/bin/python
./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
configure: creating ./config.status
config.status: creating Makefile

所以我把apxs文件的第一个like从/bin/perl改成了/usr/bin/perl

然后我在运行 sudo ./configure --with-apxs=/opt/lampp/bin/apxs 时得到了这个。

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for prctl... yes
checking Apache version... 2.4.41
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile

现在当我制作我得到

/opt/lampp/bin/apxs -c -I/usr/include/python2.7 -DNDEBUG -D_FORTIFY_SOURCE=2  -Wc,-g -Wc,-O2  src/server/mod_wsgi.c src/server/wsgi_*.c -L/usr/lib -L/usr/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 -L/opt/lampp/lib -I/opt/lampp/include -I/opt/lampp/include/ncurses  -DLINUX -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 -g -O2 -I/usr/include/python2.7 -DNDEBUG -D_FORTIFY_SOURCE=2  -c -o src/server/mod_wsgi.lo src/server/mod_wsgi.c && touch src/server/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+= -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: 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+= -g: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -O2: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/usr/include/python2.7: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -DNDEBUG: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -D_FORTIFY_SOURCE=2: 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
.
Makefile:31: recipe for target 'src/server/mod_wsgi.la' failed
make: *** [src/server/mod_wsgi.la] Error 1

我尝试安装 libtool,但没有成功。

请帮我解决这个问题,或者让我知道一种对你有用的方法。

【问题讨论】:

【参考方案1】:

这是由于旧版本的 Xampp 造成的。尝试更新 xampp。或者你可以把/opt/lampp/build/libtool的第一行从/bin/sh改成/bin/bash

【讨论】:

以上是关于如何在从 xampp 包安装的 apache 服务器上安装 mod_wsgi?的主要内容,如果未能解决你的问题,请参考以下文章

Windows下安装的XAMPP如何设置Apache和MySQL等服务开机自启动

xampp怎么启动apache服务

XAMPP简介

安装xampp后不能启动apache,劳驾大家给出一些建议,谢谢。

xampp下载地址 一个集成的易于安装的WEB环境部署包

如何让 XAMPP 控制面板正确安装和启动服务?