Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-SBRSScore: None X-IronPort-AV: i="3.95,166,1120428000"; d="scan'208"; a="12155694:sNHT30567516" To: cygwin AT cygwin DOT com Subject: Apache with mod_perl up and running (was: Re: error compiling apache-1.3.33 with mod_perl and perl-5.8.7-1) From: Harald Joerg In-Reply-To: (Harald Joerg's message of "Thu, 04 Aug 2005 10:51:23 +0200") References: <42D0178C DOT 6070803 AT familiehaase DOT de> <20050709131329 DOT GC3284 AT postle DOT net> <42F0F80E DOT 6060308 AT familiehaase DOT de> Date: Thu, 04 Aug 2005 16:45:37 +0200 Message-ID: User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3.50 (cygwin) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes I wrote: > 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 mod_perl: $ 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 \ /usr/lib/perl5/5.8/cygwin/auto/DynaLoader/DynaLoader.a \ /usr/lib/perl5/5.8/cygwin/auto/Win32CORE/Win32CORE.a \ -L/usr/lib/perl5/5.8/cygwin/CORE -lperl -lcrypt -lgdbm_compat with two more parameters added: -L/usr/bin -lhttpd 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 command. 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 myself. 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 cygwin apache. -- Cheers, haj -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/