3

I'm trying to build mod_jk for Apache on ubuntu, but when I issue:

./configure --with-apxs=/usr/local/apache/bin/apxs 

I got the following error:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/Arbi/Downloads/tomcat-connectors-1.2.40-src/native/scripts/build/unix/missing: Unknown `--is-lightweight' option
Try `/home/Arbi/Downloads/tomcat-connectors-1.2.40-src/native/scripts/build/unix/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for test... /usr/bin/test
checking for grep... /bin/grep
checking for echo... /bin/echo
checking for sed... /bin/sed
checking for cp... /bin/cp
checking for mkdir... /bin/mkdir
need to check for Perl first, apxs depends on it...
checking for perl... /usr/bin/perl
could not find /usr/local/apache/bin/apxs
configure: error: You must specify a valid --with-apxs path

Apache is already installed, and the directory /usr/local/apache/bin/ exists, also apxs can be found there! Any idea why I'm having this error and how I can build mod_jk?

Shog9
  • 156,901
  • 35
  • 231
  • 235
bachr
  • 5,780
  • 12
  • 57
  • 92

6 Answers6

1

I had the same issue, but I have a solution.

First, I do not find out why the apxs file is not found by the system.

But alternative you can define the Apache directory with the option

--with-apche=DIR

example:

./configure --with-apache=/usr/local/bin/apache

ofner01
  • 11
  • 2
1

For my case the error message was misleading, by running the apxs command myself I could see it was in fact other tools that were missing

$ apxs -q PREFIX
/usr/local/apache2
apxs:Error: /usr/bin/apr-1-config not found!.

Fix was to install the libaprutil1-dev package

$ apt-get install libaprutil1-dev
Chris Sainty
  • 9,086
  • 1
  • 26
  • 31
0

Had the very same problem and could fix it. The problem was that apparently that I was giving the path to the apxs in the directory where I had built apache. After you call 'make install' the make process will install apache in the directory you provided during the configure process, in my case it was /usr/local/apache2, and apxs is copied to the 'bin' subdirectory. When I provided /usr/local/apache2/bin/apxs it suddenly worked. In addition, after trying a hundred times I started to swap the p and the x and of course /usr/local/apache2/bin/axps doesn't exist in this case so you might want to pay attention to this detail as well ;)

kaidentity
  • 609
  • 4
  • 10
  • 26
0

The mod jk build refers to the apache version for which it is build. You would mostly face this error if httpd was build from source code. It is because when build from source the apxs file will contain the path to builddir etc. --with-apxs=path would refer to these contents and complaints that the path is not valid. To solve the error, move httpd build to a folder as said in the apxs file.

0

I tried this. It worked for me.

./configure --with-apxs=/usr/local/apache/bin/apxs

which gives the following output:

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for test... /bin/test
checking for grep... /bin/grep
checking for echo... /bin/echo
checking for sed... /bin/sed
checking for cp... /bin/cp
checking for mkdir... /bin/mkdir
need to check for Perl first, apxs depends on it...
checking for perl... /bin/perl
could not find /usr/local/apache/bin/apxs
configure: error: You must specify a valid --with-apxs path

I tried with the command below to find where apxs is located.

[root@ip-10-0-0-20 native]# whereis apxs

apxs: /usr/bin/apxs /usr/share/man/man1/apxs.1.gz

[root@ip-10-0-0-20 native]# ./configure --with-apxs=/usr/bin/apxs
checking build system type... x86_64-pc-linux-gnu
BDL
  • 21,052
  • 22
  • 49
  • 55
-2

I have same probrem. but solved.

If you installed in this order

  1. apache httpd
  2. perl

rewrite first line of /usr/local/apache/bin/apxs

#!/replace/with/path/to/perl/interpreter -w

to

#!/usr/local/perl -w

/usr/local/perl is your perl path.

And retry configure.

endo
  • 19
  • 5