This is the mail archive of the
mailing list for the Cygwin project.
Apache with mod_perl up and running (was: Re: error compiling apache-1.3.33 with mod_perl and perl-5.8.7-1)
> Gerrit P. Haase writes:
>>> [...] Would mod_perl work with a mod_so setup as well?
>> Yes it should work. Have you tried to link directly against the DLL?
> You mean against /usr/bin/libhttpd.dll?
> I've tried, but failed miserably so far. I've been starting with the
> build procedure delivered with mod_perl (DO_HTTPD=1), which creates a
> different Apache than what I get from cygwin's setup. I have yet to
> find out how cygwin's Apache has been built...
OK, I've got it up and running now.
There are a couple of gotchas, though, mainly with the mod_perl
installation procedures. Be warned.
1) In the mod_perl directory, start as documented for creating a DSO
$ perl Makefile.PL USE_APXS=1 EVERYTHING=1 WITH_APXS=/usr/sbin/apxs
2) Run make.
3) Curse when trying to understand
3a) why it fails to resolve against the apache core and
3b) why the heck make is trying to create cygperl5_8.dll.
ad 3a): I haven't found a solution. I guess one can set some
environment variable or to add some parameter to perl Makefile.PL, but
I haven't discovered *how*. My workaround was to manually enter the
offending gcc command (wrapped for readability):
gcc -shared -o cygperl5_8.dll -Wl,--out-implib=libperl.dll.a \
-Wl,--export-all-symbols -Wl,--enable-auto-import \
-Wl,--stack,8388608 -Wl,--enable-auto-image-base -s -L/usr/local/lib \
mod_perl.lo perlxsi.lo perl_config.lo perl_util.lo perlio.lo \
mod_perl_opmask.lo Apache.lo Constants.lo ModuleConfig.lo \
Log.lo URI.lo Util.lo Connection.lo Server.lo File.lo Table.lo \
-s -s -L/usr/local/lib \
-L/usr/lib/perl5/5.8/cygwin/CORE -lperl -lcrypt -lgdbm_compat
with two more parameters added:
ad 3b): I had to find out that I couldn't simply resume make because
it would again try to compile all the .lo files into cygperl5_8.dll.
The simple reason:
the target in the mod_perl makefile is 'libperl.so'. However, ld2
as invoked by the makefile calls perlld, which insists on having
libperl.* renamed to cygperl5_8.dll in the -o parameter for the gcc
We already know that - for archeological reasons - mod_perl's DSO
library happens to have the same file name as perl's, eh? Here's
a place where this *really* bit me.
I copied cygperl5_8.dll to libperl.so to get make into believing that
the linking has been successful. Nevertheless the apxs step failed,
telling me that libperl.so isn't a DSO library. How would apxs know?
On cygwin (and only on cygwin), apxs insists on having a suffix of
.dll for DSOs.
So what I finally did was to manually copy cygperl5_8.dll to
/usr/lib/apache/mod_perl.dll and changed /etc/apache/httpd.conf
I apologize for not going deeper into the subject and for not trying
to create the necessary patches to the procedures and the
documentation right now. As I already mentioned, compiling mod_perl
was just a step aside during my attempts to add mod_auth_kerb to my
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html