How do I change the APXS environmental variable to use an apxs tool from a different location?
I am trying to install an Apache module to my MAMP installation. I can successfully install the module using $ apxs -cia mod_ftp_example.c
. However, the global apxs
command is using the apxs tool that comes configured for the MAC OS X pre-installed Apache server, instead of using the apxs tool located in my MAMP build.
This means that when I execute the apxs
command in Terminal, the module's .so file is installed here:
/usr/libexec/apache2
This is installing the module to the Apache server that comes with the Mac, and not my MAMP build. The path to the library modules that I want to install my module's .so file into is actually here:
/Applications/MAMP/Library/modules
Now, when I execute the command $ whereis apxs
, I see the apxs tool is located in /usr/sbin/apxs
- again, this is inside the httpd build for the default OS X Apache server and not my MAMP server.
My theory is that if I can change the whereis
location of the apxs, then I can install my modules into the correct location. So how can I change that location? I tried the following, but it doesn't seem to work :/
$ APXS=/applications/mamp/library/bin/apxs
Any ideas??? Thanks!
If your just running APXS directly you can just use the full path i.e. instead of
apxs -cia mod_ftp_example.c
you can do
/applications/mamp/library/bin/apxs -cia mod_ftp_example.c
If your running the apache ./configure.apxs you can do
export APXS=/applications/mamp/library/bin/apxs
If your doing some other kind of script you could always change the precedence of your path:
export PATH=/applications/mamp/library/bin/:$PATH