Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Aug 21 '11 at 11:52

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
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. –  tigger Aug 21 '11 at 6:46
You dont need to, the module is already built. Make install is a glorified copy process. –  Devin M Aug 21 '11 at 6:48
facepalm, cool thanks for the help! –  tigger Aug 21 '11 at 6:54
No problem, the build process can be confusing. –  Devin M Aug 21 '11 at 7:06
No. Use --with-apxs as explained in my answer. –  Graham Dumpleton Aug 21 '11 at 11:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.