0

I have installed apache2 into my home folder by specifying the ./configure --prefix="$HOME". It works fine. Now I am trying to install mod_wsgi. I try ./configure --prefix="$HOME", as well as --libexecdir="$HOME", however when performing a make install I get the following:

/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

I'm guessing it's since I don't do sudo, but I don't want to. How can I make it install into Home, so that sudo isn't necessary. I feel like this should be obvious but maybe I'm missing something.

Anil Vaitla
  • 103
  • 1
  • 4

2 Answers2

2

The correct way is not to copy the mod_wsgi.so file by hand, but use the --with-apxs option to configure for mod_wsgi when you build it to tell it where your Apache installation's apxs script is:

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

By not doing this you have compiled mod_wsgi against the wrong Apache and the result could be incompatible with the Apache you have in your home directory.

The use of the --with-apxs option is clearly described towards the start of the installation instructions.

So long at you use --with-apxs, the install step should copy it to the correct Apache installation.

Graham Dumpleton
  • 6,090
  • 2
  • 21
  • 19
  • How do I find where my Apache installation's apxs script is? – User Jun 19 '15 at 01:14
  • 1
    If you are using an Apache provided by a package from your Linux distribution, apxs/apxs2 will be in /usr/sbin. If it isn't there, then you likely do not have the 'dev' variant of the Apache package installed. If you are using an Apache compiled from source code in a custom directory, then it should be in the 'bin' directory for that installation. Do note that some third party packaged Apache versions don't provide headers and apxs to allow you to build modules. So question is where your Apache has come from. Better off creating a separate question for particular problem you are having. – Graham Dumpleton Jun 19 '15 at 02:11
0

In the Installation Guide it states that:

To install the Apache module into the standard location for Apache modules as dictated by Apache for your installation, run:

make install

Installation should be done as the 'root' user or 'sudo' command if appropriate.

If you want to install the Apache module in a non standard location dictated by how your operating system distribution structures the configuration files and modules for Apache, you will need to copy the file manually into place.

If installing the Apache module by hand, the file is called 'mod_wsgi.so'. If you are using Apache 1.3 the compiled Apache module can be found in the source directory. If you are using Apache 2.X the compiled Apache module can be found in the ".libs" subdirectory. The name of the file should be kept the same when copied into its appropriate location.

So you need to move the module into the directory that you have set up for your Apache2 install.

  • Cool, yeah, definitely should have found that before posting, but still I can't run as root/sudo, and in order to do make install I need to be. So I had thought there would be a configure flag to specify in order to build the output to my home folder (possibly in .libs). I can copy it over easy, once that's done of course. –  Aug 21 '11 at 06:46
  • You dont need to, the module is already built. Make install is a glorified copy process. –  Aug 21 '11 at 06:48
  • No problem, the build process can be confusing. –  Aug 21 '11 at 07:06
  • No. Use --with-apxs as explained in my answer. – Graham Dumpleton Aug 21 '11 at 11:39