# Apache + Resin via mod_caucho problem

## moBeOS

I'm trying to setup my machine to use Apache for html, perl and php and have it pass jsp/servlet requests to Resin using mod_caucho. I've emerged Resin with but there is no sign of mod_caucho. When I try to compile mod_caucho from the Resin documentation I get the following:

```
checking build system type... i586-pc-linux-gnu

checking host system type... i586-pc-linux-gnu

checking target system type... i586-pc-linux-gnu

checking for a BSD-compatible install... /bin/install -c

checking whether build environment is sane... yes

checking for gawk... gawk

checking whether make sets $(MAKE)... yes

checking for gcc... gcc

checking for C compiler default output... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables... 

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ANSI C... none needed

checking for style of include used by make... GNU

checking dependency style of gcc... none

checking for ld used by GCC... /usr/i586-pc-linux-gnu/bin/ld

checking if the linker (/usr/i586-pc-linux-gnu/bin/ld) is GNU ld... yes

configure: error: Can't find Apache bin directory /usr/sbin

```

Anyone have any ideas on getting this compiled correctly? Any help would be appreciated. Thanks.

----------

## trunet

do the following:

cd /usr/local/resin (or wherever you put your resin)

./configure --with-apxs=/usr/bin/apxs (I don't remember where gentoo put the apxs, just do a locate apxs)

make

make install

any problem, I am here!

bye

(sorry for my English, Brazilian guy  :Smile: )

----------

## moBeOS

I tried to compile it using the --with-apxs flag and I got the same error. Gentoo loads it in /usr/sbin/apxs.

any other suggestions?

----------

## trunet

try --with-apache or something else. Try ./configure --help to see what you can do... I'll think that is a bug in configure, try to edit the file and find where it do a if to apache and force do enable  :Wink: 

this may work

----------

## moBeOS

Ok, I've tried everything in the resin documentation. Where is the Apache bin directory located on a default emerge? I've been trying to find it with no luck. With all the configure setting found in --help it looks like I will have to manually set all options.

----------

## alien

./configure --with-apxs2=/usr/sbin/apxs2

is your friend, if you have apache2

----------

## moBeOS

Nope, I'm running 1.3.28. Any other suggestions?

----------

## moBeOS

I figured it out... here is what I entered. Then i manually installed the components based on the Resin documentation.

```

./configure --with-apxs=apxs

```

----------

## sabaisabai

In case this is a help to somebody else, this is my configure command to compile mod_caucho.so.  I'm using apache (2.0.51-r1) and resin (3.0.8-r1) from portage, and all other suggestions had failed.

```
./configure --with-apache=/usr/lib/apache2/ --with-apxs=/usr/sbin/apxs2 --with-apache-libexec=/usr/lib/apache2/modules/ --with-apache-conf=/etc/apache2/conf/apache2.conf
```

It's messy, but it worked for me.  The following 'make' did not complete fully, but the mod_caucho.so had been compiled.

----------

## proge

http://www.h2co3.com/blog/archives/000048.html

ln -s /usr/sbin/apache2 /usr/sbin/httpd

 ln -s /usr/sbin/apxs2 /usr/sbin/apxs

cd /usr/local/src/resin

./configure --with-apxs=/usr/sbin/apxs --with-apache=/usr/sbin --with-apache-conf=/etc/apache2/conf --with-apache-libexec=/etc/apache2/modules

Then add to /etc/apache2/conf/apache.conf

LoadModule caucho_module /usr/lib/apache2/mod_caucho.so

Then add to the global apache conf or a virtual host:

CauchoConfigFile /opt/resin/conf/resin.conf

----------

