在自定义path上安装Apache模块

我已经通过指定./configure –prefix =“$ HOME”将apache2安装到我的home文件夹中。 它工作正常。 现在我正在尝试安装mod_wsgi。 我尝试./configure –prefix =“$ HOME”,以及–libexecdir =“$ HOME”,但是当执行make install时,我得到以下内容:

/usr/sbin/apxs -i -S LIBEXECDIR=/usr/libexec/apache2 -n 'mod_wsgi' mod_wsgi.la /usr/share/httpd/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1/build-1/libtool/mod_wsgi.la /usr/libexec/apache2 /usr/share/apr-1/build-1/libtool --mode=install cp mod_wsgi.la /usr/libexec/apache2/ libtool: install: cp .libs/mod_wsgi.so /usr/libexec/apache2/mod_wsgi.so cp: /usr/libexec/apache2/mod_wsgi.so: Permission denied apxs:Error: Command failed with rc=65536 

我猜这是因为我不做sudo,但我不想。 我怎样才能让它安装到家里,所以sudo是没有必要的。 我觉得这应该是显而易见的,但也许我错过了一些东西。

正确的方法不是手工复制mod_wsgi.so文件,而是使用–with-apxs选项来configurationmod_wsgi,当你build立它来告诉它Apache安装的apxs脚本的位置是:

 ./configure --with-apxs=$HOME/bin/apxs 

通过不这样做,你已经编译了mod_wsgi对错误的Apache,结果可能与你的主目录下的Apache不兼容。

–with-apxs选项的使用在安装说明的开始部分有明确的描述。

只要你使用–with-apxs,安装步骤应该把它复制到正确的Apache安装。

在“ 安装指南”中指出:

要按照Apache的安装要求将Apache模块安装到Apache模块的标准位置,请运行:

进行安装

安装应该按照“root”用户或“sudo”命令进行。

如果您想将Apache模块安装在由您的操作系统分发包构造Apacheconfiguration文件和模块的非标准位置,则需要手动将文件复制到适当的位置。

如果手工安装Apache模块,该文件被称为“mod_wsgi.so”。 如果您使用Apache 1.3,则可以在源目录中find编译的Apache模块。 如果您使用的是Apache 2.X,则可以在“.libs”子目录中find已编译的Apache模块。 复制到适当的位置时,文件的名称应保持相同。

所以你需要将模块移动到你为Apache2安装设置的目录中。