Sign up ×
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'
/usr/share/httpd/build/ SH_LIBTOOL='/usr/share/apr-1/build-1/libtool/ /usr/libexec/apache2
/usr/share/apr-1/build-1/libtool --mode=install cp /usr/libexec/apache2/
libtool: install: cp .libs/ /usr/libexec/apache2/
cp: /usr/libexec/apache2/ 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 Aug 21 '11 at 11:52

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

2 Answers 2

up vote 2 down vote accepted

The correct way is not to copy the 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
How do I find where my Apache installation's apxs script is? – User Jun 19 at 1:14
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 at 2:11

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 ''. 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.