diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/distrib/sets/lists/base/md.i386 ./distrib/sets/lists/base/md.i386 --- ../src.danvfs/distrib/sets/lists/base/md.i386 Sun Jun 1 17:59:02 2003 +++ ./distrib/sets/lists/base/md.i386 Tue Jun 10 15:08:09 2003 @@ -578,6 +578,47 @@ ./usr/libdata/perl5/i386-openbsd/5.8.0/threads.pm ./usr/libdata/perl5/i386-openbsd/5.8.0/threads/shared.pm ./usr/libdata/perl5/site_perl/i386-openbsd +./usr/libdata/perl5/site_perl/i386-openbsd/Apache +./usr/libdata/perl5/site_perl/i386-openbsd/Apache.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Connection.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Constants +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Constants.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Constants/Exports.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Debug.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/ExtUtils.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/FakeRequest.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/File.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Include.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Leak.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Log.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/ModuleConfig.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/MyConfig.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Opcode.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Options.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/PerlRun.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/PerlRunXS.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/PerlSections.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/RedirectLogFix.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Registry.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/RegistryBB.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/RegistryLoader.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/RegistryNG.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Resource.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/SIG.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Server.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/SizeLimit.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/StatINC.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Status.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Symbol.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Symdump.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Table.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/URI.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/Util.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/httpd_conf.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/src.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Apache/test.pm +./usr/libdata/perl5/site_perl/i386-openbsd/Bundle +./usr/libdata/perl5/site_perl/i386-openbsd/Bundle/Apache.pm ./usr/libdata/perl5/site_perl/i386-openbsd/_h2ph_pre.ph ./usr/libdata/perl5/site_perl/i386-openbsd/a.out.ph ./usr/libdata/perl5/site_perl/i386-openbsd/altq @@ -601,6 +642,99 @@ ./usr/libdata/perl5/site_perl/i386-openbsd/arpa/telnet.ph ./usr/libdata/perl5/site_perl/i386-openbsd/arpa/tftp.ph ./usr/libdata/perl5/site_perl/i386-openbsd/assert.ph +./usr/libdata/perl5/site_perl/i386-openbsd/auto +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/Leak +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/Leak/Leak.bs +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/Leak/Leak.so +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/Symbol +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/Symbol/Symbol.bs +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/Symbol/Symbol.so +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_alloc.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_compat.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_config.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_config_auto.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_ctx.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_ctype.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_ebcdic.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_hook.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_md5.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_mm.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_mmn.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/ap_sha1.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/buff.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/compat.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/conf.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/explain.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/fdcache.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/fnmatch.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/hsregex.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/http_conf_globals.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/http_config.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/http_core.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/http_log.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/http_main.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/http_protocol.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/http_request.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/http_vhost.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/httpd.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/multithread.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/rfc1413.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/scoreboard.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/util_date.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/util_md5.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/util_script.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/include/util_uri.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/asciitab.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/hashtable.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/iasciitab.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/latin1tab.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/nametab.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/utf8tab.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/xmldef.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/xmlparse.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/xmlrole.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/xmltok.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/expat-lite/xmltok_impl.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/sdbm +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/sdbm/sdbm.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/sdbm/sdbm_pair.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/lib/sdbm/sdbm_tune.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/perl +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/perl/apache_inc.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/perl/mod_perl.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/perl/mod_perl_version.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/perl/mod_perl_xs.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/perl/perl_PL.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/proxy +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/proxy/mod_proxy.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/ssl +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/ssl/mod_ssl.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/ssl/ssl_expr.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/ssl/ssl_util_sdbm.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/ssl/ssl_util_ssl.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/ssl/ssl_util_table.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/standard +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/modules/standard/mod_rewrite.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/os +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/os/unix +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/os/unix/os-inline.c +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/os/unix/os.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/regex +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/regex/cclass.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/regex/cname.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/regex/regex2.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/regex/utils.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/support +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/include/support/suexec.h +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/mod_perl.exp +./usr/libdata/perl5/site_perl/i386-openbsd/auto/Apache/typemap ./usr/libdata/perl5/site_perl/i386-openbsd/bfd.ph ./usr/libdata/perl5/site_perl/i386-openbsd/bfdlink.ph ./usr/libdata/perl5/site_perl/i386-openbsd/bitstring.ph @@ -608,6 +742,7 @@ ./usr/libdata/perl5/site_perl/i386-openbsd/bm.ph ./usr/libdata/perl5/site_perl/i386-openbsd/bsd_auth.ph ./usr/libdata/perl5/site_perl/i386-openbsd/cast.ph +./usr/libdata/perl5/site_perl/i386-openbsd/cgi_to_mod_perl.pod ./usr/libdata/perl5/site_perl/i386-openbsd/com_err.ph ./usr/libdata/perl5/site_perl/i386-openbsd/cpio.ph ./usr/libdata/perl5/site_perl/i386-openbsd/crypto @@ -1520,6 +1655,14 @@ ./usr/libdata/perl5/site_perl/i386-openbsd/miscfs/umapfs/umap.ph ./usr/libdata/perl5/site_perl/i386-openbsd/miscfs/union ./usr/libdata/perl5/site_perl/i386-openbsd/miscfs/union/union.ph +./usr/libdata/perl5/site_perl/i386-openbsd/mod_perl.pm +./usr/libdata/perl5/site_perl/i386-openbsd/mod_perl.pod +./usr/libdata/perl5/site_perl/i386-openbsd/mod_perl_cvs.pod +./usr/libdata/perl5/site_perl/i386-openbsd/mod_perl_hooks.pm +./usr/libdata/perl5/site_perl/i386-openbsd/mod_perl_hooks.pm.PL +./usr/libdata/perl5/site_perl/i386-openbsd/mod_perl_method_handlers.pod +./usr/libdata/perl5/site_perl/i386-openbsd/mod_perl_traps.pod +./usr/libdata/perl5/site_perl/i386-openbsd/mod_perl_tuning.pod ./usr/libdata/perl5/site_perl/i386-openbsd/mpool.ph ./usr/libdata/perl5/site_perl/i386-openbsd/ncurses.ph ./usr/libdata/perl5/site_perl/i386-openbsd/ndbm.ph diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/Makefile.bsd-wrapper ./usr.sbin/httpd/Makefile.bsd-wrapper --- ../src.danvfs/usr.sbin/httpd/Makefile.bsd-wrapper Sun Jun 1 17:28:27 2003 +++ ./usr.sbin/httpd/Makefile.bsd-wrapper Tue Jun 10 15:10:25 2003 @@ -161,7 +161,91 @@ MAN+= src/support/dbmmanage.1 src/support/htdigest.1 src/support/htpasswd.1 \ src/support/apachectl.8 src/support/logresolve.8 \ httpd.8 src/support/rotatelogs.8 src/support/apxs.8 \ - src/support/suexec.8 + src/support/suexec.8 \ + mod_perl/man/Apache.cat3p \ + mod_perl/man/Apache::Constants.cat3p \ + mod_perl/man/Apache::Debug.cat3p \ + mod_perl/man/Apache::ExtUtils.cat3p \ + mod_perl/man/Apache::FakeRequest.cat3p \ + mod_perl/man/Apache::File.cat3p \ + mod_perl/man/Apache::Include.cat3p \ + mod_perl/man/Apache::Leak.cat3p \ + mod_perl/man/Apache::Log.cat3p \ + mod_perl/man/Apache::Options.cat3p \ + mod_perl/man/Apache::PerlRun.cat3p \ + mod_perl/man/Apache::PerlRunXS.cat3p \ + mod_perl/man/Apache::PerlSections.cat3p \ + mod_perl/man/Apache::RedirectLogFix.cat3p \ + mod_perl/man/Apache::Registry.cat3p \ + mod_perl/man/Apache::RegistryLoader.cat3p \ + mod_perl/man/Apache::Resource.cat3p \ + mod_perl/man/Apache::SIG.cat3p \ + mod_perl/man/Apache::SizeLimit.cat3p \ + mod_perl/man/Apache::StatINC.cat3p \ + mod_perl/man/Apache::Status.cat3p \ + mod_perl/man/Apache::Symbol.cat3p \ + mod_perl/man/Apache::Symdump.cat3p \ + mod_perl/man/Apache::Table.cat3p \ + mod_perl/man/Apache::URI.cat3p \ + mod_perl/man/Apache::Util.cat3p \ + mod_perl/man/Apache::httpd_conf.cat3p \ + mod_perl/man/Apache::src.cat3p \ + mod_perl/man/Apache::test.cat3p \ + mod_perl/man/Bundle::Apache.cat3p \ + mod_perl/man/cgi_to_mod_perl.cat3p \ + mod_perl/man/mod_perl.cat3p \ + mod_perl/man/mod_perl_cvs.cat3p \ + mod_perl/man/mod_perl_method_handlers.cat3p \ + mod_perl/man/mod_perl_traps.cat3p \ + mod_perl/man/mod_perl_tuning.cat3p + +POD2MAN= /usr/bin/pod2man + +MANPERL= +.for page sect file in \ + Apache 3p mod_perl/Apache/Apache.pm \ + Apache::Constants 3p mod_perl/Constants/Constants.pm \ + Apache::File 3p mod_perl/File/File.pm \ + Apache::Leak 3p mod_perl/Leak/Leak.pm \ + Apache::Log 3p mod_perl/Log/Log.pm \ + Apache::PerlRunXS 3p mod_perl/PerlRunXS/PerlRunXS.pm \ + Apache::Symbol 3p mod_perl/Symbol/Symbol.pm \ + Apache::Table 3p mod_perl/Table/Table.pm \ + Apache::URI 3p mod_perl/URI/URI.pm \ + Apache::Util 3p mod_perl/Util/Util.pm \ + Apache::PerlSections 3p mod_perl/lib/Apache/PerlSections.pm \ + Apache::Include 3p mod_perl/lib/Apache/Include.pm \ + Apache::Resource 3p mod_perl/lib/Apache/Resource.pm \ + mod_perl_traps 3p mod_perl/mod_perl_traps.pod \ + mod_perl_tuning 3p mod_perl/mod_perl_tuning.pod \ + Bundle::Apache 3p mod_perl/lib/Bundle/Apache.pm \ + Apache::src 3p mod_perl/lib/Apache/src.pm \ + Apache::Options 3p mod_perl/lib/Apache/Options.pm \ + Apache::SIG 3p mod_perl/lib/Apache/SIG.pm \ + mod_perl_method_handlers 3p mod_perl/mod_perl_method_handlers.pod \ + mod_perl 3p mod_perl/mod_perl.pod \ + Apache::httpd_conf 3p mod_perl/lib/Apache/httpd_conf.pm \ + Apache::Debug 3p mod_perl/lib/Apache/Debug.pm \ + cgi_to_mod_perl 3p mod_perl/cgi_to_mod_perl.pod \ + Apache::RedirectLogFix 3p mod_perl/lib/Apache/RedirectLogFix.pm \ + Apache::StatINC 3p mod_perl/lib/Apache/StatINC.pm \ + Apache::SizeLimit 3p mod_perl/lib/Apache/SizeLimit.pm \ + Apache::Registry 3p mod_perl/lib/Apache/Registry.pm \ + Apache::PerlRun 3p mod_perl/lib/Apache/PerlRun.pm \ + Apache::FakeRequest 3p mod_perl/lib/Apache/FakeRequest.pm \ + mod_perl_cvs 3p mod_perl/mod_perl_cvs.pod \ + Apache::test 3p mod_perl/lib/Apache/test.pm \ + Apache::ExtUtils 3p mod_perl/lib/Apache/ExtUtils.pm \ + Apache::Symdump 3p mod_perl/lib/Apache/Symdump.pm \ + Apache::RegistryLoader 3p mod_perl/lib/Apache/RegistryLoader.pm \ + Apache::Status 3p mod_perl/lib/Apache/Status.pm +. ifndef NOMAN +MANPERL+= ${page}.cat${sect} +. endif +${page}.cat${sect}: ${file} + ${POD2MAN} --section=${sect} --official ${.ALLSRC}|\ + ${NROFF} -man >${.OBJDIR}/mod_perl/man/${.TARGET} +.endfor INCFILES= \ src/include/ap.h \ @@ -788,16 +872,28 @@ .include -all: prereq - @cd ${.OBJDIR} && ${MAKE} +all: man.build prereq + @cd ${.OBJDIR}/mod_perl && ${MAKE} + +man.build: ${MANPERL} prereq: ${.OBJDIR}/config.status +INSTALLSITELIB=/usr/libdata/perl5/site_perl +INSTALLSITEARCH=/usr/libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd + ${.OBJDIR}/config.status : ${.OBJDIR}/config.layout - @cd ${.OBJDIR} && CC="${CC}" LD_SHLIB="${CC}" \ + @cd ${.OBJDIR}/mod_perl && CC="${CC}" LD_SHLIB="${CC}" \ OPTIM="${CFLAGS} ${COPTS}" \ PATH="/sbin:/usr/sbin:/bin:/usr/bin" \ - sh configure ${CONFIG_ARGS} + perl Makefile.PL \ + APACHE_SRC="../src" \ + DO_HTTPD=1 \ + USE_APACI=1 \ + EVERYTHING=1 \ + INSTALLSITELIB="${INSTALLSITELIB}" \ + INSTALLSITEARCH="${INSTALLSITEARCH}" \ + APACI_ARGS="${CONFIG_ARGS}" .if !exists(${.OBJDIR}/config.layout) ${.OBJDIR}/config.layout: ${.CURDIR}/config.layout @@ -867,6 +963,144 @@ echo $$j; \ eval $$j; \ rm -rf $$d + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH} + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache.pm + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/Apache + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Connection.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Connection.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Constants.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Constants.pm + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/Apache/Constants + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Constants/Exports.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Constants/Exports.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Debug.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Debug.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/ExtUtils.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/ExtUtils.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/FakeRequest.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/FakeRequest.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/File.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/File.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Include.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Include.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Leak.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Leak.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Log.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Log.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/ModuleConfig.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/ModuleConfig.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/MyConfig.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/MyConfig.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Opcode.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Opcode.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Options.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Options.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/PerlRun.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/PerlRun.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/PerlRunXS.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/PerlRunXS.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/PerlSections.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/PerlSections.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/RedirectLogFix.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/RedirectLogFix.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Registry.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Registry.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/RegistryBB.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/RegistryBB.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/RegistryLoader.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/RegistryLoader.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/RegistryNG.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/RegistryNG.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Resource.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Resource.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/SIG.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/SIG.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Server.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Server.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/SizeLimit.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/SizeLimit.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/StatINC.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/StatINC.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Status.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Status.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Symbol.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Symbol.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Symdump.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Symdump.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Table.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Table.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/URI.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/URI.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/Util.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/Util.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/httpd_conf.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/httpd_conf.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/src.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/src.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Apache/test.pm ${DESTDIR}/${INSTALLSITEARCH}/Apache/test.pm + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/Bundle + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/Bundle/Apache.pm ${DESTDIR}/${INSTALLSITEARCH}/Bundle/Apache.pm + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/Leak + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/Leak/Leak.bs ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/Leak/Leak.bs + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/Leak/Leak.so ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/Leak/Leak.so + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/Symbol + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/Symbol/Symbol.bs ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/Symbol/Symbol.bs + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/Symbol/Symbol.so ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/Symbol/Symbol.so + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_alloc.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_alloc.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_compat.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_compat.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_config.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_config.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_config_auto.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_config_auto.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_ctx.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_ctx.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_ctype.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_ctype.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_ebcdic.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_ebcdic.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_hook.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_hook.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_md5.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_md5.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_mm.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_mm.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_mmn.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_mmn.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/ap_sha1.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/ap_sha1.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/buff.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/buff.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/compat.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/compat.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/conf.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/conf.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/explain.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/explain.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/fdcache.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/fdcache.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/fnmatch.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/fnmatch.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/hsregex.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/hsregex.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/http_conf_globals.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/http_conf_globals.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/http_config.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/http_config.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/http_core.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/http_core.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/http_log.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/http_log.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/http_main.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/http_main.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/http_protocol.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/http_protocol.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/http_request.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/http_request.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/http_vhost.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/http_vhost.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/httpd.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/httpd.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/multithread.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/multithread.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/rfc1413.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/rfc1413.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/scoreboard.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/scoreboard.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/util_date.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/util_date.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/util_md5.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/util_md5.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/util_script.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/util_script.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/include/util_uri.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/include/util_uri.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/asciitab.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/asciitab.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/hashtable.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/hashtable.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/iasciitab.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/iasciitab.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/latin1tab.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/latin1tab.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/nametab.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/nametab.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/utf8tab.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/utf8tab.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/xmldef.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/xmldef.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/xmlparse.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/xmlparse.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/xmlrole.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/xmlrole.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/xmltok.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/xmltok.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/expat-lite/xmltok_impl.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/expat-lite/xmltok_impl.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/sdbm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/sdbm/sdbm.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/sdbm/sdbm.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/sdbm/sdbm_pair.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/sdbm/sdbm_pair.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/lib/sdbm/sdbm_tune.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/lib/sdbm/sdbm_tune.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/perl + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/perl/apache_inc.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/perl/apache_inc.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/perl/mod_perl.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/perl/mod_perl.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/perl/mod_perl_version.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/perl/mod_perl_version.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/perl/mod_perl_xs.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/perl/mod_perl_xs.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/perl/perl_PL.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/perl/perl_PL.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/proxy + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/proxy/mod_proxy.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/proxy/mod_proxy.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/ssl + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/ssl/mod_ssl.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/ssl/mod_ssl.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/ssl/ssl_expr.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/ssl/ssl_expr.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/ssl/ssl_util_sdbm.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/ssl/ssl_util_sdbm.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/ssl/ssl_util_ssl.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/ssl/ssl_util_ssl.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/ssl/ssl_util_table.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/ssl/ssl_util_table.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/standard + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/modules/standard/mod_rewrite.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/modules/standard/mod_rewrite.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/os/unix + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/os/unix/os-inline.c ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/os/unix/os-inline.c + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/os/unix/os.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/os/unix/os.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/regex + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/regex/cclass.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/regex/cclass.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/regex/cname.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/regex/cname.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/regex/regex2.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/regex/regex2.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/regex/utils.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/regex/utils.h + ${INSTALL} -d -o root -g wheel -m 555 ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/support + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/include/support/suexec.h ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/include/support/suexec.h + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/mod_perl.exp ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/mod_perl.exp + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/arch/auto/Apache/typemap ${DESTDIR}/${INSTALLSITEARCH}/auto/Apache/typemap + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/cgi_to_mod_perl.pod ${DESTDIR}/${INSTALLSITEARCH}/cgi_to_mod_perl.pod + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/mod_perl.pm ${DESTDIR}/${INSTALLSITEARCH}/mod_perl.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/mod_perl.pod ${DESTDIR}/${INSTALLSITEARCH}/mod_perl.pod + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/mod_perl_cvs.pod ${DESTDIR}/${INSTALLSITEARCH}/mod_perl_cvs.pod + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/mod_perl_hooks.pm ${DESTDIR}/${INSTALLSITEARCH}/mod_perl_hooks.pm + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/blib/lib/mod_perl_hooks.pm.PL ${DESTDIR}/${INSTALLSITEARCH}/mod_perl_hooks.pm.PL + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/mod_perl_method_handlers.pod ${DESTDIR}/${INSTALLSITEARCH}/mod_perl_method_handlers.pod + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/mod_perl_traps.pod ${DESTDIR}/${INSTALLSITEARCH}/mod_perl_traps.pod + ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 444 mod_perl/mod_perl_tuning.pod ${DESTDIR}/${INSTALLSITEARCH}/mod_perl_tuning.pod .if ${.OBJDIR} == ${.CURDIR} clean: prereq cleanman diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/.gdbinit ./usr.sbin/httpd/mod_perl/.gdbinit --- ../src.danvfs/usr.sbin/httpd/mod_perl/.gdbinit Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/.gdbinit Sun Jun 1 18:04:27 2003 @@ -0,0 +1,193 @@ +#some handy debugging macros, hopefully you'll never need them +#some don't quite work, like dump_hv and hv_fetch, +#where's the bloody manpage for .gdbinit syntax? + +define thttpd + run -X -f `pwd`/t/conf/httpd.conf -d `pwd`/t +# set $sv = perl_eval_pv("$Apache::ErrLog = '/tmp/mod_perl_error_log'",1) +end + +define httpd + run -X -d `pwd` + set $sv = perl_eval_pv("$Apache::ErrLog = Apache->server_root_relative('logs/error_log')", 1) + #printf "error_log = %s\n", ((XPV*) ($sv)->sv_any )->xpv_pv +end + +define STpvx + print ((XPV*) (PL_stack_base [ax + ($arg0)] )->sv_any )->xpv_pv +end + +define TOPs + print ((XPV*) (**sp)->sv_any )->xpv_pv +end + +define curstash + print ((XPVHV*) (PL_curstash)->sv_any)->xhv_name +end + +define defstash + print ((XPVHV*) (PL_defstash)->sv_any)->xhv_name +end + +define curinfo + printf "%d:%s\n", PL_curcop->cop_line, \ + ((XPV*)(*(XPVGV*)PL_curcop->cop_filegv->sv_any)\ + ->xgv_gp->gp_sv->sv_any)->xpv_pv +end + +define SvPVX +print ((XPV*) ($arg0)->sv_any )->xpv_pv +end + +define SvCUR + print ((XPV*) ($arg0)->sv_any )->xpv_cur +end + +define SvLEN + print ((XPV*) ($arg0)->sv_any )->xpv_len +end + +define SvEND + print (((XPV*) ($arg0)->sv_any )->xpv_pv + ((XPV*)($arg0)->sv_any )->xpv_cur) - 1 +end + +define SvSTASH + print ((XPVHV*)((XPVMG*)($arg0)->sv_any )->xmg_stash)->sv_any->xhv_name +end + +define SvTAINTED + print ((($arg0)->sv_flags & (0x00002000 |0x00004000 |0x00008000 )) && Perl_sv_tainted ($arg0)) +end + +define SvTRUE + print ( !$arg0 ? 0 : (($arg0)->sv_flags & 0x00040000 ) ? ((PL_Xpv = (XPV*)($arg0)->sv_any ) && (*PL_Xpv ->xpv_pv > '0' || PL_Xpv ->xpv_cur > 1 || (PL_Xpv ->xpv_cur && *PL_Xpv ->xpv_pv != '0')) ? 1 : 0) : (($arg0)->sv_flags & 0x00010000 ) ? ((XPVIV*) ($arg0)->sv_any )->xiv_iv != 0 : (($arg0)->sv_flags & 0x00020000 ) ? ((XPVNV*)($arg0)->sv_any )->xnv_nv != 0.0 : Perl_sv_2bool ($arg0) ) +end + +define GvHV + set $hv = (((((XPVGV*)($arg0)->sv_any ) ->xgv_gp) )->gp_hv) +end + +define GvSV + print ((XPV*) ((((XPVGV*)($arg0)->sv_any ) ->xgv_gp) ->gp_sv )->sv_any )->xpv_pv +end + +define GvNAME + print (((XPVGV*)($arg0)->sv_any ) ->xgv_name) +end + +define GvFILEGV + print ((XPV*) ((((XPVGV*)$arg0->filegv)->xgv_gp)->gp_sv)->sv_any)->xpv_pv +end + +define CvNAME + print ((XPVGV*)(((XPVCV*)($arg0)->sv_any)->xcv_gv)->sv_any)->xgv_name +end + +define CvSTASH + print ((XPVHV*)(((XPVGV*)(((XPVCV*)($arg0)->sv_any)->xcv_gv)->sv_any)->xgv_stash)->sv_any)->xhv_name +end + +define CvDEPTH + print ((XPVCV*)($arg0)->sv_any )->xcv_depth +end + +define CvFILEGV + print ((XPV*) ((((XPVGV*)((XPVCV*)($arg0)->sv_any )->xcv_filegv)->xgv_gp)->gp_sv)->sv_any)->xpv_pv +end + +define SVOPpvx + print ((XPV*) ( ((SVOP*)$arg0)->op_sv)->sv_any )->xpv_pv +end + +define HvNAME + print ((XPVHV*)$arg0->sv_any)->xhv_name +end + +define HvKEYS + print ((XPVHV*) ($arg0)->sv_any)->xhv_keys +end + +define AvFILL + print ((XPVAV*) ($arg0)->sv_any)->xav_fill +end + +define dumpav + set $n = ((XPVAV*) ($arg0)->sv_any)->xav_fill + set $i = 0 + while $i <= $n + set $sv = *Perl_av_fetch($arg0, $i, 0) + printf "[%u] -> `%s'\n", $i, ((XPV*) ($sv)->sv_any )->xpv_pv + set $i = $i + 1 + end +end + +define dumphv + set $n = ((XPVHV*) ($arg0)->sv_any)->xhv_keys + set $i = 0 + set $key = 0 + set $klen = 0 + Perl_hv_iterinit($arg0) + while $i <= $n + set $sv = Perl_hv_iternextsv($arg0, &$key, &$klen) + printf "%s = `%s'\n", $key, ((XPV*) ($sv)->sv_any )->xpv_pv + set $i = $i + 1 + end +end + +define hvfetch + set $klen = strlen($arg1) + set $sv = *Perl_hv_fetch($arg0, $arg1, $klen, 0) + printf "%s = `%s'\n", $arg1, ((XPV*) ($sv)->sv_any )->xpv_pv +end + +define hvINCval + set $hv = (((((XPVGV*)(PL_incgv)->sv_any)->xgv_gp))->gp_hv) + set $klen = strlen($arg0) + set $sv = *Perl_hv_fetch($hv, $arg0, $klen, 0) + printf "%s = `%s'\n", $arg0, ((XPV*) ($sv)->sv_any )->xpv_pv +end + +define dumpany + set $sv = Perl_newSVpv("use Data::Dumper; Dumper \\",0) + set $void = Perl_sv_catpv($sv, $arg0) + set $dump = perl_eval_pv(((XPV*) ($sv)->sv_any )->xpv_pv, 1) + printf "%s = `%s'\n", $arg0, ((XPV*) ($dump)->sv_any )->xpv_pv +end + +define dumpanyrv + set $rv = Perl_newRV((SV*)$arg0) + set $rvpv = perl_get_sv("main::DumpAnyRv", 1) + set $void = Perl_sv_setsv($rvpv, $rv) + set $sv = perl_eval_pv("use Data::Dumper; Dumper $::DumpAnyRv",1) + printf "`%s'\n", ((XPV*) ($sv)->sv_any )->xpv_pv +end + +define svpeek + set $pv = Perl_sv_peek((SV*)$arg0) + printf "%s\n", $pv +end + +define caller + set $sv = perl_eval_pv("scalar caller", 1) + printf "caller = %s\n", ((XPV*) ($sv)->sv_any )->xpv_pv +end + +define cluck + set $sv = perl_eval_pv("Carp::cluck(); `tail '$Apache::ErrLog'`", 1) + printf "%s\n", ((XPV*) ($sv)->sv_any )->xpv_pv +end + +define longmess + set $sv = perl_eval_pv("Carp::longmess()", 1) + printf "%s\n", ((XPV*) ($sv)->sv_any )->xpv_pv +end + +define shortmess + set $sv = perl_eval_pv("Carp::shortmess()", 1) + printf "%s\n", ((XPV*) ($sv)->sv_any )->xpv_pv +end + +define perl_get_sv + set $sv = perl_get_sv($arg0, 0) + printf "%s\n", $sv ? ((XPV*) ((SV*)$sv)->sv_any)->xpv_pv : "undef" +end diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Apache/Apache.pm ./usr.sbin/httpd/mod_perl/Apache/Apache.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Apache/Apache.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Apache/Apache.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,1237 @@ +package Apache; + +use strict; +use mod_perl 1.17_01; +use Exporter (); +use Apache::Constants qw(OK DECLINED); +use Apache::Connection (); +use Apache::Server (); + +eval { require Apache::Table; }; + +@Apache::EXPORT_OK = qw(exit warn); + +*import = \&Exporter::import; + +if (caller eq "CGI::Apache") { + #we must die here outside of httpd so CGI::Switch works + die unless $ENV{MOD_PERL}; +} + +{ + no strict; + $VERSION = "1.27"; + __PACKAGE__->mod_perl::boot($VERSION); +} + +BEGIN { + *Apache::ReadConfig:: = \%ApacheReadConfig::; +} + +sub httpd_conf { + shift; + no strict 'refs'; + #use a symbolic reference so %Apache::ReadConfig:: + #is empty at compile time + push @{"Apache::ReadConfig::PerlConfig"}, + map "$_\n", @_; +} + +sub parse_args { + my($wantarray,$string) = @_; + return unless defined $string and $string; + if(defined $wantarray and $wantarray) { + return map { Apache::unescape_url_info($_) } split /[=&;]/, $string, -1; + } + $string; +} + +sub content { + my($r) = @_; + my $ct = $r->header_in("Content-type") || ""; + return unless $ct =~ m!^application/x-www-form-urlencoded!; + my $buff; + $r->read($buff, $r->header_in("Content-length")); + return $buff unless wantarray; + parse_args(1, $buff); +} + +sub args { + my($r, $val) = @_; + my $args = @_ > 1 ? $r->query_string($val) : $r->query_string; + return $args unless wantarray; + parse_args(1, $args); +} + +*READ = \&read unless defined &READ; + +sub read { + my($r, $bufsiz, $offset) = @_[0,2,3]; + my($nrd, $buf, $total); + $nrd = $total = 0; + $buf = ""; + $_[1] = "" unless $offset; + + $r->soft_timeout("Apache->read"); + + while($bufsiz) { + $nrd = $r->read_client_block($buf, $bufsiz) || 0; + if(defined $nrd and $nrd > 0) { + $bufsiz -= $nrd; + if ($offset) { + substr($_[1], $offset) .= $buf; + #$_[1] .= $buf; + } + else { + $_[1] .= $buf; + } + $total += $nrd; + next if $bufsiz; + last; + } + else { + $_[1] = undef; + last; + } + } + $r->kill_timeout; + return $total; +} + +sub new_read { + my($r, $bufsiz) = @_[0,2]; + my($nrd, $buf, $total); + $nrd = $total = 0; + $buf = ""; + $_[1] ||= ""; + + if(my $rv = $r->setup_client_block) { + $r->log_error("Apache->read: setup_client_block returned $rv"); + die $rv; + } + + #XXX: must set r->read_length to 0 here, + #since this read() method may be called in loop + #in which case, the second time in, should_client_block() + #thinks we've already read the request body and returns 0 + $r->read_length(0); + + unless($r->should_client_block) { + my $rl = $r->read_length; + $r->log_error("Apache->read: should_client_block returned 0 (rl=$rl)"); + return 0; + } + + $r->soft_timeout("Apache->read"); + + while($bufsiz) { + $nrd = $r->get_client_block($buf, $bufsiz) || 0; + if(defined $nrd and $nrd > 0) { + $bufsiz -= $nrd; + $_[1] .= $buf; + #substr($_[1], $total, $nrd) = $buf; + $total += $nrd; + $r->reset_timeout; + next if $bufsiz; + last; + } + else { + $_[1] = undef; + last; + } + } + $r->kill_timeout; + return $total; +} + +sub GETC { my $c; shift->READ($c,1); $c; } + +#shouldn't use anyhow, but we'll be nice +sub READLINE { + my $r = shift; + my $line; + $r->read($line, $r->header_in('Content-length')); + $line; +} + +sub PRINTF { + my $r = shift; + my $fmt = shift; + $r->print(sprintf($fmt, @_)); +} +*printf = \&PRINTF; + +sub send_cgi_header { + my($r, $headers) = @_; + my $dlm = "\015?\012"; #a bit borrowed from LWP::UserAgent + my($key, $val); + local $_; + while(($_, $headers) = split /$dlm/, $headers, 2) { + #warn "hunk=`$_'\n"; + #warn "rest=`$headers'\n"; + if ($_ && /^(\S+?):\s*(.*)$/) { + ($key, $val) = ($1, $2); + last unless $key; + $r->cgi_header_out($key, $val); + } + else { + #warn "mod_perl: found header terminator\n"; + my $not_sent = 0; + if($Apache::__SendHeader) { + $not_sent = not $r->sent_header; + } + else { + $not_sent = 1; + } + if ($not_sent) { + $r->send_http_header; + $r->sent_header(-2); + } + $r->print($headers); #send rest of buffer, without stripping newlines!!! + last; + } + } +} + +1; + +__END__ + +=head1 NAME + +Apache - Perl interface to the Apache server API + +=head1 SYNOPSIS + + use Apache (); + +=head1 DESCRIPTION + +This module provides a Perl interface the Apache API. It is here +mainly for B, but may be used for other Apache modules that +wish to embed a Perl interpreter. We suggest that you also consult +the description of the Apache C API at http://www.apache.org/docs/. + +=head1 THE REQUEST OBJECT + +The request object holds all the information that the server needs to +service a request. Apache Bs will be given a reference to the +request object as parameter and may choose to update or use it in various +ways. Most of the methods described below obtain information from or +update the request object. +The perl version of the request object will be blessed into the B +package, it is really a C in disguise. + +=over 4 + +=item Apache-Erequest([$r]) + +The Apache-Erequest method will return a reference to the request object. + +Bs can obtain a reference to the request object when it +is passed to them via C<@_>. However, scripts that run under +B, for example, need a way to access the request object. +B will make a request object available to these scripts +by passing an object reference to Crequest($r)>. +If handlers use modules such as B that need to access +Crequest>, they too should do this (e.g. B). + +=item $r-Eas_string + +Returns a string representation of the request object. Mainly useful +for debugging. + +=item $r-Emain + +If the current request is a sub-request, this method returns a blessed +reference to the main request structure. If the current request is +the main request, then this method returns C. + +=item $r-Eprev + +This method returns a blessed reference to the previous (internal) request +structure or C if there is no previous request. + +=item $r-Enext + +This method returns a blessed reference to the next (internal) request +structure or C if there is no next request. + +=item $r-Elast + +This method returns a blessed reference to the last (internal) request +structure. Handy for logging modules. + +=item $r-Eis_main + +Returns true if the current request object is for the main request. +(Should give the same result as Cmain>, but will be more efficient.) + +=item $r-Eis_initial_req + +Returns true if the current request is the first internal request, +returns false if the request is a sub-request or internal redirect. + +=item $r-Eallowed($bitmask) + +Get or set the allowed methods bitmask. This allowed bitmask should be +set whenever a 405 (method not allowed) or 501 (method not implemented) +answer is returned. The bit corresponding to the method number should be +et. + + unless ($r->method_number == M_GET) { + $r->allowed($r->allowed | (1< prefix here. The C returned by the lookup +methods is blessed into the B class. This way, +C is called automatically during +CDESTROY> when the object goes out of scope. The +B class inherits all the methods from the +B class. + +=over 4 + +=item $r-Elookup_uri($uri) + + my $subr = $r->lookup_uri($uri); + my $filename = $subr->filename; + + unless(-e $filename) { + warn "can't stat $filename!\n"; + } + +=item $r-Elookup_file($filename) + + my $subr = $r->lookup_file($filename); + +=item $subr-Erun + + if($subr->run != OK) { + $subr->log_error("something went wrong!"); + } + +=back + +=head1 CLIENT REQUEST PARAMETERS + +In this section we will take a look at various methods that can be used to +retrieve the request parameters sent from the client. +In the following examples, B<$r> is a request object blessed into the +B class, obtained by the first parameter passed to a handler subroutine +or Irequest> + +=over 4 + +=item $r-Emethod( [$meth] ) + +The $r-Emethod method will return the request method. It will be a +string such as "GET", "HEAD" or "POST". +Passing an argument will set the method, mainly used for internal redirects. + +=item $r-Emethod_number( [$num] ) + +The $r-Emethod_number method will return the request method number. +The method numbers are defined by the M_GET, M_POST,... constants +available from the B module. Passing an argument +will set the method_number, mainly used for internal redirects and +testing authorization restriction masks. + +=item $r-Ebytes_sent + +The number of bytes sent to the client, handy for logging, etc. + +=item $r-Ethe_request + +The request line sent by the client, handy for logging, etc. + +=item $r-Eproxyreq + +Returns true if the request is proxy http. +Mainly used during the filename translation stage of the request, +which may be handled by a C. + +=item $r-Eheader_only + +Returns true if the client is asking for headers only, +e.g. if the request method was B. + +=item $r-Eprotocol + +The $r-Eprotocol method will return a string identifying the protocol +that the client speaks. Typical values will be "HTTP/1.0" or +"HTTP/1.1". + +=item $r-Ehostname + +Returns the server host name, as set by full URI or Host: header. + +=item $r-Erequest_time + +Returns the time that the request was made. The time is the local unix +time in seconds since the epoch. + +=item $r-Euri( [$uri] ) + +The $r-Euri method will return the requested URI minus optional query +string, optionally changing it with the first argument. + +=item $r-Efilename( [$filename] ) + +The $r-Efilename method will return the result of the I +filename> translation, optionally changing it with the first argument +if you happen to be doing the translation. + +=item $r-Elocation + +The $r-Elocation method will return the path of the +ELocationE section from which the current C is +being called. + +=item $r-Epath_info( [$path_info] ) + +The $r-Epath_info method will return what is left in the path after the +I filename> translation, optionally changing it with the first +argument if you happen to be doing the translation. + +=item $r-Eargs( [$query_string] ) + +The $r-Eargs method will return the contents of the URI I. When called in a scalar context, the entire string is +returned. When called in a list context, a list of parsed I =E +I pairs are returned, i.e. it can be used like this: + + $query = $r->args; + %in = $r->args; + +$r-Eargs can also be used to set the I. This can be useful +when redirecting a POST request. + +=item $r-Eheaders_in + +The $r-Eheaders_in method will return a %hash of client request +headers. This can be used to initialize a perl hash, or one could use +the $r-Eheader_in() method (described below) to retrieve a specific +header value directly. + +Will return a I reference blessed into the I +class when called in a scalar context with no "key" argument. This +requires I. + +=item $r-Eheader_in( $header_name, [$value] ) + +Return the value of a client header. Can be used like this: + + $ct = $r->header_in("Content-type"); + $r->header_in($key, $val); #set the value of header '$key' + +=item $r-Econtent + +The $r-Econtent method will return the entity body read from the +client, but only if the request content type is +C. +When called in a scalar context, the entire string is +returned. When called in a list context, a list of parsed I =E +I pairs are returned. *NOTE*: you can only ask for this once, +as the entire body is read from the client. + +=item $r-Eread($buf, $bytes_to_read, [$offset]) + +This method is used to read data from the client, +looping until it gets all of C<$bytes_to_read> or a timeout happens. + +An offset may be specified to place the read data at some other place +than the beginning of the string. + +In addition, this method sets a timeout before reading with +C<$r-Esoft_timeout>. + +=item $r-Eget_remote_host + +Lookup the client's DNS hostname. If the configuration directive +B is set to off, this returns the dotted decimal +representation of the client's IP address instead. Might return +I if the hostname is not known. + +=item $r-Eget_remote_logname + +Lookup the remote user's system name. Might return I if the +remote system is not running an RFC 1413 server or if the configuration +directive B is not turned on. + +=back + +More information about the client can be obtained from the +B object, as described below. + +=over 4 + +=item $c = $r-Econnection + +The $r-Econnection method will return a reference to the request +connection object (blessed into the B package). +This is really a C in disguise. The following methods can +be used on the connection object: + +=over 4 + +=item $c-Eremote_host + +If the configuration directive B is set to on: then +the first time C<$r-Eget_remote_host> is called the server does a DNS +lookup to get the remote client's host name. The result is cached in +C<$c-Eremote_host> then returned. If the server was unable to resolve +the remote client's host name this will be set to "". Subsequent calls +to C<$r-Eget_remote_host> return this cached value. + +If the configuration directive B is set to off: calls +to C<$r-Eget_remote_host> return a string that contains the dotted +decimal representation of the remote client's IP address. However this +string is not cached, and C<$c-Eremote_host> is undefined. So, it's +best to to call C<$r-Eget_remote_host> instead of directly accessing +this variable. + +=item $c-Eremote_ip + +The dotted decimal representation of the remote client's IP address. +This is set by the server when the connection record is created so +is always defined. + +You can also set this value by providing an argument to it. This is +helpful if your server is behind a squid accelerator proxy which adds +a X-Forwarded-For header. + +=item $c-Elocal_addr + +A packed SOCKADDR_IN in the same format as returned by +L, containing the port and address on the +local host that the remote client is connected to. This is set by +the server when the connection record is created so it is always +defined. + +=item $c-Eremote_addr + +A packed SOCKADDR_IN in the same format as returned by +L, containing the port and address on the +remote host that the server is connected to. This is set by the +server when the connection record is created so it is always defined. + +Among other things, this can be used, together with C<$c-Elocal_addr>, to +perform RFC1413 ident lookups on the remote client even when the +configuration directive B is turned off. + +Can be used like: + + use Net::Ident qw (lookupFromInAddr); + ... + my $remoteuser = lookupFromInAddr ($c->local_addr, + $c->remote_addr, 2); + +Note that the lookupFromInAddr interface does not currently exist in +the B module, but the author is planning on adding it +soon. + +=item $c-Eremote_logname + +If the configuration directive B is set to on: then the +first time C<$r-Eget_remote_logname> is called the server does an RFC +1413 (ident) lookup to get the remote users system name. Generally for +UNI* systems this is their login. The result is cached in C<$c-Eremote_logname> +then returned. Subsequent calls to C<$r-Eget_remote_host> return the +cached value. + +If the configuration directive B is set to off: then +C<$r-Eget_remote_logname> does nothing and C<$c-Eremote_logname> is +always undefined. + +=item $c-Euser( [$user] ) + +If an authentication check was successful, the authentication handler +caches the user name here. Sets the user name to the optional first +argument. + +=item $c-Eauth_type + +Returns the authentication scheme that successfully authenticate +C<$c-Euser>, if any. + +=item $c-Eaborted + +Returns true if the client stopped talking to us. + +=item $c-Efileno( [$direction] ) + +Returns the client file descriptor. If $direction is 0, the input fd +is returned. If $direction is not null or ommitted, the output fd is +returned. + +This can be used to detect client disconnect without doing any I/O, +e.g. using IO::Select. + +=back + +=back + +=head1 SERVER CONFIGURATION INFORMATION + +The following methods are used to obtain information from server +configuration and access control files. + +=over 4 + +=item $r-Edir_config( $key ) + +Returns the value of a per-directory variable specified by the +C directive. + + # + # PerlSetVar Key Value + # + + my $val = $r->dir_config('Key'); + +Keys are case-insensitive. + +Will return a I reference blessed into the +I class when called in a scalar context with no +"key" argument. See I. + + +=item $r-Edir_config-Eget( $key ) + +Returns the value of a per-directory array variable specified by the +C directive. + + # + # PerlAddVar Key Value1 + # PerlAddVar Key Value2 + # + + my @val = $r->dir_config->get('Key'); + +Alternatively in your code you can extend the setting with: + + $r->dir_config->add(Key => 'Value3'); + +Keys are case-insensitive. + +Will return a I reference blessed into the +I class when called in a scalar context with no +"key" argument. See I. + +=item $r-Erequires + +Returns an array reference of hash references, containing information +related to the B directive. This is normally used for access +control, see L for an example. + +=item $r-Eauth_type + +Returns a reference to the current value of the per directory +configuration directive B. Normally this would be set to +C to use the basic authentication scheme defined in RFC 1945, +I. However, you could set to +something else and implement your own authentication scheme. + +=item $r-Eauth_name + +Returns a reference to the current value of the per directory +configuration directive B. The AuthName directive creates +protection realm within the server document space. To quote RFC 1945 +"These realms allow the protected resources on a server to be +partitioned into a set of protection spaces, each with its own +authentication scheme and/or authorization database." The client uses +the root URL of the server to determine which authentication +credentials to send with each HTTP request. These credentials are +tagged with the name of the authentication realm that created them. +Then during the authentication stage the server uses the current +authentication realm, from C<$r-Eauth_name>, to determine which set of +credentials to authenticate. + +=item $r-Edocument_root ( [$docroot] ) + +When called with no argument, returns a reference to the current value +of the per server configuration directive B. To quote the +Apache server documentation, "Unless matched by a directive like Alias, +the server appends the path from the requested URL to the document root +to make the path to the document." This same value is passed to CGI +scripts in the C environment variable. + +You can also set this value by providing an argument to it. The following +example dynamically sets the document root based on the request's +"Host:" header: + + sub trans_handler + { + my $r = shift; + my ($user) = ($r->header_in('Host') =~ /^[^\.]+/); + $r->document_root("/home/$user/www"); + return DECLINED; + } + + PerlTransHandler trans_handler + +=item $r-Eallow_options + +The C<$r-Eallow_options> method can be used for +checking if it is OK to run a perl script. The B +module provides the constants to check against. + + if(!($r->allow_options & OPT_EXECCGI)) { + $r->log_reason("Options ExecCGI is off in this directory", + $filename); + } + +=item $r-Eget_server_port + +Returns the port number on which the server is listening. + +=item $s = $r-Eserver + +Return a reference to the server info object (blessed into the +B package). This is really a C in +disguise. The following methods can be used on the server object: + +=item $s = Apache-Eserver + +Same as above, but only available during server startup for use in +CPerlE> sections, B or B. + +=item $s-Eserver_admin + +Returns the mail address of the person responsible for this server. + +=item $s-Eserver_hostname + +Returns the hostname used by this server. + +=item $s-Eport + +Returns the port that this servers listens too. + +=item $s-Eis_virtual + +Returns true if this is a virtual server. + +=item $s-Enames + +Returns the wild-carded names for ServerAlias servers. + +=item $s-Edir_config( $key ) + +Alias for Apache::dir_config. + +=item $s-Ewarn + +Alias for Apache::warn. + +=item $s-Elog_error + +Alias for Apache::log_error. + +=item $s-Euid + +Returns the numeric user id under which the server answers requests. +This is the value of the User directive. + +=item $s-Egid + +Returns the numeric group id under which the server answers requests. +This is the value of the Group directive. + +=item $s-Eloglevel + +Get or set the value of the current LogLevel. This method is added by +the Apache::Log module, which needs to be pulled in. + + use Apache::Log; + print "LogLevel = ", $s->loglevel; + $s->loglevel(Apache::Log::DEBUG); + +If using Perl 5.005+, the following constants are defined (but not +exported): + + Apache::Log::EMERG + Apache::Log::ALERT + Apache::Log::CRIT + Apache::Log::ERR + Apache::Log::WARNING + Apache::Log::NOTICE + Apache::Log::INFO + Apache::Log::DEBUG + +=item $r-Eget_handlers( $hook ) + +Returns a reference to a list of handlers enabled for $hook. $hook is +a string representing the phase to handle. The returned list is a list +of references to the handler subroutines. + + $list = $r->get_handlers( 'PerlHandler' ); + +=item $r-Eset_handlers( $hook, [\Ehandler, ... ] ) + +Sets the list if handlers to be called for $hook. $hook is a string +representing the phase to handle. The list of handlers is an anonymous +array of code references to the handlers to install for this request +phase. The special list C<[ \&OK ]> can be used to disable a +particular phase. + + $r->set_handlers( PerlLogHandler => [ \&myhandler1, \&myhandler2 ] ); + $r->set_handlers( PerlAuthenHandler => [ \&OK ] ); + +=item $r-Epush_handlers( $hook, \Ehandler ) + +Pushes a new handler to be called for C<$hook>. C<$hook> is a string +representing the phase to handle. The handler is a reference to a +subroutine to install for this request phase. This handler will be +called before any configured handlers. + + $r->push_handlers( PerlHandler => \&footer); + +=item $r-Ecurrent_callback + +Returns the name of the handler currently being run. This method is most +useful to PerlDispatchHandlers who wish to only take action for certain phases. + + if($r->current_callback eq "PerlLogHandler") { + $r->warn("Logging request"); + } + +=back + +=head1 SETTING UP THE RESPONSE + +The following methods are used to set up and return the response back +to the client. This typically involves setting up $r-Estatus(), the +various content attributes and optionally some additional +$r-Eheader_out() calls before calling $r-Esend_http_header() which will +actually send the headers to the client. After this a typical +application will call the $r-Eprint() method to send the response +content to the client. + +=over 4 + +=item $r-Esend_http_header( [$content_type] ) + +Send the response line and all headers to the client. +Takes an optional parameter indicating the content-type of the +response, i.e. 'text/html'. + +This method will create headers from the $r-Econtent_xxx() and +$r-Eno_cache() attributes (described below) and then append the +headers defined by $r-Eheader_out (or $r-Eerr_header_out if status +indicates an error). + +=item $r-Eget_basic_auth_pw + +If the current request is protected by Basic authentication, this +method will return OK. Otherwise, it will return a value that +ought to be propagated back to the client (typically AUTH_REQUIRED). +The second return value will be the decoded password sent by the client. + + ($ret, $sent_pw) = $r->get_basic_auth_pw; + +=item $r-Enote_basic_auth_failure + +Prior to requiring Basic authentication from the client, this method +will set the outgoing HTTP headers asking the client to authenticate +for the realm defined by the configuration directive C. + +=item $r-Ehandler( [$meth] ) + +Set the handler for a request. +Normally set by the configuration directive C. + + $r->handler( "perl-script" ); + +=item $r-Enotes( $key, [$value] ) + +Return the value of a named entry in the Apache C table, or +optionally set the value of a named entry. This table is used by Apache +modules to pass messages amongst themselves. Generally if you are +writing handlers in mod_perl you can use Perl variables for this. + + $r->notes("MY_HANDLER" => OK); + $val = $r->notes("MY_HANDLER"); + +Will return a I reference blessed into the I +class when called in a scalar context with no "key" argument. This +requires I. + +=item $r-Epnotes( $key, [$value] ) + +Like $r-Enotes, but takes any scalar as an value. + + $r->pnotes("MY_HANDLER" => [qw(one two)]); + my $val = $r->pnotes("MY_HANDLER"); + print $val->[0]; # prints "one" + +Advantage over just using a Perl variable is that $r-Epnotes gets +cleaned up after every request. + +=item $r-Esubprocess_env( $key, [$value] ) + +Return the value of a named entry in the Apache C +table, or optionally set the value of a named entry. This table is +used by mod_include. By setting some custom variables inside +a perl handler it is possible to combine perl with mod_include nicely. +If you say, e.g. in a PerlHeaderParserHandler + + $r->subprocess_env(MyLanguage => "de"); + +you can then write in your .shtml document: + + + English + + Deutsch + + Sorry + + +Will return a I reference blessed into the I +class when called in a scalar context with no "key" argument. This +requires I. + +=item $r-Econtent_type( [$newval] ) + +Get or set the content type being sent to the client. Content types +are strings like "text/plain", "text/html" or "image/gif". This +corresponds to the "Content-Type" header in the HTTP protocol. Example +of usage is: + + $previous_type = $r->content_type; + $r->content_type("text/plain"); + +=item $r-Econtent_encoding( [$newval] ) + +Get or set the content encoding. Content encodings are string like +"gzip" or "compress". This correspond to the "Content-Encoding" +header in the HTTP protocol. + +=item $r-Econtent_languages( [$array_ref] ) + +Get or set the content languages. The content language corresponds to the +"Content-Language" HTTP header and is an array reference containing strings +such as "en" or "no". + +=item $r-Estatus( $integer ) + +Get or set the reply status for the client request. The +B module provide mnemonic names for the status codes. + +=item $r-Estatus_line( $string ) + +Get or set the response status line. The status line is a string like +"200 Document follows" and it will take precedence over the value specified +using the $r-Estatus() described above. + + +=item $r-Eheaders_out + +The $r-Eheaders_out method will return a %hash of server response +headers. This can be used to initialize a perl hash, or one could use +the $r-Eheader_out() method (described below) to retrieve or set a specific +header value directly. + +Will return a I reference blessed into the I +class when called in a scalar context with no "key" argument. This +requires I. + +=item $r-Eheader_out( $header, $value ) + +Change the value of a response header, or create a new one. You +should not define any "Content-XXX" headers by calling this method, +because these headers use their own specific methods. Example of use: + + $r->header_out("WWW-Authenticate" => "Basic"); + $val = $r->header_out($key); + +=item $r-Eerr_headers_out + +The $r-Eerr_headers_out method will return a %hash of server response +headers. This can be used to initialize a perl hash, or one could use +the $r-Eerr_header_out() method (described below) to retrieve or set a specific +header value directly. + +The difference between headers_out and err_headers_out is that the +latter are printed even on error, and persist across internal redirects +(so the headers printed for ErrorDocument handlers will have them). + +Will return a I reference blessed into the I +class when called in a scalar context with no "key" argument. This +requires I. + +=item $r-Eerr_header_out( $header, [$value] ) + +Change the value of an error response header, or create a new one. +These headers are used if the status indicates an error. + + $r->err_header_out("Warning" => "Bad luck"); + $val = $r->err_header_out($key); + +=item $r-Eno_cache( $boolean ) + +This is a flag that indicates that the data being returned is volatile +and the client should be told not to cache it. C<$r-Eno_cache(1)> +adds the headers "Pragma: no-cache" and "Cache-control: no-cache" to +the reponse, therefore it must be called before C<$r-Esend_http_header>. + +=item $r-Eprint( @list ) + +This method sends data to the client with C<$r-Ewrite_client>, but first +sets a timeout before sending with C<$r-Esoft_timeout>. This method is +called instead of CORE::print when you use print() in your mod_perl programs. + +This method treats scalar references specially. If an item in @list is a +scalar reference, it will be dereferenced before printing. This is a +performance optimization which prevents unneeded copying of large strings, +and it is subtly different from Perl's standard print() behavior. + +Example: + + $foo = \"bar"; print($foo); + +The result is "bar", not the "SCALAR(0xDEADBEEF)" you might have expected. If +you really want the reference to be printed out, force it into a scalar +context by using C. + +=item $r-Esend_fd( $filehandle ) + +Send the contents of a file to the client. Can for instance be used +like this: + + open(FILE, $r->filename) || return 404; + $r->send_fd(FILE); + close(FILE); + +=item $r-Einternal_redirect( $newplace ) + +Redirect to a location in the server namespace without +telling the client. For instance: + + $r->internal_redirect("/home/sweet/home.html"); + +=item $r-Einternal_redirect_handler( $newplace ) + +Same as I, but the I from C<$r> is preserved. + +=item $r-Ecustom_response($code, $uri) + +This method provides a hook into the B mechanism, +allowing you to configure a custom response for a given response +code at request-time. + +Example: + + use Apache::Constants ':common'; + + sub handler { + my($r) = @_; + + if($things_are_ok) { + return OK; + } + + #uri> + #ErrorDocument 401 /error.html + # + + $r->custom_response(AUTH_REQUIRED, "/error.html"); + + #can send a string too + #uri> + #ErrorDocument 401 "sorry, go away" + # + + #$r->custom_response(AUTH_REQUIRED, "sorry, go away"); + + return AUTH_REQUIRED; + } + +=back + +=head1 SERVER CORE FUNCTIONS + +=over 4 + +=item $r-Esoft_timeout($message) + +=item $r-Ehard_timeout($message) + +=item $r-Ekill_timeout + +=item $r-Ereset_timeout + +(Documentation borrowed from http_main.h) + +There are two functions which modules can call to trigger a timeout +(with the per-virtual-server timeout duration); these are hard_timeout +and soft_timeout. + +The difference between the two is what happens when the timeout +expires (or earlier than that, if the client connection aborts) --- +a soft_timeout just puts the connection to the client in an +"aborted" state, which will cause http_protocol.c to stop trying to +talk to the client, but otherwise allows the code to continue normally. +hard_timeout(), by contrast, logs the request, and then aborts it +completely --- longjmp()ing out to the accept() loop in http_main. +Any resources tied into the request resource pool will be cleaned up; +everything that is not will leak. + +soft_timeout() is recommended as a general rule, because it gives your +code a chance to clean up. However, hard_timeout() may be the most +convenient way of dealing with timeouts waiting for some external +resource other than the client, if you can live with the restrictions. + +When a hard timeout is in scope, critical sections can be guarded +with block_alarms() and unblock_alarms() --- these are declared in +alloc.c because they are most often used in conjunction with +routines to allocate something or other, to make sure that the +cleanup does get registered before any alarm is allowed to happen +which might require it to be cleaned up; they * are, however, +implemented in http_main.c. + +kill_timeout() will disarm either variety of timeout. + +reset_timeout() resets the timeout in progress. + +=item $r-Epost_connection($code_ref) + +=item $r-Eregister_cleanup($code_ref) + +Register a cleanup function which is called just before $r-Epool is +destroyed. + + $r->register_cleanup(sub { + my $r = shift; + warn "registered cleanup called for ", $r->uri, "\n"; + }); + +Cleanup functions registered in the parent process (before forking) +will run once when the server is shut down: + + #PerlRequire startup.pl + warn "parent pid is $$\n"; + Apache->server->register_cleanup(sub { warn "server cleanup in $$\n"}); + +The I method is simply an alias for I, +as this method may be used to run code after the client connection is closed, +which may not be a I. + +=back + +=head1 CGI SUPPORT + +We also provide some methods that make it easier to support the CGI +type of interface. + +=over 4 + +=item $r-Esend_cgi_header() + +Take action on certain headers including I, I and +I just as mod_cgi does, then calls +$r-Esend_http_header(). Example of use: + + $r->send_cgi_header(<log_reason($message, $file) + +The request failed, why?? Write a message to the server errorlog. + + $r->log_reason("Because I felt like it", $r->filename); + +=item $r-Elog_error($message) + +Uh, oh. Write a message to the server errorlog. + + $r->log_error("Some text that goes in the error_log"); + +=item $r-Ewarn($message) + +For pre-1.3 versions of apache, this is just an alias for +C. With 1.3+ versions of apache, this message will only be +send to the error_log if B is set to B or higher. + +=back + +=head1 UTILITY FUNCTIONS + +=over 4 + +=item Apache::unescape_url($string) + +Handy function for unescapes. Use this one for filenames/paths. +Use unescape_url_info for the result of submitted form data. + +=item Apache::unescape_url_info($string) + +Handy function for unescapes submitted form data. +In opposite to unescape_url it translates the plus sign to space. + +=item Apache::perl_hook($hook) + +Returns true if the specified callback hook is enabled: + + for (qw(Access Authen Authz ChildInit Cleanup Fixup + HeaderParser Init Log Trans Type)) + { + print "$_ hook enabled\n" if Apache::perl_hook($_); + } + +=back + +=head1 GLOBAL VARIABLES + +=over 4 + +=item $Apache::Server::Starting + +Set to true when the server is starting. + +=item $Apache::Server::ReStarting + +Set to true when the server is starting. + +=back + +=head1 SEE ALSO + +perl(1), +Apache::Constants(3), +Apache::Registry(3), +Apache::Debug(3), +Apache::Options(3), +CGI::Apache(3) + +Apache C API notes at C + +=head1 AUTHORS + +Perl interface to the Apache C API written by Doug MacEachern +with contributions from Gisle Aas, Andreas Koenig, Eric Bartley, +Rob Hartill, Gerald Richter, Salvador Ortiz and others. + +=cut + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Apache/Makefile.PL ./usr.sbin/httpd/mod_perl/Apache/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Apache/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Apache/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,13 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + NAME => "Apache", + VERSION_FROM => "Apache.pm", + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Apache/typemap ./usr.sbin/httpd/mod_perl/Apache/typemap --- ../src.danvfs/usr.sbin/httpd/mod_perl/Apache/typemap Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Apache/typemap Sun Jun 1 18:04:27 2003 @@ -0,0 +1,143 @@ +TYPEMAP +Apache T_APACHEOBJ +Apache::CmdParms T_PTROBJ +Apache::SubRequest T_PTROBJ +Apache::Connection T_PTROBJ +Apache::Server T_PTROBJ +Apache::ModuleConfig T_PTROBJ +Apache::Module T_PTROBJ +Apache::Handler T_PTROBJ +Apache::Command T_PTROBJ +Apache::Table T_TABLEOBJ +Apache::table T_PTROBJ +pid_t T_IV +uid_t T_IV +gid_t T_IV +Apache::Scoreboard O_HvRV +Apache::URI T_PTROBJ + +# "perlobject.map" Dean Roehrich, version 19960302 +# +# TYPEMAPs +# +# HV * -> unblessed Perl HV object. +# AV * -> unblessed Perl AV object. +# +# INPUT/OUTPUT maps +# +# O_* -> opaque blessed objects +# T_* -> opaque blessed or unblessed objects +# +# O_OBJECT -> link an opaque C or C++ object to a blessed Perl object. +# T_OBJECT -> link an opaque C or C++ object to an unblessed Perl object. +# O_HvRV -> a blessed Perl HV object. +# T_HvRV -> an unblessed Perl HV object. +# O_AvRV -> a blessed Perl AV object. +# T_AvRV -> an unblessed Perl AV object. + +#TYPEMAP + +HV * T_HvRV +AV * T_AvRV +const char * T_PV + +###################################################################### +OUTPUT + +T_APACHEOBJ + sv_setref_pv($arg, \"${ntype}\", (void*)$var); + +T_TABLEOBJ + sv_setref_pv($arg, \"${ntype}\", (void*)$var); + +T_PV_CONST + SvREADONLY_on((SV*)$arg); + sv_setpv((SV*)$arg, (char *)$var); + +# The Perl object is blessed into 'CLASS', which should be a +# char* having the name of the package for the blessing. +O_OBJECT + sv_setref_pv( $arg, CLASS, (void*)$var ); + +T_OBJECT + sv_setref_pv( $arg, Nullch, (void*)$var ); + +# Cannot use sv_setref_pv() because that will destroy +# the HV-ness of the object. Remember that newRV() will increment +# the refcount. +O_HvRV + $arg = sv_bless( newRV((SV*)$var), gv_stashpv(CLASS,1) ); + +T_HvRV + $arg = newRV((SV*)$var); + +# Cannot use sv_setref_pv() because that will destroy +# the AV-ness of the object. Remember that newRV() will increment +# the refcount. +O_AvRV + $arg = sv_bless( newRV((SV*)$var), gv_stashpv(CLASS,1) ); + +T_AvRV + $arg = newRV((SV*)$var); + + +###################################################################### +INPUT + +T_APACHEOBJ + r = sv2request_rec($arg, \"$ntype\", cv) + +T_TABLEOBJ + $var = ($type)hvrv2table($arg) + +T_PV_CONST + $var = ($type)SvPV($arg,na) + +O_OBJECT + if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) + $var = ($type)SvIV((SV*)SvRV( $arg )); + else{ + warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" ); + XSRETURN_UNDEF; + } + +T_OBJECT + if( SvROK($arg) ) + $var = ($type)SvIV((SV*)SvRV( $arg )); + else{ + warn( \"${Package}::$func_name() -- $var is not an SV reference\" ); + XSRETURN_UNDEF; + } + +O_HvRV + if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVHV) ) + $var = (HV*)SvRV( $arg ); + else { + warn( \"${Package}::$func_name() -- $var is not a blessed HV reference\" ); + XSRETURN_UNDEF; + } + +T_HvRV + if( SvROK($arg) && (SvTYPE(SvRV($arg)) == SVt_PVHV) ) + $var = (HV*)SvRV( $arg ); + else { + warn( \"${Package}::$func_name() -- $var is not an HV reference\" ); + XSRETURN_UNDEF; + } + +O_AvRV + if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVAV) ) + $var = (AV*)SvRV( $arg ); + else { + warn( \"${Package}::$func_name() -- $var is not a blessed AV reference\" ); + XSRETURN_UNDEF; + } + +T_AvRV + if( SvROK($arg) && (SvTYPE(SvRV($arg)) == SVt_PVAV) ) + $var = (AV*)SvRV( $arg ); + else { + warn( \"${Package}::$func_name() -- $var is not an AV reference\" ); + XSRETURN_UNDEF; + } + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/CREDITS ./usr.sbin/httpd/mod_perl/CREDITS --- ../src.danvfs/usr.sbin/httpd/mod_perl/CREDITS Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/CREDITS Sun Jun 1 18:04:27 2003 @@ -0,0 +1,343 @@ +=head1 NAME + +CREDITS - The many mod_perl contributors + +=head1 DESCRIPTION + +While Doug MacEachern is behind the majority of mod_perl's design, +code and documentation, he and mod_perl never would have made it this +far without the help from everyone in the mod_perl community. His +heartfelt thanks goes out to all of you! + +There are thousands of people who have contributed to what mod_perl is +today. This file is here to recognize the tremendous efforts of the +major contributors to the mod_perl effort. + +This file is generated by a Perl script which sorts by name. + +=head1 MAJOR CONTRIBUTORS + +=over 4 + +=item Andreas Koenig (andreas.koenig@franz.ww.tu-berlin.de) + +For *lots* of bug spotting, fixing and patching since the early days. +Andreas introduced the Apache::Registry that we all know and love. +He put a great deal of time and effort into CGI.pm overhaul efforts +(aka CGI::XA & CGI::Switch). +Various contributions to the Apache/Perl API. +PAUSE efforts beyond the call of "duty". +Apache::Stage, Apache::GzipChain and Apache::UploadSrv modules on CPAN. +Andreas was the first to run mod_perl on a production site, the Perl +Authors Upload Server, aka PAUSE. + +=item Andrew Ford (A.Ford@ford-mason.co.uk) + +Andrew has made contributions to the Apache::FakeRequest module and is +the author of the mod_perl refcard. + +=item Ask Bjorn Hansen (ask@netcetera.dk) + +Author of the Apache::DBILogger and Apache::UserTrack modules, +mod_perl_handlers.pod along with plenty of help testing cvs snapshots, +documentation improvements, Apache::StatINC hacking and assisting with +the perl.apache.org site. + +=item Brian Behlendorf (brian@apache.org) + +Brian provides the bandwidth for perl.apache.org along with the +mailing list and cvs repository. + +=item Brian Mosley (ix@maz.org) + +Brian added Solaris support to Apache::SizeLimit and maintains +Apache::SizeLimit in the distribution. He is always one of the first +to try out new features, before they are even documented! + +=item Doug Bagley (doug@dejanews.com) + +Doug Bagley has pinpointed some of the nastiest mod_perl bugs while +claiming to know nothing about xs. He's also made improvements to the +Apache::SIG module along with writing the valuable Apache::SizeLimit +module. + +=item Edmund Mergl (E.Mergl@bawue.de) + +Edmund revolutionized database connectivity with his Apache::DBI +module for persistent connections via DBI, providing a tremendous +performance boost for database intensive apps. He's also written the +popular Apache::AuthenDBI and Apache::AuthzDBI packages for +authentication and authorizing against databases via DBI. + +=item Eric Cholet (cholet@logilune.com) + +Author of Apache::EmbperlChain and Apache::RefererBlock. +Involved with many heroic debugging sessions. + +=item Eric Bartley (bartley@pdn.cc.purdue.edu) + +Eric had a big hand in implementing and testing method handlers. +He also contributed to some of the Apache/Perl API, along with +making sense of some AIX mysteries for us. +And, his Apache::AuthCookie module is an inspiration to us all. + +=item Frank Cringle (fdc@cliwe.ping.de) + +Frank is the author and maintainer of the mod_perl FAQ. + +=item Gerald Richter (richter@ecos.de) + +Gerald has helped us with various bug spotting and fixing over the +years. His HTML::Embperl module, specially designed to run under +mod_perl, has saved many lives. + +=item Gisle Aas (aas@sn.no) + +Gisle wrote an early "proof-of-concept" mod_perl.c and perl_glue.xs +March 25, 1996 to be exact. While next to none of that code is +present in the current mod_perl source, as the embedded model and +XS <-> Apache API interface were changed, it was an important +insipirational kick start to what mod_perl has become today. + +Gisle has also contributed to mod_perl's Apache::Constants module, +along with API enhancements and documentation. + +=item Jan Pazdziora (adelton@fi.muni.cz) + +Jan is the author of the Apache-OutputChain package. + +=item Jason Bodnar (jason@cimedia.com) + +Jason's mod_perl hacking has inspired a good chunk of the Apache/Perl +API, some of which you'll see in his Apache::CustomDBILogger and +Apache::AuthenCache modules. + +=item Jeffrey Baker (jeff@godzilla.tamu.edu) + +Maintainer of the mod_perl NT binary distribution and author of the +Apache::Session module. + +=item John D. Groenveld (jdg117@elvis.arl.psu.edu) + +John contributed the Apache::DBILogin, Apache::AuthenURL and +Apache::PHLogin modules along with proving Oracle +tips and tricks over the years. + +=item Joshua Chamas (chamas@alumni.stanford.org) + +Author of the Apache::ASP module. + +=item Ken Williams (ken@forum.swarthmore.edu) + +Author of the Apache::Taco, Apache::SSI and Apache::Filter modules. + +=item Lincoln Stein (lstein@cshl.org) + +Everybody knows Lincoln gave us the must-have CGI.pm module, he's put +forth considerable effort porting and optimizing it for mod_perl. +Lincoln also wrote the original Apache::Request module, a CGI.pm-like +module on top of the Apache API. Lincoln's code and prose in the +upcoming mod_perl book is a major step towards world peace. + +=item Mark Imbriaco (perlhacker@earthlink.net) + +For setting up the original mod_perl mail list and administration of +that list for two years. +Mark was also the first person besides Doug to write an Apache::* module, +the first version of Apache::ePerl. +He was also the first person to build and run mod_perl under Windows 95! + +=item Michael Parker (parker@austx.tandem.com) + +Michael gave us Apache::AuthenSMB. + +=item Mike Fletcher (fletch@phydeaux.org) + +Fletch gave us Apache::Mmap. + +=item Patrick Kane (modus@pr.es.to) + +Patrick wrote the original mod_perl FAQ. + +=item Peter Tillemans (pti@pandora.be) + +Peter helped bring mod_perl upto win32 speed with various patches +including support for 'make test'. He also maintains the Windows95 +binary distribution of mod_perl. + +=item Ralf S. Engelschall (rse@engelschall.com) + +Ralf, aka "Dr. Cosmetics", has greatly improved the mod_perl +configure/build/install process by implementing APACI, DSO and APXS +support, along with various documentation enhancements. He has also +written the Apache::ePerl module. + +=item Rob Hartill (robh@imdb.com) + +Rob was the second to run mod_perl in a production enviroment, and +perhaps the best known mod_perl site, the Internet Movie DataBase. +He's also provide various bug fixes, enhancements and mail list support +since the early days of mod_perl. +Always one step ahead testing mod_perl against Apache cvs snapshots. +It was Rob's kicking that made the mod_perl CVS tree come to be. + +=item Salvador Ortiz Garcia (sortiz@cfe.gob.mx) + +Salvador has helped bang out bugs and traps with sfio enabled +mod_perls, along with various bug spotting and stopping since the +early days. He has also contributed to the Apache/Perl API. + +=item Stas Bekman (stas@stason.org) + +Stas' "Mod Perl Developer's Mini Guide" has saved many lives. +He has also contributed a great deal to the mod_perl documentation and +mod_perl site. + +=item Vivek Khera + +Vivek has saved many lives with his mod_perl_tuning.pod document. + + +=back + + +=head1 MODULE AUTHORS + +These are the authors of the "third-party" mod_perl modules available +from the CPAN. + +=over 4 + +=item Charles C. Fu (ccwf@bacchus.com) + +Author of Apache::Gateway. + +=item Chris Thorman (chris@thorman.com) + +Author of Apache::PrettyText. + +=item Clayton Donley (donley@wwa.com) + +Author of Apache::TransLDAP and Apache::AuthLDAP. + +=item Daniel (daniel-authenradius@electricrain.com) + +Author of Apache::AuthenRadius. + +=item Demetrios E. Paneras (dep@media.mit.edu) + +Author of Apache::AuthenPasswd, Apache::AuthzPasswd, Apache::AuthenNIS +and Apache::AuthzNIS. + +=item Don Schwarz (dons@xnet.com) + +Author of Apache::Throttle. + +=item Ian Kluft (ikluft@cisco.com) + +Author of Apache::Servlet. + +=item Jeffrey Hulten (jeffh@premier1.net) + +Author of Apache::AuthenPasswdSrv. + +=item Jim Woodgate (woody@bga.com) + +Author of Apache::Album. + +=item Jochen Wiedmann (joe@ispsoft.de) + +Author of Apache::EP. + +=item Jonathan Swartz (swartz@transbay.net) + +Author of HTML::Mason. + +=item Malcolm Beattie (mbeattie@sable.ox.ac.uk) + +Author of Apache::AuthenIMAP. + +=item Mark A. Downing (mdowning@rdatasys.com) + +Author of Apache::Sybase::CTlib. + +=item Maurice Aubrey (maurice@hevanet.com) + +Author of Apache::Traffic. + +=item Michael Smith (mjs@iii.co.uk) + +Author of Apache::ProxyPass and Apache::RedirectDBI. + +=item Neil Jensen (njensen@habaneros.com) + +Author of Apache::Mysql. + +=item Peter G. Marshall (mitd@mitd.com) + +Author of Apache::TimedRedirect. + +=item Randy Kobes (randy@theory.uwinnipeg.ca) + +Author of Apache::RandomLocation. +the existence of a user in one or more database tables. + +=item Simon Matthews (sam@peritas.com) + +Author of Apache::Layer. + +=item Tom Hughes (tom@compton.demon.co.uk) + +Author of Apache::TempFile. + +=item Valerie Delane (valerie@savina.com) + +Author of Apache::AuthenNISplus. + + +=back + +=head1 The Apache and Perl communities + +If there was no Apache, there would be no mod_perl. + +If there was no Perl, there would be no mod_perl. + +We owe a great deal of thanks to The Apache Group, Larry Wall and the +perl5-porters, along with the communities that support them both. + +=head1 OTHER CONTRIBUTORS + +There are B other people who have contributed a great deal to +mod_perl in one way or another, this list is derived from the Changes +file, activity on the modperl@perl.apache.org list including support, +suggestions and new ideas, along with help through private mails or +other means. + +This list is most likely incomplete. +My apologies if that is the case, please send me an email if you are +left out and your contribution will be recognized! + +If you do not feel you've made a contribution, remember your help is +always welcome and appreciated. You should consider yourself a +contributor to the mod_perl effort even if you are simply using mod_perl! + +Adam Laurie, Alan Beale, Alexander Demenshin, Andrea Borgia, Ben Laurie, +Ben Reser, Ben Sugars, Bowen Dwelle, Brian Millett, Bruce Hoylman, Chip +Salzenburg, Chris Dean, Christopher Thompson, Dan Peterson, David Hodson, +David Landgren, Dean Gaudet, Elizabeth Mattijsen, Eric Eisenhart, Eric +James Negaard, Evert-Jan Couperus, Gary Shea, Gunther Birznieks, Gurusamy +Sarathy, Iosif Fettich, James Cooper, Jarkko Hietaniemi, Jeff Hallgren, +Jeff Rowe, Jens Heunemann, Jimmy Oh, Joel Wagner, John Detloff, Jon +Drukman, Jon Orwant, Joonsuk Bae, Liam Howlett, Lupe Christoph, Marc +Slemko, Mark Constable, Mark Mills, Mark-Jason Dominus, Michael Alan +Dorman, Michael Peppler, Michael Sanders, Michael Shields, Michael Turner, +Mike Pheasant, Mike Stok, Mike Wertheim, Milan Votava, Nathan Torkington, +Owen Scott Medd, Paul Phillips, Paul Sutton, Peter Levart, Randal Schwartz, +Richard Dice, Robert Nice, Robert Tau, Ron Hawkins, Ryan Whelan, Steve +Farrell, Steve Farrell, Steve Nielsen, Sven Verdoolaege, Ted Corning, Tim +Bunce, Todd Eigenschink, Tom Hukins, Tom Mornini, Ulrich Pfeifer + +=head1 REVISION + +$Revision: 1.1.1.1 $ $Date: 2003/06/01 22:04:27 $ diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Changes ./usr.sbin/httpd/mod_perl/Changes --- ../src.danvfs/usr.sbin/httpd/mod_perl/Changes Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Changes Sun Jun 1 18:04:27 2003 @@ -0,0 +1,4283 @@ +=head1 NAME + +Changes - Apache mod_perl change logfile + +=head1 CHANGES + +all changes without author attribution are by Doug MacEachern + +=over 3 + +=item 1.27 - June 1, 2002 + +workaround Cwd bug in 5.8.0-RC1 that breaks apache configuration on solaris + +fix get_set_PVp() to properly set NULL values when passing in undef +thanks to Lyle Brooks for the spot +[Stephen Clouse ] + +Apache::Registry/PerlRun/RegistryNG errors are now saved +in $r->notes('error-notes') +[Jesse Erlbaum ] + +fix Win32 build problems with spaces in shell arguments +[Randy Kobes ] + +make sure DynaLoader is loaded before XSLoader to workaround possible +segv when using mod_perl as a dso with perl 5.6.1 + +autoset PERL_USELARGEFILES=0 if needed + +fix taint issues with bleedperl + +fix bug in modules/util test +[Tatsuhiko Miyagawa ] + +Adjust the mailling list addresses +'s|\@apache\.org|\@perl.apache.org|' [Stas Bekman ] + +Apache::PerlRun will now localize $SIG{__{DIE,WARN}__} +thanks to Jon Coulter for the spot + +PERL5LIB support now properly unshifts paths into @INC rather than push +[Tatsuhiko Miyagawa ] + +do not clear symbol tables within a package in perl_clear_symtab() +used by directive handler extensions +[Stephen Clouse ] + +properly deal with $r->status codes (e.g. redirect) in +Apache::RegistryNG [Geoff Young ] + +allow $r->auth_name and $r->auth_type to be set on win32 +[John Kelly ] + +fix compilation for win32 w/ apache 1.3.22+ +[Randy Kobes ] + +fix multiple %LocationMatch in sections bug +[Salvador Ortiz Garcia ] + +rip -D_GNU_SOURCE out of Perl 5.7.3+'s ccflags, which modperl doesn't +need and apache won't compile with [Stas Bekman ] + +make sure PerlSetEnv variables are visible after first access +to each child [Geoff Young ] + +workaround Apache::Constants::AUTOLOAD problem with bleedperl + +the first flag argument to perl cannot start with space, since perl tries +to open the " -spi.bak" as a file. fix that in the win32 case. +[Stas Bekman ] + +starting from perl 5.7.3 for tied filehandles, tiedscalar magic is applied +to the IO slot of the GP rather than the GV itself. adjust the TIEHANDLE +macro to work properly under 5.7.3+. [Charles Jardine , +Stas Bekman ] + +added perl_perl_merge_dir_config and array_header2avrv symbols to +mod_perl.def for win32 and mod_perl.exp for aix. +[Randy Kobes ] + +INSTALL.apaci: added an explanation of how perl has to be built in +order to use DSO without problems (copied from the guide) based on +email from Doug. [Stas Bekman ] + +warn if Perl is configured with -Duseshrplib and a libperl.so is found +in a place where it should not be, example: /lib /usr/lib or /usr/local/lib + +fix potential segv in Apache::URI->rpath +[Vyacheslav Zamyatin ] + +require URI::URL to work with newer libwww-perl + +allow overriding of container directive handlers using the func parameter +[Geoffrey Young ] + +enable directive handler support for TAKE13 +[Geoffrey Young ] + +=item 1.26 - July 11, 2001 + +fix 'make test' problem seen with Perl 5.005_03 + +remove $r->finfo usage from Apache::PerlRun, clearly finfo isn't as +stable as it should be +[Surat Singh Bhati ] + +Apache->server will now point the current VirtualHost when inside a + section, thanks to Robin Berjon for the spot + +allow per-server and per-location PerlSetEnv to be properly merged +when a per-server handler is configured, thanks to Michael Barry for +the spot + +enabled Apache::ModuleConfig on win32 +[Randy Kobes ] + +win32 support for Apache::src [Randy Kobes ] + +=item 1.25_01 - July 6, 2001 + +add symbols to mod_perl.exp for aix/axkit + +add Apache::add_version_component() function + +make sure Apache::ExtUtils can be found when building inside of the +apache source tree, thanks to Jonathan Swartz for the spot + +add perl_call_handler to mod_perl.def for win32/axkit +[Randy Kobes ] + +fix -[TB] file tests against $r->finfo, thanks to Geoffrey Young for +the spot + +Apache::SizeLimit enhancements [Perrin Harkins ]: +- Added support for minimum shared memory and maximum unshared memory +settings. +- Added extra diagnostics to tell how many requests a process served, +how long it lived, and how much shared memory it was using when +SizeLimit killed it. + +win32 enhancement: APACHE_SRC can be either the build or install tree +[Randy Kobes ] + +perl_destruct_level must always be 2 for DSO builds to prevent +leaking on restarts, thanks to Paul G. Weiss for the spot + +make sure file to be reloaded can be found in @INC, adjusting based on +%INC value if needed +[Ilya Konstantinov ] + +croak if the filehandle passed to $r->send_fd is NULL, otherwise +apache will segfault + +if PREFIX is given to Makefile.PL add it to @INC at startup +[Philippe M . Chiasson ] + +add %Apache::MyConfig aliases for Apache::src backwards compat +[Philippe M . Chiasson ] + +$r->custom_response($code, undef) will now unset the current CustomResponse +[Geoffrey Young ] + +fix to compile with sfio+ithreads, thanks to Joe Schaefer for the spot + +win32 fixes for apache 1.3.20 [Randy Kobes ] + +adjust perl_clear_symtab() to deal properly bleedperl's version of +cv_undef() (which broke modules with directive handlers) +thanks to Geoffrey Young for the spot + +add $r->allowed method [Philippe Troin ] + +fix 'make offsite-tar' [Geoffrey Young ] + +win32 fixes [Randy Kobes ] + +fix double-loading bug of Perl{Require,Module}s at startup time + +improve Apache::MyConfig [Stas Bekman ] + +back out 'stop win32 crash when bringing down service' change, no +longer needed with 1.3.19 +[John Sterling, Will Rowe] + +$r->no_cache(0) will unset cache headers +[Geoffrey Young ] + +export hvrv2table (needed by Apache::Request) for aix and win32 +[Jens-Uwe Mager , Randy Kobes ] + +fix 'make tar_Apache' [Geoffrey Young ] + +make sure global for Apache->request is reset after configuring %ENV +[Gerald Richter ] + +adjust 'U' magic functions to Perl 5.7.x-dev prototype change + +Put Apache's CFLAGS into AP_CFLAGS instead of CFLAGS, so that +people who like to override CFLAGS from the make line (make +CFLAGS='-arch ppc -arch i386') can do so without stomping the +Apache flags. [ Wilfredo Sanchez ] + +=item 1.25 - January 29, 2001 + +avoid 'prototype mismatch' warnings in Apache::PerlRun::flush_namespace +[Wenzhong Tang ] + +xsubpp now run with -nolinenumbers (5.004_04 bombs otherwise) + +DSO support for hpux with native cc + +document Apache->server->register_cleanup +[Perrin Harkins ] + +Apache::Server->loglevel can now be modified +[Geoffrey Young ] + +use unsigned short rather than short for Apache::Server->port +thanks to Richard L. Goerwitz for the spot + +fix $r subclassing mechanism when value of `r' or `_r' key is a hashref +thanks to Dave LaMacchia for the spot + +fix Apache::PerlRun is-a -> has-a Apache relationship change oversights +[Ken Williams , +Alexander Solovey ] + +win32 updates for 1.3.15, including ApacheModulePerl.{dsp,dll} -> +mod_perl.{dsp,so} rename +[John K. Sterling , +Randy Kobes ] + +fix directive handlers bug triggered by LoadModule foo_module + +allow $r->finfo to be modified + +if Perl is linked with -lpthread, then httpd needs to be linked with +-lpthread, make sure that happens with USE_DSO=1, warn if USE_APXS=1 + +largefile flags can be stripped from mod_perl with: + Makefile.PL PERL_USELARGEFILES=0 + +adjust test output (modules/{cgi,constants}) to make 5.7.0-dev +Test::Harness happy + +fix $r->custom_response bug which was triggering core dumps if no +ErrorDocuments were configured, thanks to Paul Hodges for the spot + +rid PL_na usage in Symbol.xs + +INSTALL.win32 updates, obsolete INSTALL.activeperl removed +[Randy Kobes ] + +Solving an 'uninitialized value' warn in Apache::SizeLimit. +post_connection() expects a return status from the callback function. +[Stas Bekman ] + +include mod_perl hook/feature config and pod in Apache::MyConfig +[Geoffrey Young ] + +rewrite of Apache::WRITE() in c/xs +[Soheil Seyfaie ] + +prevent $PerlRequire in a section from triggering an endless loop +[Salvador Ortiz Garcia ] + +build fix for using gcc with AIX +[Jens-Uwe Mager ] + +allow modification of $r->hostname +[Jim Winstead ] + +allow Makefile.PL to build mod_perl on Win32 using VC++ +[Randy Kobes ] + +stop win32 crash when bringing down service +[John K. Sterling ] + +various Apache::test enhancements and fixes +[Ken Williams , Dave Rolsky ] + +Documenting the new PerlAddVar httpd.conf directive +[Stas Bekman ] + +new Apache::test::static_modules() method +[Ken Williams ] + +Improved Apache->send_http_header documentation +[Ken Williams ] + +=item 1.24_01 - October 10, 2000 + +fix bug in $r->args that treats ?0 as the empty string instead of zero, +thanks to Matt Sergeant for the spot + +add proper offset support to Apache::read + +config/test fixups for libapreq/win32 +[Randy Kobes ] + +skip modules/ssi test if mod_include is not installed + +Apache::test enhancements +[Ken Williams ] + +fix Apache::exit() so it does it does not trigger a warning + +change Apache::PerlRun's Apache class relationship from is-a to has-a +[Ken Williams ] + +Apache::SubRequest->run(1) allows ap_send_http_headers() to output for +subrequests + +Apache::{Registry,PerlRun} will now log an error if $filename is NOT_FOUND +thanks to Martin Wood for the spot + +fix bug where Apache::send_http_header was resetting r->status = 200 +thanks to brian d foy for the spot + +make extra sure Apache::Constants::AUTOLOAD does not recurse looking +for sub __AUTOLOAD [Jim Winstead ] + +fix %Apache::ReadConfig:: processing for PerlRequire'd files +[Salvador Ortiz Garcia ] + +$r->get_basic_auth_pw and $r->note_basic_auth_failure will default +$r->auth_type to "Basic" if not already set + +$r->auth_type is now writeable, e.g. $r->auth_type("Basic") + +fix $r->read() so it will not block if all data has already been read +and so that Apache will not hang during ap_discard_request_body() on +error or redirect after all data has been read + +fix for Makefile.PL ADD_MODULE=src/module/foo/libfoo.a +[Nelson Oliveira ] + +added Apache::user method in preparation for 2.0, now that `user' hangs +off of the request_rec rather than request_rec->connection in Apache 2.0 + +disable r->proxyreq checking unless PerlTransHandler is enabled and +configured + +fix 'make tar_Apache' [Jesse Erlbaum ] + +fix for Perl{Module,Require} in .htaccess, +thanks to Will Trillich and Andrew Gideon for the spot + +static+apaci fixes for aix [Jens-Uwe Mager ] + +fix bug in Perl{Set,Add}Var so $r->dir_config->get('key') sees the +same values as $r->dir_config('key'), thanks to Geoffrey Young for the spot + +PerlAddVar is now an ITERATE2 directive rather than TAKE2 + +added Apache::Server::error_fname method + +eg/makepl_args.mod_perl updated +[Neil Conway ] + +'make test' config fixes for mod_ssl +[David Mitchell , Mark Murphy , +Stephen Schaefer ] + +plug leak in DIR_MERGE, thanks to Matt Sergeant for the spot + +fixes to run and pass 'make test' on ActivePerl [Randy Kobes, Gerald Richter] + +Makefile.PL:post_initialize fix for win32, thanks to john sterling for +the spot + +fixes for ActivePerl [Gurusamy Sarathy ] + +change apaci/Makefile.tmpl and src/modules/perl/Makefile so Perl's +include path comes before /usr/local/include, e.g. to make sure Perl's +patchlevel.h is used, thanks to Ryan Morgan for the spot + +avoid duplicate buffer copy in {read,get}_client_block by reading +directly into Perl's SV buffer + +modules/request test fix +[Ken Williams ] + +switch usage of hard_timeout() to soft_timeout(), so if SIGALRM +happens during Apache::{print,read}, the script will continue run, +allowing proper cleanup (e.g. DESTROY) + +fix refcnt bug in $r->get_handlers, +thanks Geoffrey Young for the spot + +add PerlCleanupHandler to the {get,set}_handlers table, +thanks Geoffrey Young for the spot + +fix $r->args(undef), thanks to Greg Cope for the spot + +quotemeta path_info in Registry regexp +[Tobias Hoellrich ] + +flush r->finfo cache if r->filename fails +[Roger Espel Llima ] + +fix per-dir merging of PerlSetupEnv [Eric Cholet ] + +INSTALL.raven update [Adam Qualset ] + +backed out $Apache::Server::ConfigTestOnly until proper Apache support +is in place + +fix $r->bytes_sent($bytes) + +support version parsing of 1.3.13-dev's httpd.h + +fix for 'sub handler : method {}' support when method is not found +[Eric Cholet ] + +Apache::ExtUtils will now generate and END routine to call +ap_remove_module() [Christopher Chan-N ] + +rename Apache::{PerlRun,RegistryNG}::update_mtime to set_mtime, so +Apache::update_mtime is not overridden +thanks to Michael Blakeley for the spot + +constant 'DECLINED' wasn't imported by Apache::RegistryBB, thanks to +Michael Blakeley for the spot [Eric Cholet ] + +fixes for building with stronghold +[Sander van Zoest ] + +Apache::Resource was not converting PERL_RLIMIT_AS to MB values +thanks to Ian Kallen for the spot + +fix unescape_url_info() when url is undef or "", +thanks to Kenneth Lee for the spot + +fix 1.24's Apache::Table->unset changes for win32 +[Randy Kobes ] + +fix broken Win32 build (unresolved external symbol _ap_configtestonly) +[Eric Cholet ] + +=item 1.24 - May 16, 2000 + +'sub handler : method {}' is now treated as a method handler + +variable $Apache::Server::ConfigTestOnly is set to 1 if Apache +is running in configuration test mode (httpd -t) +(not unavailable under Win32) +[Eric Cholet ] + +add PerlAddVar directive, like PerlSetVar, but uses ap_table_add +instead of ap_table_set + +Makefile.PL warns about 5.6.0+uselargefiles if USE_APXS + +Apache::Table->unset can now be called with an array reference + +Apache::PerlRun::flush_namespace fixes, so aliased (imported) +code/hash/array/scalar are undefined without undef-ing the pointed-to +data and without using B.pm, thanks to Richard Chen for the suggestion + +document Apache::print's special behavior wrt references +[Jeffrey W. Baker ] + +fix core dump triggered by do 'foo.pl', +thanks to Robert S. Thau for the spot + +pass $Config{ccflags} to apache for 5.6.0+ + +fix Apache->httpd_conf, thanks to Will Trillich for the spot + +fixed 'make clean' to remove FILES => passed to MakeMaker + +=item 1.23 - April 20, 2000 + +create test files during Makefile.PL so 'make test' can be run as root + +add Apache::FILENO method for 5.6.0+ tied filehandle support +thanks to Richard Titmuss for the spot + +--disable-rule=EXPAT is passed to Apache's configure to avoid +XML::Parser conflicts + +User/Group for 'make test' can be overridden with the environment +variables APACHE_USER/APACHE_GROUP + +fix PerlSetVar inheritance bug +[Sander van Zoest ] + +set r->notes("error-notes") to $@ if $@ after a Perl*Handlers is run +[Doug / Tom Mornini ] + +added INSTALL.raven +[Adam Qualset ] + +$c->remote_ip($ip) now also sets conn->remote_addr to make +IP-based access control work correctly +[Eric Cholet ] + +Apache::URI::port wasn't setting the port correctly, thanks +to Zeqing Xia for the spot [Eric Cholet ] + +$Apache::Registry::NameWithVirtualHost fix take 2 +(move is_virtual logic from mod_perl.c to Registry.pm) +[John Hughes ] + +added Apache::OPEN method for 5.6.0+ tied filehandle support + +Apache::Table is now loaded by default (if enabled), rather than +autoloading when first needed + +$r->document_root can now be modified + +upgrade license to apache software license version 1.1 + +$r->the_request can now be modified + +modules/request test fix +[Rick Myers ] + +updated dso+aix Perl patch +[Jens-Uwe Mager ] + +warn that dso+Perl malloc needs a Perl built with -Ubincompat5005 + +add Apache::BINMODE stub for 5.6.0 tied filehandle support (fixes cgi.t #4) +[Randy Kobes ] + +5.6.0+win32 typedef,prototype clash fixes +[Randy Kobes ] + +add $r->server->loglevel() and relevant constants. Suggested +by Geoffrey Young [Eric Cholet ] + +$Apache::Server::AddPerlVersion uses $^V for Perl/v5.6.0+ + +update mod_ssl config for 'make test' +[Stas Bekman ] + +reset the stack pointer after calling perl_require_module() in +perl_call_handler(). this fix will most likely cure the reports of +"Can't upgrade that kind of scalar at ..." +[Ben Cottrell ] + +workaround use of Perl api functions that are no longer public with +Perl 5.6.0 + win32, thanks to Randy Kobes for spotting + +change $Apache::VERSION check to use a string instead of SvNV, which +was troublesome with Perl 5.6.0, thanks to Dave Seidel for pinpointing + +Apache::src fixup to quiet warnings under Perl 5.004. Thanks to Ken +Williams for the spot. [ Ask Bjoern Hansen ] + +Apache::src::apxs fixups to quiet warnings if apxs doesnt exist or +httpd is not dso enabled, thanks to Oleg Bartunov and Ville Skyttä for +spotting + +fix #ifdef SGI_BOOST typo +[Ville Skyttä ] + +=item 1.22 - March 22, 2000 + +proxy support fixed wrt RFC2068, thanks to Benjamin Elijah +Griffin for the spot + +set Apache::Resource::DEFAULT_RLIMIT_AS (address space) to 64Mb +[Kevin Murphy ] + +Bundle::Apache will now install Bundle::LWP before mod_perl +[Aaron Johnson ] + +support Apache::FakeRequest::args in a list context +[Michael Finke ] + +compile fixes for 5.6 + -Duse5005threads +[Lincoln Stein ] + +log to parms->server instead of stderr if PerlRequire fails + +make sure lib/Apache/MyConfig.pm is written before used +thanks to Albert Chin for the spot + +fixup the output of apxs -q CFLAGS to preserve quoting (again) + +=item 1.21_03 - March 15, 2000 + +removed the generated apaci/mod_perl.config from MANIFEST + +new variable $Apache::Server::StrictPerlSections, if true, will croak + section generates invalid Apache configuration syntax + +new Apache::src->ccflags method to combine $Config{ccflags} and +apxs -q CFLAGS +[Matthias Urlichs ] + +added Apache::src->apxs method + +make use of $Config{shrpenv} to find CORE/libperl.so +[Ignasi Roca Carrió ] + +fix Apache::Registry bug when filename starts with a 0 +[Peter Deister , Ken Williams ] + +Apache::Registry will restore $r->status to the original value +[Charles Levert ] + +warn aix-apxs-5.005_03 users of the patch needed for DynaLoader +[Jens-Uwe Mager ] + +fixup the output of apxs -q CFLAGS to preserve quoting +[Sheldon Hearn ] + +dso fix fix: modules with END blocks calling xs code (e.g. DBI) would +core dump because the xs .dso had been unloaded, now dso's are not +unloaded until after END blocks are called. +Thanks to Daniel Jacobowitz and others for spotting + +=item 1.21_02 - March 6, 2000 + +fix Makefile.PL if $USE_APXS && $PERL_DEBUG +[Daniel Jacobowitz ] + +force environ[] to be copied before any Perl code is loaded +[Daniel Jacobowitz ] + +localize $_ in Apache::send_cgi_header +[Roderick Schertler ] + +fix precedence problem in StatINC.pm +[Roderick Schertler ] + +if hash value has magicalness in , invoke FETCH +thanks to Kevin Ruscoe for the spot + +sync with 1.3.12's virtual_host section logic for httpd -S + +thanks to Kevin Ruscoe for the spot + +remove t/httpd symlink during 'make realclean' and when rebuilding +[Geoffrey Young ] + +add Apache::src::otherldflags method +[Jens-Uwe Mager ] + +backout modules/util validate_password tests, not everybody has crypt, +thanks to Randy Kobes and Ed Loehr for spotting + +fix _AIX typo in dso_unload +[Jens-Uwe Mager ] + +=item 1.21_01 - March 5, 2000 + +#ifdef _AIX, make sure Perl's dlclose is used, instead of Apache's +during dso_unload [Jens-Uwe Mager ] + +__THE__ dso fix: dlclose() xs shared objects and call perl_shutdown() +before mod_perl's libperl.so is unloaded/reloaded by mod_so +[Daniel Jacobowitz , Alan Burlison ] + +add /D "_MSWSOCK_" to ApacheModulePerl.dsp +[Randy Kobes ] + +removed modules/sandwich test + +Apache::RegistryBB returns DECLINED instead of FORBIDDEN if -d $r->finfo +[Sean Chittenden ] + +add Apache::Util::validate_password(), as suggested by Christophe +Labouisse + +call (void)perl_request_rec(r) asap, instead of waiting till the +response phase, e.g. so CGI.pm can be used before PerlHandler, without +having to call Apache->request($r); + +Apache::perl_hook() fixes for Perl*Api, thanks to Geoffrey Young for +the spot + +save/restore $^W in Apache::PerlRun +[Honza Pazdziora ] + +fix Apache::Registry when $r->uri ends with a / +[Peter Deister ] + +add virtualhost support to Apache::RegistryLoader +[John Hughes ] + +$Apache::Registry::NameWithVirtualHost fix +[John Hughes ] + +allow Apache::PerlRun::handler to be subclassed +[Yasushi Nakajima ] + +fix $r->connection->remote_ip for SGI performance patches (#ifdef SGI_BOOST) +[Artem Veremey ] + +mod_perl.exp is now installed + +aix tweaks for building with apxs +[Jens-Uwe Mager ] + +pod fixups to avoid WARNING from newer pod2* + +Apache::RedirectLogFix now uses $r->last +[David D. Kilzer ] + +tweaks for sfio +[Lupe Christoph ] + +update Apache::SIG docs, thanks to Bill Moseley for the spot + +fix get_set_PVp in mod_perl_xs.h +[Michal Jaegermann ] + +tweaks to compile/run with 5.5.670 + -Dusethreads + +$r->hostname now documented [Eric Cholet ] + +Apache::File methods are now documented +[Eric Cholet ] + +avoid quoting config if args_how == RAW_ARGS +thanks to Michael Schout for the spot + +PerlPassEnv maintains its value beyond the first request, +thanks to Chris Thorman for the spot + +prevent possible core dump in $r->pnotes if get_module_config returns +NULL, thanks to Kevin Murphy for the spot + +fix Apache::Status::status_cv_dump for Perl/5.6-dev + +use perl_get_sv("]") instead of patchlevel for $AddPerlVersion + +adjust Makefile.PL and Apache::src to parse 1.3.13-dev's httpd.h + +Apache::Util functions $r->unescape_uri, $r->unescape_uri_info, +$r->size_string are now documented [Eric Cholet ] + +$r->request_time is now documented [Jeffrey W. Baker ] + +Look for the makepl_args.mod_perl file as .makepl_args.mod_perl in +./ and ../ too since the book says it works so. [Ask Bjoern Hansen +] + +PerlRestartHandler is now enabled w/ ALL_HOOKS=1 (or EVERYTHING=1) + +$r->no_cache(1) will now set the r->headers_out "Pragma" and +"Cache-control" to "no-cache" + +`PerlSetEnv PERL5LIB ...' now works again, thanks to Stas for the spot + +Apache::test fix for Apache::Table + +PerlFreshRestart semantics changed to preserve order of PerlModule's +and not to reload modules while actually iterating over %INC + +$r->current_callback now works properly when PerlHandler invokes +subrequests, thanks to James Smith for the spot + +if an Apache::Table is NULL return undef (e.g. $r->notes during ChildInit) + +ActivePerl compile patches [Jochen Wiedmann ] + +document that Apache 1.2.x is no longer supported + +Apache::src now supported with USE_APXS=1 + +'make test' AllowOverride None for Directory / +[Steve Lembark ] + +disable experimental perlrunxs until future notice + +add sanity check for libgdbm + +change PL_siggv usage to gv_fetchpv("SIG", ...) for Perl 5.6-tobe +[Andreas J. Koenig ] + +document $r->get_handlers, $r->set_handlers, $r->push_handlers +[Eric Cholet ] + +document PerlSetVar [Eric Cholet ] + +document the fact that $r->dir_config handles keys in a +case insensitive manner [Ken Williams ] + +avoid logging "rwrite returned -1" multiple times in the +same request [Eric Cholet ] + +bugfix in write_client() when running under APACHE_SSL +[Michael Douglass ] + +document the fact that $r->connection->user can be used to set +the authenticated user name [Joshua Gerth ] + +document the fact that $r->uri sets/gets the URI minus the query string, +not the complete URI [Andrei A. Voropaev ] + +fixed the failure of t/modules/file test in 'make test' suit by untainting +the $ENV{PATH} in ./t/net/perl/file.pl [Stas Bekman ] + +Apache::RegistryLoader::handler was rewritten to allow a better +diagnostics of scripts preloading problems. [Stas Bekman +] + +document the fact that $r->args can be used to set the query string +as well as get it [Andrei A. Voropaev ] + +add $r->connection->fileno, provides the client file descriptors. This +can be used to detect client disconnect without doing any I/O, e.g. using +IO::Select [Eric Cholet ] + +if $r->bytes_sent has not been calculated, then do so before returning +the value. thanks to Dirk Melchers for the spot + +ensure that all -I directories printed by Apache::src actually exist + +don't assume $uri =~ /$path_info$/ in Apache::Registry/PerlRun +[Jonas Liljegren ] + +/D "_WINSOCK2API_" for 1.3.9/win32 [Randy Kobes ] + +fix segfault when using Limit in sections +[Müller Joachim ] + +make $c->remote_host writeable [Joshua Chamas ] + +add per-server PerlSetVar variables, accessed using +Apache->server->dir_config or $r->server->dir_config. +$r->dir_config merges them with per-directory variables. +[Eric Cholet ] + +documentation typo [David Harris ] + +add $r->server->uid and $r->server->gid [Eric Cholet ] + +add per-server configuration merge [Eric Cholet ] + +`_' is no longer escaped in Apache::Registry package names + +fix $ENV{PATH} corruption, thanks to help from Chip Turner, +Oleg Bartunov and Tomasz Przygoda + +mod_perl_version.h removed from MANIFEST + +fix modules/sandwich test + +apxs/aix port [Paul J. Reder ] + +preload Apache::Constants::OPT_EXECCGI() for Apache::{Registry,PerlRun} +thanks to Chris Remshaw for spotting this w/ Apache::DProf + +Apache::SizeLimit now uses $r->child_terminate instead of Apache::exit(-2) +[Jon Peterson ] + +get rid of various 5.005_60 warnings + +add Status{Terse,TerseSize,Deparse,Fathom,OptionsAll} options to Apache::Status + +adjust mod_perl.h for 5.005_59 perl_eval_{pv,sv} rename + +fix flush_namespace undef logic in Apache::PerlRun, thanks to Karsten +Meier for the spot + +Tweak Apache::content to comply with media-types embedded in content-types +(RFC 2616 section 3.7) [Eric Cholet ] + +Removed and added a few modules from the Bundle file. + +Renamed the Apache::StatINC parameters to StatINC_. Changed +StatINC_Debug to take a number as parameter instead of "on" to support +"debug levels" + +=item 1.21 - July 2, 1999 + +fix refcount bug in %VirtualHost [] values, thanks to Pete Ehlke for +the spot + +get rid of a warning in Apache::test [Joshua Chamas ] + +$r->read will now properly check the return value of +ap_setup_client_block() and return undef if != OK, +e.g. if LimitRequestBody is exceeded, thanks to Joshua Chamas for the +spot and testing + +loosen module/cookie tests + +fix bug in register_cleanup() [Chip Turner ] + +added StatusLexInfo option to Apache::Status + +=item 1.20 - June 11, 1999 + +turn off warnings in Apache::Status::as_HTML symdump code +[Geoffrey Young , Tim Bunce ] + +tweak Apache::RegistryNG so it works with virtual includes, thanks to +Vivek Khera for the spot + +modules/eperl,embperl removed from 'make test' + +change Apache::File->tmpfile flags from O_WRONLY to O_RDWR +[Chuck O'Donnell ] + +fix Apache::RegistryBB when $r->filename NOT_FOUND +[Frank D. Cringle ] + +cygwin port [Stipe Tolj ] + +Documented $r->pnotes [] + +Change "setting auth_name" trace message so we don't get it without +having enabled a MOD_PERL_TRACE level [Ask Bjoern Hansen +] + +s/class/pclass/g so we can compile w/ c++ + +mod_perl will now save/restore SIGALRM + +fix Apache::Status bug prototype check of 'use constant' subs, thanks to +Eric Cholet for the spot + +added set_byterange() and each_byterange() methods + +added proper support for {Location,Directory,Files}Match in sections + +new Apache::ExtUtils::pm function to generate Foo.pm/Makefile.PL +templates for modules with directive handlers + +Makefile.PL will now do a handful of sanity checks looking for +possible broken configurations and offer suggestions for those it +finds + +rework PerlFreshRestart to avoid core dump triggered w/ 5.005_03 + +fix $Apache::Server::Starting under dso + +use ap_bfileno() instead of r->connnection->client->fd directly +[Paul J. Reder ] + +fix Table.xs:table_modify() under win32 +[Trung Tran-Duc ] + +get rid of odd WRITE message in perlio.pl test if $Config{usesfio} +[John Hughes ] + +fix possible overwrite in perlio.c:sfapacheread() #ifdef USE_SFIO +[John Hughes ] + +dont use DEFAULT_PATH if r->subprocess_env->{PATH} is already set +[Bertrand Demiddelaer ] + +ensure perl_setup_env() is called just once per-request +[Salvador Ortiz Garcia ] + +:common Apache::Constants are compiled at bootstrap time, so CVs are +shared and AUTOLOAD is avoided, which was known to cause a spin +while loading SERVER_ERROR for particular Perl errors + + sections now use 1.3.7-dev's cmd_parms->context to cure many +known, old bugs, e.g. @DirectoryIndex outside of %Location, .htaccess +and many more [Salvador Ortiz Garcia ] + +fix bug where top-level PerlSetEnv's would be lost after 1st request + +fix bug in Apache::ModuleConfig->get [Dave Hayes ] + +fix rwrite error message [Eric Cholet ] + +Change Apache::SizeLimit so that it supports Solaris 2.6 and above +[Brian Moseley ] + +Fixed apaci/load_modules.pl.PL to properly fixup log_agent and +log_referer when loaded as DSOs. [Vivek Khera ] + +Fixed apaci/mod_perl.config.sh to remove the ccdlflags from the +PERL_LIBS variable when building under bsd/os 4.x, since that causes +errors when passing "cc" oriented flags to "ld". I suspect this +should be done for all platforms, as passing cc options to ld just +seems wrong to me. Also fixed up Makefile.PL to override Apache's +notion of LDFLAGS_SHLIB_EXPORT to use Perl's idea of the proper flags +when building as a DSO under APACI. [Vivek Khera ] + +=item 1.19 - April 7, 1999 + +Apache::Leak fixes for win32 +[Matthew Sergeant ] + +Apache::Request upload tests are skipped #ifdef USE_SFIO + +$r->send_fd() will croak() #ifdef USE_SFIO + +added $r->mtime method [Andreas J. Koenig ] + +fix so version info is not inserted too early (i.e. before Apache/x.x.x) + +new Apache::PerlRun::namespace_from() method, returns +$r->uri - $r->path_info, can be overridden as Apache::RegistryNG does to +return $r->filename instead + +some minor test fixups for when certain things are not installed and +be sure $ENV{PERL5LIB} is used (Perl ignores w/ -T) + +print() now returns true on success, false on failure (1.3.6+) + +no longer set SIGPIPE handler if Apache >= 1.3.6 + +fix bug triggered when siggv is not initialized, spotted by Preston Brown + +new Apache::PerlRun::flush_namespace method to undef() each [SAHC]V +entry, rather than a blind clear (which triggered cores, e.g. sort) + +$r->custom_response will now return the current ErrorDocument + +Semicolon support in $r->args [ Eric Cholet ] + +issue with threads in perl_config.c [ Malcolm Beattie + / Koichi Nakatani ] + +fix bug in PerlPassEnv spotted by Gerd Knops, where values were munged + +make sure per-dir PerlSetEnv happens after defaults are set (e.g. PATH) + +cure core dump with 5.005_03-threads + +ensure mod_perl/x.xx component is not added before Apache/x.x.x + +fix $ENV{MOD_PERL} value + +=item 1.18 - January 27, 1999 + +if -DAPACHE_PERL5LIB is defined, feed the paths to @INC at startup + +prevent double mod_perl/x.xx in Server header under DSO +[Jan Wedekind ] + +Apache::Status HTML cosmetics + prefer Apache::Request over CGI.pm +[Andreas J. Koenig ] + +ensure Apache.pm is loaded (at least attempted) before checking $VERSION + +do not undef subroutines when flushing Apache::PerlRun::handler +namespace unless subroutine lives in that namespace, i.e. not imported +(no undef happens unless `B' module is loaded) + +untaint Apache::File->tmpfile (if $ENV{TMPDIR,TEMP} are used) + +'make test' fixups: + + -for when other modules (e.g. auth, dirindex, type) + come before mod_perl in the module list + -exit graceful if LWP is still not installed + -skip module.t unless mod_{include,access} are configured + +loose @ISA 'DynaLoader' to avoid inheriting AutoLoader::AUTOLOAD + +added $r->server->timeout method + +skip tests that use xs/ap_ code if installed MMN is not equal to +target MMN, since Apache releases may break binary compat + +Makefile.PL will look for --target=(\S+) in APACI_ARGS, if found use +instead of the default `httpd' for 'make test' + +make sure ap_config_auto.h is picked up when PREP_HTTPD=1 (for +non-distribution modules that use Apache::src to build) + +Fixed "broken" $VERSION's so CPAN won't be confused +[ Ask Bjoern Hansen ] + +add some insurance so HTTP_* env variables should always be wiped + +fixed $r->finfo bug (properly set PL_laststatval) + +PerlRequire/PerlModule will not let the server start if there is an +error (bug introduced in 1.16_xx), thanks to Brian Moseley for the spot + +5.005_54+usethreads port [Brian P Millett ] + +fix -w command line logic for Apache::Registry +[Honza Pazdziora ] + +$r->connection->aborted now returns the flag as-is (no c->fd test) + +fix bug in Apache::ModuleConfig->get($r) when $r isa subclass of Apache + +=item 1.17 - January 6, 1999 + +change silly "Client hit STOP or Netscrape bit it!" message to a more +reasonable message: "[modperl] caught SIGPIPE in process $$" + +don't register cleanups with the server-pool if we are a dso + +updated CREDITS + +internal $Apache::__T variable now properly set again, thanks to Stas +Bekman for the spot + +fix so "top-level" Perl{Set,Pass}Env works if Perl is started early + +new $r->pnotes method + +$ENV{MOD_PERL} is not inherited by subprocesses + +no longer use -e with perl_parse() + +Apache::ExtUtils will complain if it can't determine the +directive handler prototype (args_how), rather than fail during 'make' + +t/TEST =~ s/mod_perl_httpd.pid/httpd.pid +[Bruce W. Hoylman ] + +use a "%s" format for ap_log_{r}error, so %'s in the log message +string are not treated as format strings + +INSTALL updates [Tom Hukins ] + +=item 1.16_02 - November 30, 1998 + +removed PERLV define, just use patchlevel.h's defines + +fix bug w/ push_handlers(PerlCleanupHandler => ...) spotted by +Jan-Pieter Cornet and Philp Gwyn + +remove references to the deprecated CGI::Switch + +initialize %LocationMatch, %DirectoryMatch, %FilesMatch and tie to IxHash +for sections [Eric Cholet ] + +when sections empty a symbol table, don't clear imported/aliased +variables (e.g. %Config::Config) + +remove warning if Apache::Table was not already loaded + +sv2request_rec (Apache typemap) will look for '~' so xs modules can +subclass without using a HASH ref (e.g. Apache::Request NG) + + sections will always make sure Apache.pm is loaded + +=item 1.16_01 - November 24, 1998 + +$r->connection->remote_addr can now be changed + +upgrade perl_PL.h to work with Perl 5.005_53+ + +use absolute path for StrongholdLicenseFile +[Todd R. Eigenschink ] + +only perl_section_self_boot() if an %Apache::ReadConfig:: entry is defined() +this fixes a bug spotted by Eric Cholet where a startup file +subroutine that accessed %Apache::ReadConfig:: would trigger a +self-boot wipe-out + +add Perl/$] to Server: header if $Apache::Server::AddPerlVersion is true + +fixed refcnt bug in $r->current_callback + +some Apache::Constants updates (see the .pod) and new export() method + +ensure @INC value from startup time is always properly saved + +pod support '=for apache/=end apache' replaced with: + =over to apache + #directives for apache + =back to pod + +Apache::FakeRequest now supports Apache::Constants and is documented +[Andrew Ford ] + +new Apache->define method works like IfDefine + +PerlRequire/PerlModule will start Perl if it is not already running + +(undocumented) $Apache::ReadConfig variable renamed $Apache::Server::SaveConfig + +SERVER_CREATE/SERVER_MERGE methods implemented for directive handlers + +new-ish xs modules added to win32 build: Apache::Log, Apache::File, +Apache::Table, Apache::URI, Apache::Util + +new Apache::Table->new method + +two experimental options now on by default: +PERL_SECTIONS_SELF_BOOT and ERRSV_CAN_BE_HTTP + +fix so $Apache::ReadConfig = 1; works again, thanks to Stas Bekman for the spot + +add support for new 1.3.4-dev M_* methods, M_PATCH, M_LOCK, etc. + +fix $r->log->debug when running under -T + +new Apache::Leak module + +new Apache::Symdump module + +allow $VirtualHost{'111.22.33.55'} = [...] syntax in sections + +Perl*Handler commands will now call perl_startup() if Perl is not +already running to cure dso problem [Daniel Jacobowitz ] + +plugged leak in mod_perl_tie_table() + +methods that return an Apache::Table object no longer attempt to +'require Apache::Table' for you (well, maybe not next release, for now, you +get a big: `WARNING: autoloading Apache::Table') + +rename PERL_VERSION macro to PERLV to avoid possibl future conflict + +rename Apache::Tie/Apache::TieHashTable -> Apache::Table + +Apache::PerlRun::handler will explicitly undef subroutines before +"flushing" the namespace [Gunther Birznieks ] + +Perl*Handler configuration will attempt to pre-load the argument as a +module if it has a leading `+'. PERL_AUTOPRELOAD=1 or +$Apache::Server::AutoPreLoad=1 will turn on auto-preloading for all +Perl*Handlers except those which have a leading `-' + +Apache::URI->parse($r) without a $url argument will create a "self" url +from $r->uri + +Apache::Registry will now allow DirectoryIndex to work even when +ExecCGI is off. [ Ari Jolma / Ask Bjoern Hansen + ] + +added HTTP_OK to Apache::Constants :http export tag + +fixed bug in Apache::ModuleConfig->getline + +Segfaults when build with Ben-SSL 1.27, and trying to exec the gcache. +[ Michael Shields ] + +Fixes for a clean compile with mod_ssl [ Salvador Ortiz Garcia + ] + +Minor fix to the debug option in Apache::StatINC [ Ask Bjoern Hansen + ] + +=item 1.16 - October 2, 1998 + +Apache::Util::escape_html() now handles `"' and `&'. should also be a +bit faster now, avoiding a strdup() call + +PerlPassEnv/PerlSetEnv will now call my_setenv() so the C enviroment +array is also updated + +Apache::Registry will return DECLINED if -d $r->filename so +DirectoryIndex, etc., will work again + +mod_perl now passes 'make test' on BSD/OS 3.1 again. [ Vivek Khera ] + +added INSTALL.simple.mod_ssl and SSL_BASE=... Makefile.PL option + +Apache::PerlRun::handler changes: + + - PerlRunOnce option + - don't localize %INC, just remove new, non-.pm files + +fix bug that would hose child if a croak() happened, be it from a +syntax error, Carp::croak(), etc. remove child_terminate() hack that +was blaming the Perl stack being corrupt + +Apache::StatINC can now be configured to write debug stuff with +a PerlSetVar [Ask Bjoern Hansen ] + +perl_startup() will now check the Apache.pm $VERSION + +fixups for building Stronghold 2.4 + +new Apache::File module + +send_fd() will now accept an optional length argument + +HTTP_NOT_MODIFED added to Apache::Constants EXPORT_OK, removed +duplicate HTTP_NOT_ACCEPTABLE entry + +if there is a Perl parse error in sections, return $@ so Apache +can properly report the problem + +Apache::PerlRun subclass-able-ness near complete, see new example +modules Apache::RegistryNG and Apache::RegistryBB + +fix compile problem under aix [Ed Hill ] + +fix 'make test' @INC problem under NT, thanks to Dale Couch + +=item 1.15_01 - September 19, 1998 + +USE_DSO=1 may be fixed on some platforms w/ current 1.3.2-dev +for those who are not, e.g. linux, can try a workaround by giving +PERL_DSO_UNLOAD to Makefile.PL or by setting the PERL_DSO_UNLOAD +environment variable + +fix bug in Apache::Registry if $r->uri eq "/", thanks to Mike Wertheim +for the spot + +Added Doug Bagley's Apache::SizeLimit [Brian Moseley ] + +a Perl syntax error may corrupt the Perl stack, rendering the +process useless, so we now child_terminate() if this is the case +(thanks to Ken Williams for the Apache::Death bug illustration) + + sections will now report configuration syntax errors + +added Apache::SubRequest->bytes_sent method + +added Apache::Server->register_cleanup method + +DYNAMIC=1 works again + +Apache::PerlRun will now save/restore %INC to cure problem with +"library" files that don't include a package delaration + +global renames: $Apache::Server{Re}Starting -> $Apache::Server::{Re}Starting + +s/PERL_TIE_TABLES/PERL_TABLE_API/g + +fix Apache::URI so components can be properly undef-d, thanks to +Charles C. Fu for the spot + + match is now case insensitive, thanks to Randal Schwartz for +the spot + +added Apache::Util::string_size function + +PerlDirectiveHandlers changes: + + -fix Apache::ExtUtils::command_table to properly deal with + inside HASH ref entries + -now looks for a DIR_CREATE() method rather than new() + -dir_merge() must now be DIR_MERGE() + -order of $parms and $cfg args swapped + -added missing FLAG directive handler + -module.name is now the Perl package name, rather than Foo.xs + +add dTHR for PERL_TIE_SCRIPTNAME=1 [Michael Parker ] + +deprecate $r->cgi_{env,var}, $r->subprocess_env can do all that and +them some + +when rwrite() returns -1, break out of the loop, no longer checking +r->connection->aborted + +fix $...NameWithVirtualHost defaulting in Apache::PerlRun +["Ryan A. Whelan" + +r->as_string now uses table_do() and moved to xs + +use 1.3.2-dev+'s ap_custom_response() when possible + +remove Apache::DESTROY method (was only for avoiding old AutoLoader bug) + +Apache::exit fixed under Apache::PerlRun + +fix chdir_file() call in Apache::Registry so we go back to the original +directory [Gerald Richter ] + +added :override :args_how tags to Apache::Constants + +add DIR_MAGIC_TYPE to perl_handlers[] table for directory indexing +modules + +Apache::Log optimizations/enhancements: + $r->log now invokes ap_log_rerror (w/ 1.3.2-dev+) + ${r,s}->log->$method() will now accept a CODE ref as its first + argument, which is only called when LogLevel >= $method + caller() file/line info determined only if LogLevel >= debug + avoid copy of message SV + log() method and aliases now in xs + +tweak Apache->module so it can test for configured .c modules + +pushing out experimental stuff: + EXPERIMENTAL=1 (enables all experiments, except PERL_DEFAULT_OPMASK) + PERL_GET_SET_HANDLERS=1 if PERL_STACKED_HANDLERS + PERL_MARK_WHERE=1, PERL_TIE_SCRIPTNAME=1 if PERL_TRACE + +new $r->server->next method + +removed use of Term::ReadLine in Makefile.PL to make it work on +systems with broken Term::ReadLines installed. +[Ask Bjoern Hansen ] + +fix Makefile.PL and Apache::src to find MODULE_MAGIC_NUMBER in ap_mmn.h + +if PERL_DESTRUCT_LEVEL < 0, skip perl_destruct(), etc. in perl_shutdown() + +add CLOSE method for tied *STD{OUT,IN} + +add config for mod_ssl and 'make test' [Lupe Christoph ] + +PerlInitHandler is now aliased to PerlPostReadRequestHandler when +configured a the "top-level", that is, not within any Location, +Directory or Files, where it is still aliased to +PerlHeaderParserHandler + +PerlCleanupHandler is now run by a register_cleanup(), rather than an +alias for PerlLogHandler + +get rid of warning in Apache::RedirectLogFix [Brian Moseley ] + +added $r->internal_redirect method + +Apache::TieHashTable class enhancements: + + -get() in list context will return all values found for the given key + -merge() and add() will accept an array reference of values + -new method do() + +add -DMOD_PERL to apaci/configure for USE_APXS=1 +[Andrea Borgia ] + +set LD_RUN_PATH in Makefile.PL [Tom Hughes ] + +add =pod config support for '={begin,for} apache ... =end apache' + +move mod_perl_cleanup_av outside of #ifdef PERL_DIRECTIVE_HANDLERS to +cure compile problem spotted by David-Michael Lincke + +Fixed problem with 'POST' requests when using Apache::Include +[Doug Bagley ] + +make $r->connection->remote_ip set-able [Doug Bagley ] + +new experimental options PERL_SAFE_STARTUP and PERL_DEFAULT_OPMASK +when httpd is starting, opcodes will be disabled during PerlModule, +PerlRequire and + + -PERL_SAFE_STARTUP=1 enables PerlOpmask directive + if PerlOpmask is "default", use mask generated from src/opcodes.txt + else it's a file to create the mask in the format of src/opcodes.txt + if no PerlOpmask, no opcodes are disabled + - 'make update_op_mask OPCODE_FILE=my_opcodes.txt && make' + changes the default opmask generated from OPCODE_FILE + -PERL_DEFAULT_OPMASK=1 disables PerlOpmask directive, forces default + opmask on + -PERL_ORALL_OPMASK=1 enables $r->set_opmask method for per-directory masks + -new module Apache::Opcode for generating op_mask + +Fixed Apache::Util::ht_time test (util.t) so it doesn't fail without +any reason + +added $r->finfo method + +Apache::Connection and Apache::Server will not be loaded by default if +a PerlRequire file says: no mod_perl qw(Connection Server); + +Apache.xs cleanups: + + -move Apache::Connection code from Apache.xs to Connection.xs + -move Apache::Server code from Apache.xs to Server.xs + -remove Apache::fork stuff + -remove max_request_per_client method (use Apache::Globals instead) + -make sure server is up before runtests() + +=item 1.15 - July 24, 1998 + +new experimental XS implementation of Apache::PerlRun/Apache::Registry +handlers in module Apache::PerlRunXS (enable with PERL_RUN_XS=1) + +added $r->get_server_name method + +move /tmp/mod_perl_* to t/logs, t/conf + +alias Apache::Util unescape_uri -> Apache::unescape_url + +alias Apache::Log emerg -> emergency, crit -> critical + +deal with PL_ renaming in 5.004_76+ + +fixes to support to apache_1.3.0+ssl_1.19 [Salvador Ortiz] + +add another dTHR so we build/run with threaded Perl again + +USE_APXS fixups: + + -use apaci/find_source instead of hard-coding files in apaci/configure + -re-gen apaci/mod_perl.config before running apache/configure + -chmod 0644, apaci/mod_perl.config + +=item 1.14 - July 18, 1998 + +PERL_DEBUG=1 w/ USE_APACI=1 will properly link against libperld if exists + +remove mod_perl.pm_version file. move Makefile.PL-time generated code +from mod_perl.pm.PL to mod_perl_hooks.pm.PL, remove mod_perl.pm.PL and +ship with a mod_perl.pm again that is not modified by Makefile.PL so +CPAN.pm can 'install mod_perl' again + +added Apache::Util module (enable with PERL_UTIL_API=1 or EVERYTHING=1) + +only break out of the write loop if rwrite() returns -1 and +r->connection->aborted, otherwise continue + +added Apache::URI module (enable with PERL_URI_API=1 or EVERYTHING=1) + +register_cleanup to SvREFCNT_dec handler stacks, otherwise we leak +during kill -USR1 when configuration is re-read + +TAINT_NOT just after perl_run(), otherwise 'make test' may choke (when +it shouldn't): + "Insecure dependency in eval while running with -T switch. + Callback called exit." +[Salvador Ortiz] + +move "rwrite returned -1" message from warn level to debug level + +Makefile.PL fix for 'make test' and --enable-shared= modules + +applied src/modules/perl/Makefile fixup for ApacheSSL +[Iosif Fettich ] + +experimental optimization for Apache::Constants if XS_IMPORT=1 is +given to Makefile.PL: +drop heavy Exporter::import/@EXPORT/@EXPORT_OK/%EXPORT_TAGS for +Apache::Constants::import written in C, shaves ~25K from resident +memory + +=item 1.13 - July 13, 1998 + +fix Makefile.PL setting of numeric $User/$Group for 'make test' +[Michael K. Sanders ] + +giving PERL_STASH_POST_DATA=1 to Makefile.PL will save +read(STDIN, ...)/$r->read data in $r->subprocess_env for logging + +added Apache::Log module (enable with PERL_LOG_API=1 or EVERYTHING=1) + +add mod_perl.pm_version so CPAN.pm can 'install mod_perl' again + +ensure Apache::Server::CWD is untainted + +add support to compile with -DPERL_OBJECT (win32 + 5.004_73+) + +add dir_merge support for directive handlers + +$r->print/print will dereference \$scalar refs to strings so scripts +can avoid string copies when sending data to the client, +e.g. print \$large_string + +set $0 to .conf file name when inside sections + +fixed $r->subprocess_env bug introduced in 1.12, spotted by Ken Williams + +'*CORE::GLOBAL::exit = \&Apache::exit' for 5.005-tobe+ Perls + +perl_startup will now call perl_init_i18nl10n(1), for 'use locale' + +Makefile.PL will now set CFLAGS="$PERL_EXTRA_CFLAGS" with USE_APACI=1 +thanks to help from Vivek Khera + +improve support for Makefile.PL USE_APXS=... to generate modperl.config + +add PERL_TIE_TABLES and PERL_DIRECTIVE_HANDLERS to EVERYTHING=1 group + +add some casts to avoid warnings from const char changes in 1.3.1-dev + +write_client will break out of its loop if rwrite returns a -1 error +condition, which could cause spinning httpds otherwise +[Eric Eisenhart ] + +properly default $Apache::Registry::NameWithVirtualHost=1, +thanks to spot by Ryan A. Whelan + +fix tied $r->err_headers_out cut-n-pasto [Peter Kaas ] + +Apache::read_client_block will now use safemalloc/safefree, rather +than palloc, so memory is released after each read(), rather than at +the end of a request. (e.g. so file uploads don't cause too much growth) + +Added mod_perl_method_handlers.pod file, a little article about using +perl objects with modperl. [ ask@netcetera.dk ] + +Apache::Registry will now save END blocks just after the script is compiled, +instead of after the subroutine call. otherwise, if the client breaks the +connection, the hard_timeout will jump out of perl_handler(), and the save +will never happen. Thanks to Robert Nice and Ben Laurie for spotting this. + +bug fix so PATH_INFO is properly reset, thanks to David Sklar for the spot + +=item 1.12 - June 14, 1998 + +added a long overdue CREDITS file + +add SSLCacheServer{Port,Path} directives for ApacheSSL + 'make test' +[Adam Laurie ] + +added $r->location method + +Various fixes and improvements to the APACI support: + + - Added support for PERL_THREADS to apaci stuff. + This is needed under the bleeding edge Perl's + (e.g. 5.004_6X). + - Avoid more unnecessary file copies and edits under + APACI situation. + - Cleanup the PERL_XXX hooks in apaci/mod_perl.config[.sh] + [Ralf S. Engelschall] + + - Add additional .xs.o target to apaci/Makefile.tmpl to + workaround braindead Makes. + [Brian P Millett ] + +if $r->subprocess_env is called in a void context just call +(void)perl_cgi_env_init(r) + +$ENV{PATH}: don't let perl_clear_env() clear its value + +prevent $r->dir_config SEGV if called during ChildInit, +spotted by Lincoln Stein + +add a dTHR to perl_util.c for threaded 5.004_66 +[Brian P Millett ] + +added $r->get_server_port method + +sfio read will now call Apache::read, as it should. +Thanks to Steve Farrell for the spot + +added $r->last method + +$r->cgi_env when called in a void context will simply setup the +subprocess_env table + +avoid some possible warnings in Apache.pm [Brian Mosley ] + +added $r->request_time method + +fix bug when PERL_MARK_WHERE was undefined spotted by Kermit Tensmeyer + +emulate pre-1.3b6 r->uri/r->proxyreq behavior for proxy requests +inside the post_read_request_handler and add t/internal/proxy test + +added additional installation document INSTALL.apaci which +describes the new APACI stuff (including background information). +[Ralf S. Engelschall ] + +added new (but still optional!) Apache 1.3 support via the new Apache +Autoconf-style Interface (APACI): The option USE_APACI=1 triggers a new +build-environment (from local apaci/) for the APACHE_SRC/src/modules/perl/ +which provides a clean way (i.e. without patching anything inside APACHE_SRC, +not even the Configuration file) of configuring mod_perl via a +APACHE_SRC/src/modules/perl/mod_perl.config file. The completey configuration +is enabled by just using the APACI command "configure +--activate-module=src/modules/perl/libperl.a" +[Ralf S. Engelschall ] + +experimental tie of $0 to Apache->request->filename, enable with +-DPERL_TIE_SCRIPTNAME + +added little Apache::system that redirects output to the browser, +should this be imported into Apache::{Registry,PerlRun} scripts? + +new Apache::Tie module, provides Apache::TieHashTable for a proper +interface to Apache table structures. The following methods, called +in a scalar context with no "key" argument, will return a HASH +reference, where HASH is tied to Apache::TieHashTable: +headers_in, headers_out, err_headers_out, notes, dir_config, subprocess_env +enable with PERL_TIE_TABLES=1 +see also: t/net/perl/tie_table.pl + +remove Cwd::fastcwd usage from Apache::Registry, use +$Apache::Server::CWD set at server startup instead + +new method Apache->chdir_file, use to replace +chdir File::Basename::dirname($r->filename) in Apache::Registry + +replace Apache::Registry use of IO::File w/ Apache::gensym + +new function Apache::gensym (xsub, does same as Symbol::gensym) + +add $ServerRoot/lib/perl to @INC at startup + +add code to deal with 1.3b7-dev's SERVER_SUBVERSION replacement + +a few doc patches [John D Groenveld ] + +re-implemented $r->read to properly use *client_block methods and call +reset_timeout after each read in the loop. until this is well tested, +the method is called new_read. to test on tie'd STDIN reads, a startup +script can say this: +*Apache::READ = \&Apache::new_read; + +added setup_client_block, should_client_block and get_client_block +methods + +modules/cgi test will attempt a fileupload of perlfunc.pod to +file_upload.cgi if HTTP::Request::Common is installed +(libwww-perl-5.09+) and $CGI::VERSION >= 2.39 + +make $r->connection->aborted work as documented again, thanks to spot +by Jens Heunemann + +swap order of stacked handlers so dynamic ones (push_handlers) are +invoked after server .conf configured handlers + +replace uses of SvPVX() with SvPV() to prevent possible core dump if +called with a non-string value + +added COMPILED REGULAR EXPRESSIONS section to mod_perl_traps.pod +[David Landgren , +Mark Mills , +Randal Schwartz , +Jens Heunemann ] + +have ldopts yank ExtUtils::Liblist message: + Note (probably harmless): No library found for ... +from stdout to stderr [Stas Bekman ] + +change Apache.xs/typemap so classes who inherit from the Apache class +can invoke methods with a hash object, provided $hash->{_r} contains a +request_rec object + +additions to experimental Perl directive support: +- a per-directory config object is now passed as the first argument + to directive handlers registered via Apache::ExtUtils->xs_cmd_table + the object is a hash reference blessed into the same class as the handler +- $r->dir_config with no args now looks for per-directory config in + the caller's namespace +- xs_cmd_table now looks for a prototype to determine TAKE1, + TAKE2, TAKE3, etc. + +added $Apache::CurrentThreadId variable under win32 + +added method/object handler tests to internal/stacked test + +fixed broken modules/eperl test spotted by Tom Mornini + +fixed Makefile.PL bug spotted by Jon Drukman w/ PERL_CHILD_EXIT=1 +in fact, PerlChildInitHandler/PerlHandlerExitHandler are always +enabled by default now with 1.3bx+ + +added experimental get_handlers/set_handlers methods +(enable with PERL_GET_SET_HANDLERS=1) + +new module Apache::PerlRun, splits out Apache::Registry functionality +and provides a `dirty-perl' handler (see pod). thanks to Stas Bekman +for testing and suggestions. + +PERL_OBJECT_HANDLERS now enabled #ifdef PERL_METHOD_HANDLERS + +widen scope of mutex lock under win32 to avoid possible deadlock +[Gerald Richter ] + +fixed bug in directory_merge where FLAG directives would inherit `On' +from the base configuration, even if the directory explicitly had the +flag turned `Off', this was the case for PerlSendHeader and +PerlSetupEnv. thanks to Mark-Jason Dominus for the spot. + +added `grab' function to Apache::test, which fetches a url and gives +diagnostics as to validity of the HTTP response +(a test for properly formatted headers!) + +=item 1.11 - April 21, 1998 + +Apache::SIG enhancements for LogFormat [Doug Bagley ] + +drop API_EXPORTs for mod_include #perl stuff which breaks under win32/1.3b6 +spotted by Jeff Baker + +Inclusion of $r->server->server_hostname if $r->server->is_virtual in +Apache::Registry script namespaces is back to On by default after +recently tripping up Ben Laurie, Janos Farkas, Tony Bowden. To +disable (only gain is to conserve memory) in a startup file set: + $Apache::Registry::NameWithVirtualHost = 0; + +work around bloody make problem "don't know how to make Apache.c Constants.c" +spotted on SCO by Krister Keskitalo (along w/ 1-2 others in the past) + +fix Makefile.PL for apache-1.2.6+ssl_1.16 +[Stefano Santoro , Dan Peterson ] + +removed obsolete src/Makefile.tmpl and src/Makefile.tmpl-Ben-SSL files + +new module Apache::ExtUtils, currently with one method to generate xs +code so Apache/Perl modules can add their own directives to Apache rather +than use PerlSetVar (just some more rope, really) + +1.3b6 compat: +- deal with ap_ API prefixing +- t/modules/embperl will warn on failure: +>>> NOTE: Be sure to rebuild HTML::Embperl against Apache 1.3b6+ +>>> Try 'make test' again after doing so. + +experimental: #ifdef PERL_OBJECT_HANDLERS, mod_perl will thaw objects +from Perl*Handler strings such as `$Global::Object->method' + +$r->custom_response will now work under win32 with 1.3b6-dev+ + +added win32 test enhancements suggested by Gerald Richter + +added mod_perl_cvs.pod document + +=item 1.10 - March 21, 1998 + +rid of SEGV in PerlChildExitHandler spotted by Eric Cholet + +#ifdef USE_THREADS, don't hard_timeout/kill_timeout, SIGALRM causes hangage + +=item 1.09 - March 19, 1998 + +rid of stupid "can't bootstrap Apache::Constants outside of httpd" message + +added r->content_languages method + +added htdocs/manual/mod/mod_perl.html (generated from Apache::ModuleDoc) + +now support under win32 (requires 1.3b6-dev+) + +PerlChildExitHandler is now implemented via register_cleanup() rather +than the module child_exit hook (which might go away!) + +support Apache::Constants tags `override' and `args_how', for Apache::Module + +'make test' will now work again under win32 + +applied Apache::Symbol/Apache::StatINC patches from Chris Dean + +fixed bug in Makefile.PL that would tack `aix' onto INCDIR w/ apache +1.2.x, spotted by Mike Klein + +removed uneeded check for HTTP_AUTHORIZATION from perl_setup_env() + +fixup perl_section_self_boot so it doesn't try to read config +if keys %Apache::ReadConfig:: < 1 + +perl_section_self_boot thang will now work w/ PerlRequire'd files too + +compile @Apache::Constants::EXPORT subroutines at boot time (rather +than AUTOLOAD in each process) + +added internal/error.t test to test the new feature below + +ErrorDocument's can now access the $@ that threw SERVER_ERROR via +$@{ $r->prev->uri } + +added internal/rwrite.t test to test printing of HUGE strings + +1.3b6 compat: +- tmp fix for new r->server->names type +- adapt to SERVER_BUILT change to apapi_get_server_built() + for Constants.xs + +fixed print $HUGE_buffer bug w/ ApacheSSL spotted by Jirka Hejsek + +added WRITE method for tied filehandles + +fix so threaded Perl can have sections + +Perl 5.004_61 dropped -DUSE_THREADS from $Config{ccflags}, Makefile.PL +will now test $Config{usethreads} and add the flag itself + +fixed eg/registry.pl sytax erros thanks to David Landgren + +fix #ifdefs so we build under win32 again + +config files now support =pod/=cut and __END__ in the same fashion Perl does + +fix Makefile.PL so it can handle \'ed lines with help from Tom Hukins + +Apache::Symbol::handler will skip all Devel::Symdump undef's so +make_universal will work properly + +=item 1.08 - February 20, 1998 + +Apache::Registry will now fold multiple /'s to fix possible bug +spotted by Gerald Richter + +fix Apache/Makefile.PL and Constants/Makefile.PL so DYNAMIC=1 works +with 1.3b5 (new include directory) + +Constants.xs will now #include mod_perl.h so namespace #undefs are used + +fixup some #define clashes on aix thanks to Eric Bartley + +fixed Makefile.PL workaround for plucking SSL_INCLUDE with help from +Dan Peterson + +can build again with threaded Perl (was just missing a few dTHR's) + +cleared up BEGIN/END documenation with help from John Charlesworth + +applied patch from Christopher McCrory so -f is also used when 'make +test' httpd is started so it'll work with a .rpm file for a redhat +linux + +added Apache::Constants->name method + +fix an #endif; in mod_perl.h thanks to Eric Bartley + +mod_perl_cleanup_handler won't try to if(cld) MP_RCLEANUP_off(cld); +#ifdef WIN32 to stop crash spotted by David Hodson + +expose stacked handlers to Perl via %Apache::PerlStackedHandlers +(this is only those pushed via $r->push_handlers) + +can now tell Makefile.PL APACHE_INCLUDE_INSTALL=0 if you don't want +header files installed + +when Apache::Status tries to load optional modules, it will locally +turn off $SIG{__DIE__} to fix bug spotted by Dan Peterson + +added SERVER_BUILT to Apache::Constants + +got rid of "Use of uninitialized value." warning in perl_util.c seen +when running HTML::Embperl, hunted down by Todd Eigenschink and Gerald +Richter (listed as change in _04, but was lost!) + +fixed Makefile.PL so it can deal with metacharacters when copying the +apache source include files, otherwise src.pm breaks, thanks to Dan +Peterson for the spot + +=item 1.07_04 - February 10, 1998 + +fix "building mod_perl by hand" bug w/ 1.3bx spotted by Brian Mosley + +no longer force 'PerlSendHeader On' for sub-requests which triggered a +bug spotted by Doug Bagley and Gerald Richter + +Fix "Attempt to free unreferenced scalar." during kill -HUP w/ +PerlFreshRestart On and in httpd.conf spotted by Brian Mosley + +clear endav and stacked_handlers on FreshRestart + +fix bug spotted by Gerald Richter where Apache->register_cleanup would +cause a core dump + +Apache->module will no longer eval "require $module", it will now +return true if the module is in %INC, false otherwise + +fix so END blocks encountered at startup are run at shutdown +(I think one of the 1.07_xx version broke it) + +If exists, Makefile.PL will add /usr/local/stronghold/conf/httpd.conf's +StrongholdKey to t/conf/httpd.conf for 'make test' for you + +Makefile.PL will edit Stronghold's Makefile to replace: +"CFLAGS=$(CFLAGS)" with 'CFLAGS=$(CFLAGS)' so the SUBVERSION thang works + +fix $r->custom_response problem spotted by Brian Mosley so it works +with SERVER_ERROR + +added new method child_terminate + +fix $r->current_callback so it can be called during startup + +perl Makefile.PL PERL_DEBUG=1 will: +-add `-g' to EXTRA_CFLAGS +-turn on PERL_TRACE +-set PERL_DESTRUCT_LEVEL=2 +-link against libperld if -e $Config{archlibexp}/CORE/libperld$Config{lib_ext} + +Apache::Constants :common export tag no longer includes +OPT_EXECCGI (was held off from 1.07_01's Changes Apache::Constants +cleanup waiting to make sure HTML::Embperl and Apache::ePerl didn't +rely on OPT_EXECCGI to be exported by default. both look fine now) + +added workaround Apache::RedirectLogFix module to work around the +re-introduced log bug below + +to fix a double-header send bug spotted by Doug Bagley, backed out +this Change from 1.06: + Apache::Registry will return REDIRECT if $r->header_out("Location") + so the request is logged properly, thanks to spot by Jon Drukman + +added experimental PerlRestartHandler +(enabled with PERL_RESTART_HANDLER=1, note: _not_ enabled with EVERYTHING=1) + +moved Apache::sv_name function to the new Apache::Symbol package + +Apache::StatINC will call Apache::Symbol's undef_functions method for +.pm classes if PerlSetVar UndefOnReload is On + +before re-compiling, Apache::Registry will now check if +$package->can('undef_functions'), if so, invoke that method + +added Apache::Symbol module with an undef_functions method + +Apache->server_root_relative now defaults to "" when no +filename/directory name argument is given (ie returns ServerRoot) + +made PERL_TRACE more useful with levels set via environment variable +MOD_PERL_TRACE: +d - trace directive handling during config read +s - trace processing of perl sections +h - trace Perl*Handler callbacks +g - trace global variable handling, intepreter allocation, END blocks, etc. +all - all of the above + +will add -DSTRONGHOLD to CFLAGS if build against stronghold, thanks to +Todd R. Eigenschink + +fix Makefile.PL's parsing of SERVER_SUBVERSION, spotted by Paul Sutton + +$r->send_http_header can now accept an optional second argument, if +present will set $r->content_type + +PerlPassEnv, PerlRequire and PerlModule now use an array_header +structure for internal storage + +1.3b4 compat: +- adapt to new table api changes (with help from Rob Hartill and Dean Gaudet) +- adapt to *.h move to the new src/include directory + +Apache::Status enhancements: +- "Loaded Modules" will now report last modified time +- "packages" are now links, click, symbol table dump +- now that packages are links, no longer do recursive dump + (recurse yourself via hyperlinks, much easier to read!!!) +- hashes, scalars and arrays are now links, + click, Data::Dumper Dump (only if PerlSetVar StatusDumper is On) +- functions are now links, click, subroutine info (requires the B module) +- dump of any type also has a link "Peek Dump" + (only if PerlSetVar StatusPeek is On and Apache::Peek is installed) +- dump of any type also has a link "OP Tree Graph" + (only if PerlSetVar StatusGraph is On) + (requires the B and B::Graph modules and the dot program) +- added t/modules/status test + +with the -DPERL_MARK_WHERE experimental feature enabled, there's a +chance you'll never see "Use of uninitialized value." again without +some more useful information, nor will you see '-e' reported outside +of Apache::Registry + +perl_destruct_level can now be set via the environment variable +PERL_DESTRUCT_LEVEL or -DPERL_DESTRUCT_LEVEL + +turn default perl_destruct_level down from 2 to Perl's default of 0 + +use a copy of apache's ap_cpystrn against versions < 1.3b4-dev + +got rid of "Use of uninitialized value." warning in perl_util.c seen +when running HTML::Embperl, hunted down by Todd Eigenschink and Gerald +Richter + +added modules/src test for Apache::src + +documented Apache::src + +the Apache::src->new method will now default to the first +auto/Apache/include directory found relative to @INC + +the apache header files (*.h) will now be installed in +$(INST_ARCHLIB)/auto/Apache/include + +fix $Apache::ServerStarting bug that broke 'make test' w/ ApacheSSL +and Stronghold spotted by Vivek Khera + +remove the need for File::Copy's mv() function, since it can't seem to +decide if it has one or not + +_03's new tests assumed PerlCleanupHandler was enabled, fixed now +thanks to spot by Rob Hartill + +Makefile.PL will now chmod a+x t/net/perl/* t/net/perl/io/* +thanks to Rob Hartill + +experimental features can be enabled with -DDEFINEs instead of +$variables or %ENV, changes to Makefile.PL make them simple to add, +see eg/makepl_args.mod_perl for even simpler + +added eg/makepl_args.mod_perl + +the makepl_args.mod_perl can now have multiple lines, space, #comments +and empty newlines are ignored, stops reading if it hits __END__ + +Makefile.PL will now also look for $ENV{HOME}/.makepl_args.mod_perl +and read in if exists + +before clearing handlers stacked via Apache->push_handlers at the end +of each request, save the PerlChildExitHandler stack and putback after +the clear. this way, modules pulled in at server startup can say: +Apache->push_handlers(PerlChildExitHandler => sub {}) + +a "top-level" mod_perl per-directory directive would cause core dump +inside sections. now trap that and exit with message that the +directive should be inside a containter e.g. %Location, %VirtualHost +(not sure what the real problem is here) + +re-work PERL_SECTIONS_SELF_BOOT stuff so it calls perl_section() directly, +rather than perl_eat_config_string("\n"), because: +- it no longer core dumps when a "top-level" per-server directive is found +- it no longer requires 1.3b3+ (1.2.x will work) +- it is faster + +PerlModule/PERL_SECTIONS_SELF_BOOT will delete $INC{$PerlModule} on +the first config read pass, so it's re-read on the second pass + +if ($] < 5.004_04) Makefile.PL will warn that users should upgrade to +5.004_04 or higher + +removed Apache::PerlSections' self test now that we have +modules/psections.t and it won't work without the =pod line. + +remove =pod line from Apache:: modules (SIG, fork, Resource, +PerlSections) to stop 5.004's pod2man's bogus warnings spotted by +Eric Cholet + +fixed but in $r->get_remote_host, which was forcing the default type +REMOTE_NAME even if another type was passed as the optional second argument + +renamed eg/perlio.pl to eg/test.pl + +moved SUPPORT section from INSTALL doc to its own file + +fixed auto-set of $ServerRoot bug in Apache::httpd_conf + +get rid of -Wall warning in Apache::sv_name + +=item 1.07_03 - January 8, 1998 + +removed "[notice] mod_perl restarted" message since it doesn't go to +the error_log as it should, spotted by Vivek Khera and Paul Phillips + +fixed corrupted $ENV{TZ} spotted by Michael Parker + +cut out 'make test' error_log noise, anything there now should only be +an error or a non-error [notice] + +make Apache::Resource simpler to configure, to use w/ all defaults +(1.3bx + PerlChildInitHandler required): +PerlSetEnv PERL_RLIMIT_DEFAULTS On +PerlModule Apache::Resource + +Makefile.PL will now: +mv "t/conf/httpd.conf", "t/conf/httpd.conf.old" +so httpd.conf is re-generated when Makefile.PL is re-run + +added new module Apache::src for finding it and picking out bits-n-pieces + +get rid of some section warnings with help from Doug Bagley + +improved register_cleanup tests + +applied $r->register_cleanup patch from Doug Bagley to properly call +MP_RCLEANUP_off after cleanups are run + +perl Makefile.PL can now accept ADD_MODULE, Makefile.PL will (s/,/ /g) +and uncomment the list of modules from src/Configuration + e.g.: + ADD_MODULE=unique_id,proxy,info + +perl Makefile.PL can now accept PERL_EXTRA_CFLAGS, Makefile.PL will +(s/,/ /g) which are added to EXTRA_CFLAGS + e.g.: + PERL_EXTRA_CFLAGS=-DFOO=1,-DBAR=2 + +if the file `makepl_args.modperl' is present in . or .. it will be read into +@ARGV, e.g. might contain EVERYTHING=1 DO_HTTPD=1 + +fixes for 1.3b4-dev compat +- get rid of AuthName space in generated .htaccess file for + internal/hooks test + +if a PerlModule defines something in %Apache::ReadConfig +sections are run without need to actually have in +httpd.conf, i.e. httpd.conf could be nothing more than: + PerlModule Apache::httpd_conf +whilst experimental, enable by setting the envrionment variable +PERL_SECTIONS_SELF_BOOT to something true + +experimental feature, modules can 'exit|die AUTH_REQUIRED;' or with +any HTTP error code and that response is sent rather than SERVER_ERROR +to test enable by setting $Apache::ERRSV_CAN_BE_HTTP = 1 + +take CGI.pm version check out of Apache::Registry, now that we require +5.004+, they'll have at least 2.36 + +get rid of "Use of uninitialized value at -e line 65535" warning +caused by perl_run_rgy_endav() spotted by Doug Bagley + +if there is an error inside , filename and line number are now +displayed in the error message, e.g. +syntax error at t/conf/httpd.conf line 25 + instead of +syntax error at (eval 1) line 2 + +Apache::RegistryLoader->handler will now strip leading '/' when $uri is +server_root_relative and no $filename is present + +Apache::Status menu item "Perl Section Configuration" +(only if $Apache::ReadConfig is true) + +added Apache::Status menu item "Enabled mod_perl Hooks" + +added mod_perl.pm functions hook() and hooks() + +go back to internal sections package name ApacheReadConfig + +Apache::PerlSections stuff: +- added handy store method for writing dump() to disk +- fixed self-test +- updated docs to reflect new output format + +Apache::test stuff: +- added run method +- added MM_test method for Makefile.PL's to say: + *MY::test = \&Apache::test::MM_test + +some httpd_conf.pm stuff: +- added server_url method +- added catch_signals method to terminate httpd on __DIE__ or INT + ($conf->server_start calls this by default) +- when httpd.conf is written, set BaseDir in a BEGIN block +- drop trailing slash from Alias' +- fix write() method's assignment of %$self to *Apache::ReadConfig:: + +fix possible core dump when calling gv_fetchmethod() + +=item 1.07_02 - December 22, 1997 + +fixed perl.exp thang on aix + +added tests t/modules/httpdconf.t and t/modules/perlsections.t + +added Apache::httpd_conf module + +if variable $Apache::ReadConfig is true, don't undef the +section eval package %Apache::ReadConfig:: + +output of Apache::PerlSections->dump is now suitable to be eval'd + +added Apache->httpd_conf method (just pushes into +@Apache::ReadConfig::PerlConfig and requires 1.3b3+) + +renamed package sections are proccessed in +from ApacheReadConfig to Apache::ReadConfig + +ensure values of %Location keys, etc. in sections are HASH refs +to stop possible core dump spotted by Stuart Frew + +fixed memory leak in $r->push_handlers() with help from Gerald Richter + +added new items to Apache::Status: "Environment", +"Perl Configuration", and "Signal Handlers" + +when %ENV is setup, my_setenv() is now called so subprocesses will inherit + +"top-level" PerlSetEnv variables will now be set during server startup + +got rid of unintialized warning in Apache::Status + +$r->custom_response will now add the `"' needed if arg is not a url or +filename + +added new Constants CONTINUE and NOT_AUTHORITATIVE as aliases for DECLINED + +change the `PerlScript' directive name to `PerlRequire' as suggested +by Dick Hardt (PerlScript will still work, but is not documented) + +set variable $Apache::ServerStarting to 1 during perl_startup() + +set variable $Apache::ServerReStarting to 1 during perl_restart() + +Apache::SIG->set is now called at server startup by default + +applied patch from Doug Bagley to stop possible infininite loop in +Apache->read + +create stacked_handlers = newHV() before modules are loaded, +so PerlModule's can do things like: + Apache->push_handlers(PerlChildInitHandler => sub { + srand(time ^ $$); + }); + +$r->args can now be modified as suggested by Joel Truher + +remove obsolete (and broken) iedit of t/net/perl/cgi.pl thanks to +Vivek Khera + +Apache::Resource now correctly converts MB values + +=item 1.07_01 - 12/1/97 + +added t/internal/stacked test + +updated the FAQ from Frank Cringle + +added Apache::fork module which override's Perl's built-in fork() and +provides a forkoption function, contributed by Michael Turner + +can now build/run w/ 5.004_55 threaded Perl + +added Apache::Status item for PerlScripts + +there can now be multiple PerlScript files in *.conf and .htaccess +(same behavior as PerlModule) + +ServerRoot is now pushed into @INC at server startup + +filename argument to log_reason is now optional, defaults to $r->uri + +Apache::Constants cleanup: + - @EXPORT now only holds items in :common + - re-organized tags (adding some new ones) + - added some documentation! + +$r->get_remote_host can now take an optional type argument, default is +still REMOTE_HOST, other valid options are Apache::Constants :remotehost + +added new Apache::Constants tag :remotehost (for $r->get_remote_host) +with new constants: + REMOTE_HOST REMOTE_NAME REMOTE_NOLOOKUP REMOTE_DOUBLE_REV + +added new Apache::Constants tag :satisfy (for $r->satisfies) +with new constants: + SATISFY_ALL, SATISFY_ANY, SATISFY_NOSPEC + +added new method $r->satisfies + +added new method $r->some_auth_required + +`METHODS' Apache::Constant added to import tag :methods + +perl_stdout2client() will now set $| instead of perl_handler(), so +thanks to Salvador Ortiz for the tip + +PerlSetEnv will now call my_setenv() underneath thanks to Tim Bunce +for the tip + +fix mod_perl_traps.pod typo so it can install, spotted by Brian Tiemann + +=item 1.07 - 11/25/97 + +added notes from Larry Denneau and Michael Smith on building with +mod_auth_dbm to mod_perl_traps.pod + +added $r->custom_response method + +$r->proxyreq can now be set + +'use Apache qw(warn);' will now work during server startup + +fixed loading of PerlScript, so errors are reported! +(your PerlScript must "return a true value") + +fix TEST.win32 thanks to Peter Tillemans + +s/DEFAULT_RSS_LIMIT/DEFAULT_RLIMIT_RSS/ in Apache::Resource +thanks to Jarkko Hietaniemi + +fix Apache::RegistryLoader bug spotted by Brian Mosley + +changed "Options ExecCGI" to "Options +ExecCGI" in httpd.conf-dist to +fix problem in 'make test' seen by Frank Ridderbusch + +=item 1.06 - 11/20/97 + +fixed core dump seen under linux if PerlChild{Init,Exit}Handler is +defined (bug was introduced in 1.05 when PerlDispatchHandler was added) + +added new module Apache::Resource + +fix core dump in $r->notes when val is an IV, spotted by Dwayne Fontenot + +get rid of "use of uninitialized value" from pointed out +by Joel Wagner + +fixed strict refs bug in Apache::PerlSections spotted by Brian Mosley + +Apache::Registry will return REDIRECT if $r->header_out("Location") +so the request is logged properly, thanks to spot by Jon Drukman + +call mod_perl_pass_env() during perl_startup() so PerlScript and + sections can see PerlPassEnv variables + +mkdir t/logs so we can run tests with ApacheSSL + +Makefile.PL will add -I$(SSL_BASE)/include to EXTRA_CFLAGS for ApacheSSL + +fix core dump with 1.3b3-dev + +=item 1.05_01 - 11/15/97 + +If Apache::SIG is set, don't install the default $SIG{PIPE}="IGNORE" + +added PerlPassEnv directive suggested by Joel Wagner + +stop core dump in Apache::exit spotted by Joel Wagner if called as a +function, too early (before PerlHandler) without having called +Apache->request($r) + +fixed bug spotted by Roland Friedwagne where CGI.pm-2.37bx's header() +method (Apache->send_cgi_header underneath) would not work unless +PerlSendHeader was On (added new tests to internal/headers.t to make +sure from now on!) + +applied patches from Peter Tillemans so we can run the test suite +under win32 + +applied win32 patches from Peter Tillemans so perl_handler() is mutex +locked and to cut out Makefile.PL attempt to symlink the eg directory + +Apache::test will define the bootstrap method for Apache and +Apache::Constants to quiet 'make test' noize spotted by Andreas + +=item 1.05 - 11/06/97 + +no longer include $r->server->server_name as part of the +Apache::Registry uri->package name translation by default. if you +*really* need this to happen set this in PerlScript: + $Apache::Registry::NameWithVirtualHost = 1; +and, please tell me why you need it, we'll figure out a better way + +yanked DeleteINC thingy from StatINC + +applied patch from Randal Schwartz so StatINC doesn't loop when it has +to reload itself + +disable CV cache of stacked handlers for now, they stick around too +long, e.g. Apache::StatINC won't work, thanks to Randal Schwartz for +spotting this + +applied patch from Ben Reser so $r->send_fd returns the length (as it +should have been doing) + +added current_callback() method handy for PerlDispatchHandler's + +added suggestion from Andreas for a PerlDispatchHandler hook + +re-worked code in perl_load_startup_script() that was causing IRIX 6.x +to choke when saving dowarn, thanks to Lasse Petersen for tracking +this down + +fixed newline eating bug spotted by Eckard Brauer when headers and +body are sent in the same print() statement + +renamed 'core' test directory to 'internal' + +remove t/TEST's search for obsolete directories, which caused trouble +on IRIX 6, spotted by Lasse Petersen + +for internal redirects (spotted by $r->cgi_header_out), don't +perl_call_halt(), instead, tie STDOUT to the Apache::FakeRequest class +which just soaks up print() output. + +suggestion from Salvador Ortiz, for table methods, if value is +undef, call table_unset underneath, these methods are subprocess_env, +header_in, header_out, err_header_out, notes and dir_config. e.g.: + + $r->header_out("Content-length" => undef); + +ensure constant subroutine re-definition warnings are surpressed +during restart (when PerlFreshRestart On), spotted by Vivek Khera + +added Apache::FakeRequest module + +added tests for embperl and eperl + +applied patch from Lupe Christoph so Makefile.PL will not throw out +-DSERVER_SUBVERSION if present in apache_x.x.x/src/Configuration + +fixed bug in Apache->send_cgi_header that was sending headers twice +with "here" docs, spotted by Leonard Megliola + +Apache->server->log_error will return undef if logs are not open yet +as suggested by Mike Fletcher + +fixed typo bug in Apache::Status spotted by Brian Tiemann + +=item 1.04 - 10/30/97 + +PerlScript and -Mmod_perl are no longer handed to perl_parse(), +instead perl_parse() gets a -e to set $ENV{MOD_PERL} and +$ENV{GATEWAY_INTERFACE} (and possibly other switches -T, -w) +PerlScript is pulled in via 'do $PerlScript'; + +applied patch from Ron Hawkins to fix bug in perl_setup_env() when +running with Stronghold in secure mode + +added Apache::PerlSections module, currently with one method: dump() + +for use in sections, PerlScript and PerlModules, can now say +'my $s = Apache->server' during server startup, which returns a +server_rec* blessed into the Apache::Server class just as $r->server +does during request time. + +Apache::Server class can now warn() and log_error() + +avoid using LWP::Simple so we don't get caught up on HTTP_PROXY which +was cause 'make test' to fail several tests for some people. +thanks to Philippe Froidevaux, Tom Hughes and Frank Cringle + +added some 3rd-party tests for Apache::Stage and Apache::Sandwich + +added Apache::test module + +back out support for internal redirects, caused big problems with +sfio-enabled Perl spotted by Lupe Christoph and Salvador Ortiz +(can still try by setting $Apache::DoInternalRedirect=1 #ifndef USE_SFIO) + +added Apache::SIG module for testing + +Apache::exit will not rflush if r->connection->aborted + +updated Vivek's mod_perl_tuning.pod + +now that 1.3b3-dev config gears are not tied so tight to a FILE*, + sections may define $PerlConfig and/or @PerlConfig, who's +string values are fed to the apache config + +some mod_perl.pm fixes + +Apache::Status "Loaded Modules" item enhancements: +-now shows file location +-can click on module package for dump of its symbol table +-pretty table format + +don't add -I. to perl_startup() which may cause confusion spotted by +Mike Fletcher + +make _sure_ perl_per_request_init() is called for sub-requests so +everything works properly, e.g. Action or a mod_include'd #perl +thanks to Peter Levart and Scott Holdren for spotting this + +=item 1.03 - 10/23/97 + +configure/build/INSTALL enhancements with much help from Bowen Dwelle: +- to use an apache Configuration file that mod_perl will not edit: + perl Makefile.PL CONFIG=Configuration.custom + +- perl Makefile.PL DYNAMIC=1 ALL_HOOKS=1 ... + Configure mod_perl with ../apache_1.2.4/src ? [y] + Shall I build httpd in ../apache_1.2.4/src for you? [y] n + now, $APACHE_SRC/modules/perl/Makefile will be enabled with those hooks + +- to aid EXTRA_CFLAGS when building by hand or using a custom + Configuration file: `perl -Mmod_perl -e subversion` prints: + SERVER_SUBVERSION=\"mod_perl/$mod_perl::VERSION\" + +- fixed up INSTALL quite a bit + +added $r->post_connection alias for $r->cleanup_handler + +if 1.3b2+, drop log_error(), use new aplog_error() instead (everywhere) + +if Tie::IxHash can't be loaded for sections, don't complain + +applied patch from Rob so mod_perl.pm is in the tar_Apache target + +removed Apache->request depreciation warning + +added redirect.t test to test remote redirect and internal redirects + +fixed internal re-direction handling of Location: /local/file.html + +removed several eg/ scripts that were "ports" of CGI.pm-x.xx/examples +now that CGI.pm runs solid under mod_perl and mod_perl requires +5.004+, there's no need for $r->print and CGI::Switch, so those +examples don't need "porting" + +force 'PerlSendHeader On' for sub-requests, e.g. Apache::Sandwich +so headers don't show up in the browser + +fixed PerlSendHeader bug with virtual includes spotted by Scott Holdren + +make lib/mod_perl.pm -> mod_perl.pm symlink (for 'make test') relative, +suggested by Bowen Dwelle + +applied patch from Andreas to add a new $r->subprocess_env method + +fixed Apache::StatINC brokeness spotted by Bowen Dwelle and applied a +StatINC doc patch from him too + +fixed bug with PERL_TRACE=1 spotted by Jimmy Oh + +restarting httpd ala kill -HUP will now reload all modules and flush +the Apache::Registry cache +(must set 'PerlFreshRestart On' in httpd.conf for this to work) + +=item 1.02 - 10/17/97 + +have Makefile.PL edit t/net/perl/cgi.pl's #! line to fix perl location +thanks to Frank Cringle for spotting this + +=item 1.01 - 10/16/97 + +removed undocumented auto-import of qw(OK DECLINED) use to short-cut +Perl*Handlers and/or apache C handlers, use Apache::OK and +Apache::DECLINED instead + +start perl interpreter with -Mmod_perl so _every_ module no matter +where it's loaded from will see $ENV{GATEWAY_INTERFACE} and $ENV{MOD_PERL} +Thanks to Mark Dedlow for illustrating this need with Apache::DBI and friends. + + section %Hash values of hash refs now go through +perl_handle_command_hv(), so `Location' can be inside %VirtualHost, +etc. Thanks to Ask Hansen for spotting this. + + section %Hash values of array refs now go though +perl_handle_command_av(), so proper action is used on TAKE1, etc. + +if Tie::IxHash is available, tie section %Hashes to it, so the +apache config routines get info in the order it needs to. Thanks to +Rob Hartill and Dean Gaudet for explaining this need for 1.3bx's +new virtual host features + +include the mod_perl logo image (mod_perl.gif) + +ensure _all_ stacked handlers registered with $r->push_handlers() are +cleared after each request to fix bug spotted by Peter Lister + +test suite will now delete $ENV{HTTP_PROXY} before running, +thanks to Frank Cringle + +Apache::Registry args changes: +-$_[0] is the blessed Apache request_rec +-$_[1..-1] are args from Apache::Include::handler or elsewhere + as suggested by Andreas + +added tests for Apache::Include + +applied Apache::Registry optimization patch from Andreas + +Apache/Apache::Constants no longer ISA Exporter, +just alias *import = \&Exporter::import + +test suite re-org + +write a mod_perl.pm so we can require a mod_perl min version +and hooks/features ala + use mod_perl 1.01; + use mod_perl 1.01, qw(Authen Authz); + +new Apache::RegistryLoader to pre-load Apache::Registry scripts + +added Apache::Include->virtual($uri) method + +1.3b1 stuff: +-cat apache_x.x.x/src/Makefile.config and src/modules/perl/Makefile + together so we get $(INCLUDES) (for os/unix, etc) + +applied patch from Salvador Ortiz so calling $r->args in an +array context will not produce "Odd number of elements in hash list" + +$r->auth_name can now be modified + +remove Apache->send_cgi_header's broken internal re-direct handling +spotted by Debby Fu + +added Frank Cringle's mod_perl FAQ + +added mod_perl_tuning.pod document from Vivek Khera + +fixed bug spotted by Brian Millett so stacked handlers work again with +Apache-SSL + +set environment variable `MOD_PERL' so scripts can say: +if(exists $ENV{MOD_PERL}) { ... + +added suggestion from Rob Hartill: +'PerlSetVar MaxModPerlRequestsPerChild 10' behaves like +MaxRequestsPerChild, but counts mod_perl requests only. 1.3b1-dev+ is +needed for this + +=item 1.00_03 - 09/21/97 + +save %SIG before perl_handler (Apache::Registry) is run, restore +afterwards as suggested by Randal Schwartz + +fixed virtual host/Apache::Registry bug introduced in _02, +spotted by Ryan A. Whelan + +a few win32 fixes: +- skip uid,gid,etc., in perl_init_ids +- fix ApacheModulePerl.dsp for source re-org + +if PerlSendHeader is On, the environment variable PERL_SEND_HEADER is +set to `On' + +=item 1.00_02 - 09/15/97 + +1.3b1 stuff: +- $r->warn and $r->log_error go through new aplog_error() function. + If `LogLevel' is not set to `warn' or higher, $r->warn messages are + ignored (not sent to error_log). + (i.e. $r->warn == APLOG_WARNING, $r->log_error == APLOG_ERR) +- always enable child_init/child_exit + + use child_init for perl_init_ids() + + use child_exit to: + -run END blocks suspended at server startup + -run perl_destruct(), now global objects will be DESTROYed +- make sure mod_include can find modules/perl/mod_perl.h if PERL_SSI=1 +- fix INCDIR in src/modules/perl/Makefile +- rename libmodperl -> libperl for new Configure changes +- added PerlPostReadRequestHandler hook for new api phase +- make Makefile.PL deal with source re-org +- is_matchexp -> is_fnmatch (perl_config.c) +- #undef die to resolve conflict spotted by Rob Hartill + +applied Apache->read patch from Evert-Jan Couperus to use lvalue +substr() instead of .= + +Apache->seqno will no longer dig into scoreboard info for rec.my_access_count +the seqno method was originally introduced for CGI.pm, which now uses +$r->register_cleanup instead. It was never documented in Apache.pm, +does anyone actually use Apache->seqno? + +perl_section() will call perl_startup() if Perl's not running already, +as suggested by Rob Hartill + +included t/conf/httpd.conf.pl for testing , which can replace +t/conf/httpd.conf if you've configured with PERL_SECTIONS=1 + +removed undocumented Apache::Registry->push_cleanup method + +various documentation updates +- document END blocks behavior +- added "Additional memory tips" section to mod_perl.pod +- added mod_perl_traps document +- Apache.pm docs patch from Gisle Aas +- cgi_to_mod_perl.pod suggestions from Ben Laurie +- other stuff here-n-there + +applied patch from Ulrich Pfeifer so Makefile.PL does not eat args for +MakeMaker, e.g. PREFIX=~ + +mod_perl now requires Perl version 5.004 or higher + +hookup STDERR to error_log first chance we get (first Perl*Handler +that's called) + +$r->warn and $r->log_error will now join @_ and log one string instead +of calling log_error foreach @_, suggested by Joel Wagner + +PerlScript may now be relative to ServerRoot + +remove UNIVERSAL::AUTOLOAD from Apache::Debug (more trouble than help!) + +make sent_header variable per-directory instead of global + +added $r->bytes_sent method suggested by Maurice Aubrey +along with code from Nathan Torkington to make sure we get it right as +mod_log_common does + +added fix to Apache::Include from Randal Schwartz so $r->uri is +properly reset + +SetEnv PERL5LIB will now work on a per-directory basis thanks to spot +by Vivek Khera + +if PERL_SSI=1 only do `perl -MExtUtils::Embed -e ccopts` once instead +of for every .c file! nudge from Rob. + +applied Makefile.PL patch from Rob Hartill to prompt for most recently +modified apache*/src directories first + +now suspend all END blocks encountered during server startup and run +them during server shutdown aka child_exit (need 1.3b1+) + +now execute END blocks of PerlHandler (Apache::Registry) scripts at +the expected time + +make sure CGI.pm version 2.36 or higher is being used + +make sure GATEWAY_INTERFACE is not cleared from %ENV so +Apache::DBI/ApacheAuthenDBI work together, thanks to spot by +John Groenveld + +some source re-org: split stuff into perl_util.c and perlio.c, +rename config.c -> perl_config.c, various cleanups + +the constants.t test is now run under httpd with t/net/constants.pl + +Apache::Constants not longer defines subs at startup. we now use a C +AUTOLOAD which creates newSUBs when needed, without eval {} and +without "prototype mismatch" errors. This shrunk my httpd image size +by ~50K + +according to Joel Wagner, Solaris's tar did not like the trailing / on +the Apache/ argument to the tar_Apache target in Makefile. gone now. + +thanks to help from Vern Hart, Apache::Registry will now include +$r->server->server_name as part of the uri->perl package translation +if $r->server->is_virtual + +$0 is now set to $r->filename thanks to spot by Dylan Tynan + +added auth.t test to the suite + +moved constants/export.t to net/constants.t + +$>, $<, $) and $( are now properly initialized, thanks to bug spot by +James Freeman + +applied Constants.{pm,xs} patch from Gisle Aas, adding some new +constants from httpd.h, :methods import tag and some cleanups + +applied Makefile.PL patch from Andreas Koenig adding verbosity +if there's a problem with t/report + +PerlNewSendHeader functionality has replaced PerlSendHeader's +the `PerlNewSendHeader' directive is gone, replace with `PerlSendHeader' + +fixed Apache::exit so it no longer calls C-level exit (unless exit +code == -2), it now just terminates the perl callback, without +producing an "Internal Server Error" therefor, we complete _all_ +post-handler request phases and no longer dump core, as some have seen +under certain conditions. the test suite nows tests calling exit() + +applied patch from Brian Millett to Makefile, so SSL_CFLAGS are used +with Ben-SSL + +=item 1.00 - 07/28/97 + +some 1.3a1 compatible things: +- mod_perl is now a dll under win32 +(Extra thanks to Gurusamy Sarathy for fixing Perl so this works) +- cope with limit() -> limit_section() rename +- API_EXPORT perl_call_handler and perl_stdout2client for mod_include/win32 +- added win32 dirent.h kludge to workaround conflict(s) between perl's + dirent.h apache's readdir.h +- -Wall clean again + +added new sub request methods: +- lookup_uri (sub_req_lookup_uri) +- lookup_file (sub_req_lookup_file) +The returned request_rec * is blessed into the `Apache::SubRequest' +class so destroy_sub_req() is called automatically during DESTROY +- the run_sub_req() function is available in this class as the run() method + +added patched Makefile.tmpl-Xcert from Vivek Khera to support XCert's Stronghold Sentry + +$r->cgi_header_out should do case-insensive checks, +bug spotted by Ralf Engelschall + +eval { bootstrap Apache::Constants } so perl -c works outside of httpd + +added `PerlChildExitHandler' callback hook (requires 1.3a2-dev or higher) + +added `PerlChildInitHandler' callback hook (requires 1.3a1 or higher) + +don't enable PERL_SECTIONS or PERL_SSI unless apache version >= 1.2.0 +thanks to hint from Vivek Khera + +removed Makefile-1.2 (don't need one anymore!) + +removed Apache->connection->close method which _nobody_ should still have +their code (it has produced a warning since 0.93_01 - 03/04/97) + +added Apache->connection methods local_addr() and remote_addr() thanks to +Eric James Negaard + +applied patch from Hakan Tandogan so mod_perl's Makefile picks up SSL_INCLUDE + +fixed chdir/current dir bug in Apache::Registry thanks to Joel Wagner + +=item 1.00b2 - 07/07/97 + +fixed scoping bug in Apache::Registry spotted by Marshall Dudley + +append LockFile to t/conf/httpd.conf if SERVER_VERSION >= 1.2.1 + +add ''s for CC='$(CC)' workaround for bug spotted by David Lloyd and others + +added Apache::Debug->import so 'use Apache::Debug level => 4' will: +-level sets $Apache::Registry::Debug +-define UNIVERSAL::AUTOLOAD to stop spinning when undefined sub is called +-Carp::confess instead of die() +-allocate $^M if $Config{cflags} =~ /EMERGENCY_SBRK/ + +croak() if should_client_block() to prevent spin into "Out of memory!" + +make compatible with 1.2.1 r->read_length change so we don't hang +on file uploads + +can't run 'make test' as root with 1.2.1, if user `nobody' exists, +use that, otherwise prompt user for `User' and `Group' as suggested by +Michael Parker + +Andrew Tennant reported that `PassEnv' didn't work. +we now turn off %ENV magic when clearing %ENV so it does work + +win32 stuff: +-include handy patch for modules.c as there's no win32 Configure script yet +-fixed mod_perl.h mutex #define broken-ness + +the following will now work as expected (building {Apache,Constants}.s[ol]): + perl Makefile.PL NO_HTTPD=1 DYNAMIC=1 && make +thanks to hints from Bowen Dwelle + +added Makefile.PL option where 'perl Makefile.PL EVERYTHING=1' +will enable all features: +ALL_HOOKS, PERL_SECTIONS, PERL_STACKED_HANDLERS, PERL_METHOD_HANDLERS, PERL_SSI + +fixed cgi_to_mod_perl.pod mess + +added AIX note from Eric Bartley to the INSTALL doc + +=item 1.00b1 - 06/29/97 + +turning off $^W in Apache::Registry when using Cwd to avoid +'use of uninitialized variable' warning + +added Apache::DESTROY to shutup AutoLoader compliants spotted by Tim Newsome + +Constants.pm: +-added constant for DONE (included with export tag ':common') +-removed constants for DYNAMIC_MODULE_LIMIT, HUGE_STRING_LEN, + MAX_HEADERS, MAX_STRING_LEN, METHODS + +added benchmark/ directory with benchmarking examples + +added pointers to Mike Stok's FAQ mirrors + +added short-n-simple cgi_to_mod_perl document + +fixed various Makefile.PL w/Stronghold bugs spotted Vivek Khera and Ted Corning +- PERL_SSI=1 will work (and add -DAPACHE_SSL) +- Makefile.tmpl is fixed up so mod_perl/x.xx is added to Server: +- 'make test' will pause (sleep 2) between starting httpsd and running the tests + +swap link order of Makefile.tmpl for Stronghold, regardless of version, +thanks to Ted Corning + +perl_clear_env() will now leave $ENV{TZ} in place to +cure bug with hpux 9.04 spotted and suggested fix from +1Lt. Samuel S. Tai + +Apache::Registry will now 'chdir dirname $r->filename' before the +script/subroutine is compiled so 'use Foo' can find Foo.pm in '.' +bug spotted by Janne Himanka + +win32 port: +-added INSTALL.win32 +-added src/modules/perl/mod_perl.mak +-tweaked Makefile.PL: + -does not try to build httpd + -generates perlxsi.c, Apache.c, Constants.c (since we use mod_perl.mak) +-Apache::Registry does not test '-x $filename' if $Is_Win32 +-wrap callbacks in a mutex lock/unlock + +applied patch from Eric Bartley to fix Apache::Include + +change Apache::Registry behavior back to returing $r->status instead of OK + +=item 0.99 + +added DO_HTTPD option to avoid configuration prompts, suggested by +Michael Alan Dorman + +only build Constants.s[ol] with DYNAMIC=1 + +swap link order in Makefile.tmpl for Stronghold as we did for b11 +thanks to Ted Corning for spotting + +applied patch from Rob so 'make tar_Apache' creates the tarball in $PWD + +@Lists in sections can now deal with TAKE2, TAKE23, TAKE3, etc. + +updated FAQ pointers to Frank's new version + +Apache::Registry will return OK instead of $r->status, suggested by Owen Scott Medd + +skip t/constants/export test on platforms that don't support dl + +removed Apache::CGI stub + +removed alias for Apache::CGI::exit and Apache::TieHandle::TIEHANDLE + +cleanup up Makefile.PL, no longer support 1.2bx's + +another patch applied from Alexander Demenshin who found av_undef +does not take care of everything, we must SvREFCNT_dec too! + +fix bug with PERL_METHOD_HANDLERS spotted by Eric Bartley + +=item 0.98_12 + +applied patch from Alexander Demenshin to plug +leaks in perl_{stdout,stdin}2client + +can now say 'perl Makefile.PL PERL_SSI=1' to enable mod_include stuff + +the link order of apache 1.2b12-dev has been switched back to the way +it was in b10, now we only have to muck with Makefile.tmpl if $Is_b11 + +once again, ensure CGI.pm knows GATEWAY_INTERFACE if it is use'd in a +PerlScript, thanks to Tom Hughes for spotting this + +removed trick to make `require Apache::TieHandle' a noop, *nobody* +should still have that in any code, if so, sorry, get rid of it! + +inspired by Pai-Ling Hsiao, added tiny Apache::Include module so the +mod_include <--!#perl directive can take advantage of +Apache::Registry, like so: + + + +added $r->translate_name method to run translate handlers + +fix Apache::Status so it sends http headers! spotted by Mike Stok + +have cgi.t skip its tests if CGI.pm is not installed, for Rob, the +only person in the whole world who doesn't have CGI.pm installed ;-) + +s/make/$(MAKE)/ for 'make test_report' thanks to Tom Hughes + +=item 0.98_11 + +switch Apache::parse_args behavior back to pre-0.98_09 + +=item 0.98_10 + +if mod_php is in Configuration, keep Makefile.tmpl link order as is, +and set Rule WANTHSREGEX=no + +removed `BrowserMatch' from t/conf/httpd.conf + +can now 'make test' without needing to run 'make' first + +get rid of Manifest warnings during 'perl Makefile.PL' + +reset $/ to "\n" after each request (t/net/test will test this) + +set $ENV{GATEWAY_INTERFACE} before perl_run() so it's set for +server startup PerlScript's + +=item 0.98_09 + +fixed bug in Apache::perl_hook('Access') spotted by Eric Bartley + +applied patch from Peter Levart +to make Apache::parse_args more reliable + +if using Perl 5.003, use system cp since File::Copy is broken, +bug spotted by Rob + +switch link order in Makefile.tmpl back to what it was in b10 (tmp workaround): +s/$(LIBS) $(REGLIB)/$(REGLIB) $(LIBS)/ +Thanks to hint from Mike Fletcher + +=item 0.98_08 + +added 'make test_report' + +=item 0.98_07 + +STATIC=1 is the default now, you make choose DYNAMIC=1 + +force STATIC=1 if $Config{osname} =~ /svr4/; #unixware + +documented mod_perl+mod_include integration in mod_perl.pod + +Constants.xs will now make due if SERVER_SUBVERSION is not defined + +still build Constants.s[ol] even if we've configured with STATIC=1 + +=item 0.98_06 + +smoothed out Stronghold configuration bumps with help from +Ted Corning . (see updated INSTALL) + +documented sections in mod_perl.pod + +added eg/perl_sections.txt from Rob + +=item 0.98_05 + +applied fix from Brian Millett so Makefile.PL can deal with Ben-SSL-1.2 + +applied patch from Rob to quiet -Wall in new PERL_SECTION code + +=item 0.98_04 + +added BSDI dynamic loading notes from Gary Shea to +the INSTALL doc + +added PRINTF method (again!) for tie'd STDOUT, spotted by Kristina Helen Long + +the following stuff now works inside sections: +- %VirtualHost, %Files and %Directory +- implemented sections like so: +$Location{"/~dougm/"} = { + AuthUserFile => '/tmp/htpasswd', + AuthType => 'Basic', + AuthName => 'Homepage', + Limit => { + METHODS => 'GET POST', + require => 'user dougm', + }, +}; +- `PerlModule' configuration directive + +set $SIG{PIPE} = 'IGNORE'; when the server starts to avoid hosing when: + `Apache->print lost connection to client' +thanks to Aaron Flin for the tip + +=item 0.98_03 - 05/19/97 + +construct Perl interperter the first time perl_startup is called +rather than the second: +-slapped self upside head wondering why I did not do this before +-now -DAPACHE_SSL for Stronghold or Ben-SSL does not matter +- sections work again +-ugly avoid_first_alloc_hack is gone! + +added `ENVIRONMENT' section to mod_perl.pod + +added `PerlSetEnv' configuration directive + +back to only PerlHandler enabled by default + +if STATIC=1 is configured during 'perl Makefile.PL', Apache::Constants +will also be linked static. This is the default on aix and bsdos. + +$r->register_cleanup will now save a pointer to the request_rec +rather than doing it in PerlTransHandler + +applied patch from Martin Pool so we see the real +line number if something goes wrong in an Apache::Registry script + +now add -I./ and -I$Config{archlibexp}/CORE to EXTRA_CFLAGS for +mod_include integration + +=item 0.98_02 + +$r->send_http_header now resets $r->status to 200 after calling +send_http_header() to squash double header w/ Location: bug +spotted by Jonathan Lieberman + +added $r->cgi_header_out so we can _really_ send headers the way +mod_cgi does (e.g. Set-Cookie bug spotted by Jonathan Lieberman) + +=item 0.98_01 + +made room for args in perl_call_handler() for mod_include integration +in the future, this can be used to pass arguments to Perl*Handlers: + + PerlHandlerArgs Package::sub_name OneArg TwoArg RedArg BlueArg + +split out some config routines from mod_perl.c to config.c + +fixed bug in Apache/Makefile.PL thanks to Jeff Rowe + +now use translate slot to do some initialization + +Perl*Handlers can now be anonymous subs (need 5.003_98+), e.g.: + + PerlFixupHandler "sub { shift->header_out(Key => 'val') }" + +finally get cleanups right: +- PerlCleanupHandler is now run during PerlLogHandler +- new method $r->register_cleanup uses register_cleanup + underneath and is always available + +@INC is now reset to default after each request + +fixed "const char *" bug in typemap spotted by Honza Pazdziora + +=item 0.98 - 05/02/97 + +save a pointer to request_rec in the translate stage so we always have one +for PerlCleanupHandler (e.g. no PerlHandler first), tracked down by Eric Bartley + +PerlTransHandler enabled by default now + +don't use server_argv0 when intializing perl_startup's argv[], caught by Andreas + +remove headers.t, will bring back in 0.98_01 and flesh out PerlNewSendHeader + +fix exit() so we don't need to $r->rflush first and we make Rob happy + +fix bug in $r->requires, caught by Eric Bartley + +go back to $|=1 #ifdef USE_SFIO, caught by Salvador Ortiz + +=item 0.97_02 - 04/29/97 + +added documentation for stacked handlers and a little for method handlers. + +$^X is now set to server_argv0 as suggested by Frank Cringle + +Apache::Registry will now require CGI.pm version 2.35 or higher if you +are using it. Makefile.PL will also test and warn if it is < 2.35 + +removed examplish modules from the distribution into the contrib directory: +AuthzAge.pm, AccessLimitNum.pm, MsqlProxy.pm, SSI.pm +the contrib directory will be tar'd and uploaded to CPAN when updated. + +added headers.t test for Perl(New)SendHeader + +added option to link httpd with static Apache.o (the original way), +(Eric Bartley reported problems on aix with Apache.so, others?) +like so: perl Makefile.PL STATIC=1 + +only bother setting $$ once per-child + +%ENV is now cleared by a registered cleanup function, rather than +after PerlHandler is called + +applied patch from Andreas to ensure APACHE_SSL is defined if +we're configuring with it + +putback -DSERVER_SUBVERSION now that netscape workaround is in 1.2b9 + +PerlNewSendHeader enhancement so headers don't need to be part of +a single print statement. + +applied fix from Rob Hartill so Makefile.PL can parse beta version >= 10! + +properly initialize cld->new_sendheader thanks to Rob Hartill + +$r->print is now an xsub for speedup, even with the new +extra operation of checking $|, it's faster: + + Benchmark: timing 100 iterations of 0.97_01, 0.97_02... + 0.97_01: 9 secs ( 2.03 usr 0.19 sys = 2.22 cpu) + 0.97_02: 8 secs ( 1.84 usr 0.17 sys = 2.01 cpu) + +sfapachewrite() will now call Apache->print + +if $| is non-zero, call rflush() after writing to the client + +$| is reset to 0 before PerlHandler is called + +applied patch from Eric Bartley to: +-add get_remote_logname() method +-update Apache.pm documentation including: + get_remote_logname, auth_type, auth_name, document_root, notes + +fix so $r->rflush works with older apache's + +=item 0.97_01 - 04/22/97 + +added experimental `PerlNewSendHeader' config directive +works like `PerlSendHeader', but scans headers for special +headers like Location:, Status:, etc. +simply uses a C global variable `sent_header', if true, sends +data asis to client, otherwise calls $r->send_cgi_header +currently, does not work with sfio (yet) and this only works if a +single print statement sends the headers like so: + + print "Status: 302\n", + "Location: http://www.somewhere.com/\n", + "Content-type: text/html\n\n"; + +"fixed" new preg* clashes w/ 1.2b9-dev spotted by Dean Gaudet + +reworked callback mechanism a bit: +- folded duplicate code in run_stacked_handlers() + perl_call() +- gv_fetchmethod called only if -DPERL_METHOD_HANDLERS +- perl_handler_ismethod now() uses class stash in gv_fetchmethod +- cache CV from perl_get_cv lookup if -DPERL_STACKED_HANDLERS +- included patch from Eric Bartley so we can say: + `Class->method' in Perl*Handler's if -DPERL_METHOD_HANDLERS +- fixed bug spotted by Rob Hartill so Perl*Handler (OK|DECLINED) work again +- added minimal tests for stacked handlers and method handlers +- PERL_METHOD_HANDLERS=1 can be set when running Makefile.PL + +PerlCleanupHandler now uses register_cleanup underneath, +instead of abusing the logger slot. +PerlCleanupHandler is enabled by default + +added PRINTF for tie'd STDOUT + +detached Apache.o from httpd, now a dynamic extension. here's why: +- shinks httpd size +- possible to 'use Apache ()' outside of httpd + (very few methods will work though!) +- once mod_perl.c settles it will be possible to upgrade mod_perl + without rebuilding httpd! + +added $r->server_root_relative function + +Apache::Status has 2 new menu items (need Devel::Symdump 1.99_01+): + - "Inheritance Tree" + - "ISA Tree" + +added new CGI.pm tests from Andreas + +=item 0.97 - 04/15/97 + +don't add mod_perl/x.xx to Server: unless 'perl Makefile.PL ADD_VERSION=1' + +applied patch from Andreas to better Makefile.PL + +if httpd is 1.2b8, remove bogus target from modules/Makefile + +applied patch from Rob Hartill to add $r->rflush method + +applied patch Eric Bartley to: +add $r->notes, $r->auth_name, $r->auth_type, $r->document_root methods +ability to set $r->args, $r->connection->user and $r->connection->auth_type + +applied patch from Dean Gaudet so $r->exit uses log_transaction +instead of multi_log_transaction + +=item 0.95_06 + +fixed typo in new merge function that broke PerlHeaderParserHandler + +=item 0.95_05 + +make sure merge of configs accounts for sendheader and setup_env too! + +applied patches from Glen McCallum so build works +with hpux 10.20's native compiler + +=item 0.95_04 + +dir configs are now merged so blocks can have Perl*Handlers +and PerSetVar's without stomping those that are in .htaccess + +Apache->seqno will use the scoreboard's my_access_count if the -DSTATUS +option is enabled (default if mod_status is configured in) + +=item 0.95_03 + +with 1.2b8-dev+, we no longer need a Makefile.tmpl + +added Apache->max_requests_per_child method + +now have taint.t test + +added config section (see httpd.conf.pl) +(needs 'perl Makefile.PL PERL_SECTIONS=1') + +Apache::Registry will now chdir to directory where the script + +Apache::AuthenDBI and Apache::Authen removed from distribution, +now maintained by John Groenveld and Steve Kane + +added PerlInitHandler and PerlCleanupHandler hooks + +Apache::Registry will require CGI.pm version 2.32 or higher if it +finds CGI.pm in %INC + +added Apache::Registry->push_cleanup method suggested by Frank Cringle. + +applied patches from Gerald Richter to: +-fix Apache::unescape_url_info +-one s/Apache::Config/Apache::MyConfig/ in Makefile.PL + +=item 0.95_02 + +introduced experimental "stacked handlers" mechanism, allowing more +than one Perl*Handler to be defined and run during each stage of the +request. + +Perl*Handler directives can now define any number of subroutines, e.g. + + PerlTransHandler OneTrans TwoTrans RedTrans BlueTrans + +with a new method, Apache->push_handlers can add to the stack by +scripts at runtime + +PerlLogHandler enabled by default during "stacked handlers" experiment + +applied patches from Andreas to quiet prototype warnings seen with +perl5.003_94 + +applied patches from Gerald Richter to: +-add Apache::uri_unescape_info function (and make $r->args/content use it) +-built Apache::MyConfig module +-Term::Readline Makefile.PL support for history, etc. + +=item 0.95 - 03/20/97 + +****************************************** +*** CGI-XA/* removed from distribution *** +CGI.pm-2.32 is now mod_perl compatible, and +now ships with CGI::Switch and CGI::Apache. +****************************************** + +various documentation updates + +renamed Apache::CGI to CGI::Apache +(you should be using CGI::Switch anyhow!!!) + +Perl*Handler package names no longer require a '::' to default +to PackageName::handler() when Perl*Handler is just PackageName + +renamed eg/MyPackage.pl to startup.pl, pruned way down to +discourage use of PerlScript and avoid the confusion it has caused in +the past + +updated Makefile.tmpl-1.2 to work with 1.2b8-dev, there will be +a "Multiple rules lines" warning, once 1.2b8 is released, we'll +take this out + +added $r->prev and $r->next methods + +added Apache->taint method + +Apache->untaint method now in Apache.xs + +added $r->seqno method suggested by Lincoln Stein + +added GETC and READLINE for tie *STDIN completeness + +fixed Apache::CGI+file upload w/ patch from Andreas + +data read from client ($r->read*, $r->args), %ENV, $r->cgi_env and +$r->*header*_* is now marked as tainted, t/net/test now tests this +(only with with `PerlTaintCheck On' of course) + +various cleanup, including shifting things so Apache.o can be detached +from httpd to Apache.sl if the need arises + +now -Wall clean, except for Perl's dXSUB_SYS->dummy + +set $|=1 by default #ifdef USE_SFIO + +added Apache->module method + +added Apache::Status->menu_item method + +fixed warnings in Apache->read spotted by Owen Scott Medd + +applied Apache::Registry fixes from Andreas + +applied NeXT fixes from Jeff Hallgren and Andreas + +applied XA.pm patch from Owen Scott Medd +so filehandles can be ref's + +=item 0.94 - 03/09/97 + +removed pp_hot.patch from distibution + +t/net/http-post.t will now test the tie'd *STDIN if $] >= 5.003_93 + +*STDIN is now tie'd to the client, only works if perl version is +>= 5.003_93 + +removed Apache::TieHandle from the distribution as it is no longer +needed. however, scripts that are currently using: +use Apache:TieHandle (); +tie *STDOUT => "Apache::TieHandle"; +will not break, but will produce a no longer needed warning + +removed Apache::Registry's attempt to honor __END__, as Andreas +pointed out, this can't really be done right unless we have +Perl::Lex and Perl::Parse :-) + +applied Makefile.PL patch from Andreas to use modules instead of +system() where possible + +Apache::Constants now defines SERVER_SUBVERSION, +as suggested by Andreas + +removed is_perlaliased from Apache::Debug, caught by Andreas + +=item 0.93_01 - 03/04/97 + +added 'use ExtUtils::testlib' to t/docs/startup.pl since PERL5LIB +is shutoff with -T!?! + +picky compilers should no longer complain of things reported +by Mike Stok and George Hartlieb when sfio is configured in + +added (temporary?) `PerlWarn' directive to pass the -w switch +to perl_parse + +bug fix so stderr is hooked to the error_log as it was and +should be (unless PERL_TRACE is defined) + +argv[0] to perl_parse is now "httpd", making the value of +magic $^X "httpd" + +`PerlSetupEnv' now on by default + +Apache::Registry parses command line switches if it sees #!, +only -w and -T are recognized at the moment (not enough!) + +Apache::Registry now honors __END__ + +added Apache->untaint method + +added `PerlTaintCheck' directive to startup with -T switch + +during 'make test' t/TEST now installs a die handler to shutdown httpd +before make aborts if a test fails as suggested by Gary Shea + +we now passthru httpd's CFLAGS1 via MM's DEFINE +(I needed this for -DHPUX10 + Apache::Constants) + +we now define SERVER_SUBVERSION as suggested by Andreas + +fixed $$ bug in CGI::XA with fix from Salvador Ortiz + +added $r->is_initial_req method, now used by these modules: +Apache::AuthenDBI, Apache::AccessLimitNum, Apache::AuthzAge + +Apache::warn now overrides CORE::warn in Apache::Registry scripts, +which is an alias for Apache::log_error + +Apache::exit now overrides CORE::exit in Apache::Registry scripts, +now converted CGI scripts can safely call plain 'ol exit; + +$r->exit will close the client connection for you, no need for +$r->connection->close, which is no longer documented, and does +nothing but warn not to call it. + +fixed cookie bugs in CGI::XA spotted by Andrew Tennant + +#undef some symbols that caused clashes #ifdef HPUX10 +and ones on solaris spotted by Bowen Dwelle + +=item 0.93 + +updated Makefile.tmpl-1.2 to be inline with 1.2b6 + +removed 1.2b5 Makefile.tmpl, 1.2b1..b5 no longer supported + +mortalize return value from $r->read_client_block + +make Apache::CGI scrict clean thanks to Frank Cringle + +=item 0.92 - 01/23/97 + +fixed core-dump-causing bug spotted by Mike Stok + +=item 0.91 - 01/22/97 + +perl_init now says 'use Apache::Constants qw(OK DECLINED)' (in C) so you can +say 'Perl*Handler DECLINED', suggested by, you guessed it, Rob + +applied patch from Rob so Makefile.PL copies $APACHE_SRC/Configuration to src/ +if it has been changed + +added Makefile.tmpl-1.2b5 from Rob + +applied patch from Rob Hartill to stop $r->cgi_env($key) from core-dumping +if $key does not exist + +applied PerlModule overflow check patch from Rob Hartill + +added $r->as_string method + +=item 0.90_01 + +depreciation of Apache->request use outside of Apache::CGI and scripts +that run under Apache::Registry now spits out a warning. See Apache.pm +doc update for details. + +$r->is_perlaliased has gone away + +added api tests + +added tests for callback hooks besides PerlHandler + +added Apache::perl_hook function + +if a callback does not return a status values, we assume OK, +fatal errors would have never made it that far anyhow, +still log warning to error_log, but carry on + +clean up here and there + +added PerlHeaderParserHandler callback hook for apache versions >= 1.2b5 + +added $r->connection->aborted method +added $r->the_request and $r->header_only methods +added Apache::Server methods: is_virtual and names + +added $r->headers_out and $r->err_header_out methods: +header*_* methods are now consistent, see Apache.pm docs + +should now use $r->err_header_out instead of $r->err_headers_out +to set the value of an err_header + +added 1.1.3 to Makefile.PL version map after hint from Arin Goldberg + +src/modules/perl/Makefile now detects modules linked static with +your perl and links them with httpd + +Apache::CGI->read_from_client now calls $r->read instead of +$r->read_client_block + +applied fix for bug in read_client_block thanks to Milan Votava + +updated Apache::SSI documentation + +can now 'make test PORT=xxxx' + +can now 'make start_httpd', 'make kill_httpd' for testing + +perl Makefile.PL ALL_HOOKS=1 enables all Perl*Handler callbacks + +$r->filename will re-stat r->finfo if you change the filename as +suggested by Rob Hartill + +Makefile.PL now copies $APACHE_SRC/Configuration to src/ modifies, +then tells apache's Configure to use this copy with -file + +applied patch from Pai-Ling Hsiao +o fix CGI::XA->*_group bugs + +t/constants/export.t now tests _all_ of @EXPORT and %EXPORT_TAGS + +fixed bugs in Apache::Constants spotted by John Groenveld and Rob Hartill + +Apache.xs now uses rwrite() if apache >= 1.2b4 + +=item 0.90 + +perl Makefile.PL PERL_TRACE=1 will now enable tracing + +changed Makefile.PL so we can enable callback hooks ala: + perl Makefile.PL PERL_AUTHEN=1 PERL_FIXUP=1 + +updated INSTALL and mod_perl.pod to reflect this change + +=item 0.89 + +fixed bug spotted by Rob Hartill so perl_cmds[] is not prematurely +terminated + +added Bundle::Apache module for use with CPAN.pm + +fixed Constants/Makefile.PL so -I picks up $(APACHE_SRC) no matter what, +thanks to Mike Stok + +=item 0.88 + +applied Makefile.PL patch from Rob Hartill so we compile with 1.2b3 + +=item 0.87 + +As suggested by Andreas, Makefile.PL now asks: +"Configure mod_perl with ../apache_xxx ?" + answering 'y' only means there is where we can find *.h +"Shall I build httpd in $adir for you?" + answering 'y' will run ../apache_xxx/Configure + and httpd will be built when running 'make' + +$r->read now returns $nrd as it should + +'perl Makefile.PL NO_HTTPD=1' will build only the perl side of +mod_perl (still need httpd.h for Constants.sl) + +'make test' now picks up modules in ./blib as it should, bug +spotted by Mike Stok + +ServerName is set to localhost in httpd.conf as suggested by +Mike Stok and Frank Cringle + +=item 0.86 + +Port is a little more random for tests '8529' + +applied patch from Edmund Mergl bringing CGI::XA +up-to-date with CGI.pm 2.29 + +perl_destruct_level is set to 0 in mod_perl.c, while progress is being +made on fixing perl_{con,des}truct in 5.003_12 + +if there is no httpd.conf, Makefile.PL creates one for you, filling in +User and Group with uid and gid of the current process + +updated Makefile.tmpl-1.2 with Makefile.tmpl from apache 1.2b2 + +if Makefile.PL finds apache version >= 1.2b3, instead of copying +Makefile.tmpl to ../src/apache_x.x, it uses the new '-make Makefile.tmpl' +option, made possible by Rob Hartill +otherwise, same as before and it now tells you it's made a backup +'Makefile.tmpl.bak' + +fixed 'make test', so you _really_ don't have to modify anything, +hopefully + +if libwww-perl is not installed, the tests that require it will not be run, +and it will be suggested that you install the library, but who doesn't +have libwww-perl installed??? + +=item 0.85_06 + +same as 0.85_05, just fixed broken tarball + +=item 0.85_05 + +fixed Makefile.PL bug spotted by Gary Shea + +applied XA.pm fix from Edmund Mergl + +updated docs and examples here and there + +'make test' improved, all uneeded directives and files stripped out, +should be able to run with no modification, nothing by hand other than +'make test' + +now make sure that CC we use to build httpd is the same as CC used to +build Perl, thanks to Andreas + +added 'make offsite-tar' target for build the perl-side on machines +without apache source + +fixed Makefile.tmpl* so people define EXTRA_FLAGS as suggested by Rob Hartill + +a few minor fixes for Apache-SSL users + +=item 0.85_04 + +applied patch from Rob Hartill to fix bug in $r->cgi_env + +%ENV is cleared after each callback (&Perl*Handler) + +added $r->cgi_var as suggested by Andreas: +calls $r->cgi_env($key) in a scalar context to prevent the +mistake of calling in a list context. + +if a Perl*Handler returns something > 600 we assume OK (for now) + +bug fixed introduced in 0.85_03 for Perl*Handler's not prefixed with +a Package:: causing httpd to sigsegv + +ship with Makefile.tmpl-Ben-SSL for Apache-SSL users + +Makefile.PL a little smarter +-knows if we're configuring with Ben-SSL, uses Makefile.tmpl-Ben-SSL +-after looking for 1.1.1 and 1.2*, globs for not +-instead of rm -rf'ing the modules/perl/ directory we're configuring + against, we only rm -f those found in our MANIFEST + +applied patch from Frank Cringle to fix defaults +in CGI::XA + +got rid of stupid warning "missing test.pl" + +=item 0.85_03 + +cleaned up internal perl_setup_env() + +Perl*Handler's default to calling Perl*Handler::handler if the +Perl*Handler is just a class name, e.g. 'PerlHandler Apache::Registry' +will call Apache::Registry::handler +In addition, the class module will be loaded if it is not already, +so there is no need to specify PerlModule + +added Apache::Status module + +$r->print now sets a hard_timeout() before sending to the client +$r->read now sets a hard_timeout() before reading from the client + +added $r->soft_timeout, $r->hard_timeout, $r->kill_timeout and +$r->reset_timeout methods + +top-level Makefile.PL looks further for apache_x.x/src/ +prompts you if nothing found + +applied fix from Andreas to s/privlib/privlibexp/ in src/modules/perl/Makefile + +applied patch from Rob Hartill to correctly initialize +cld->sendheader and cld->setup_env + +=item 0.85_02 + +Apache::DBIAuthen renamed Apache::AuthenDBI and split out from +Apache::Authen + +Apache::Authen->handler renamed Apache::Authen->check +as it is not a handler, only used by handlers + +added ToDo file + +updated UserGuide, now called 'mod_perl.pod' + +updated INSTALL and README docs + +perl_init will only perl_alloc and perl_contstruct once when the server +starts, meaning no more mad leaks when server is restarted + +modified test suite adding extra tests for sfio and TIEHANDLE + +unless Perl was configured to use perlio and sfio, STDOUT is tied by default to +the client, no more need for tie *STDOUT => Apache::TieHandle + +Makefile.PL now looks for ../apache_1.1.1/src/, apache_1.2*/src/ to configure +against + +Fixed Makefile.PL bug spotted by Frank Cringle , +when no apache source was present or chosen to configure against + +'make clean' will now cd $(APACHE_SRC) && $(MAKE) clean + +applied patch from Rob Hartill to bring us up-to-date +with apache_1.2b0 + +$r->content now calls $r->read instead of $r->read_client_block + +$r->read is no longer an alias for $r->read_client_block +The new $r->read implementation is based on patches and ideas from +Milan Votava , +Joonsuk Bae , +and Gisle + +=item 0.85_01 + +added 'tar_Apache' target for copying the perl-side of mod_perl to other +machines without dragging the apache-side along. + +'perl Makefile.PL' now Configures Apache to link mod_perl +if ../apache_1.2-dev or ../apache_1.1.1 src/Configuration is found +In addition, 'apache_httpd' is added to the 'make all' target + +now include Makefile.tmpl-1.2 + +fix for 1.2's const requirement + +=item 0.85 + +added the start of a mod_perl test suite + +got rid of conditional perl*rec members, which was causing compile problems +for some people + +$r->exit now logs transactions before exit()'ing the process + +applied clean-up and debug enhancement patch to Apache::Registry from Andreas + +applied patch from Andreas to reduce Apache->request calls in Apache::CGI + +$r->cgi_env now accepts arguments for setting variables + +=item 0.84 - October 27, 1996 + +added pointer to Patrick Kane's FAQ + +applied Makefile.PL patches from Gisle + +=item 0.83_10 + +send_cgi_header now sets $r->status to REDIRECT when it finds a Location +header which is not an internal redirect + +Apache::Registry now returns $r->status rather than always OK + +dropped old approach of the original mod_perl.c, mod_perl_fast functionality +has moved to the all-knowing, all-doing mod_perl + +Makefile.PL for Apache::Constants looks for httpd.h in ../../apache*/src/ +before prompting + +dropped OK from @{$Apache::Constants::EXPORT_TAGS{response_codes}} + +updated Constants.xs with patch from Gisle + +applied Makefile.PL patch from Gisle to set PERL= in Makefile* + +=item 0.83_09 + +fixed bug with get_basic_auth_pw spotted by Patrick Kane + +=item 0.83_08 + +get_basic_auth_pw now returns the $send_pw, rather that setting it, +see Apache.pm docs + +applied patch from Andreas with the following changes: + +1) regex directory added in Constants/Makefile.PL. Current apache + always needs -Iregex, that means for us an additional + -I$httpd/regex. I think, they should + + #include + +2) Assorted comments added to INSTALL, especially + + * FileHandle bug explained as being a 5.003 bug (not "current") + + * Configuration/Configuration.tmpl relation explained + + * && instead of ; to separate commands is a must in Makefiles + + * Gisle's hint about the default seems very important to me, so is + there again. + +3) Drops the deprecated mod_alias patch from the whole distribution + +4) A whitespace patch for src/modules/perl/Makefile + +5) The regex directory also for src/modules/perl/Makefile + +6) Shuffling of code between mod_perl_fast.c and mod_perl.h until it + fits the bill, who knows why :-0 + +=item 0.83_07 + +added the missing src/modules/perl/Makefile (again) + +=item 0.83_06 + +brought back Makefile.tmpl for current public release + +added src/modules/perl/ldopts script, rather than using 'make ldopts' + +INSTALL doc fix so 1.1.1 users define RANLIB + +MODULE_MAGIC_NUMBER fix so we still build with 1.1.1 + +no longer pstrdup when fetching r->args + +dropped undocumented SKIP_AUTH_HEADER thingy + +=item 0.83_05 + +added missing Makefile to src/modules/perl/ + +turned off PERL_TRACE, oops + +moved SERVER_VERSION from Apache.xs to Constants.xs + +applied another doc patch to Apache.pm from Gisle + +=item 0.83_04 + +updated INSTALL and UsersGuide documents + +misc cleanup here and there + +Apache::Options is now just a stub that imports from Apache::Constants + +updated Apache.pm and Apache::Constants documentation + +added Apache::AuthzAge and Apache::AccessLimitNum modules + +added $r->requires and $r->is_main, and $r->main methods + +added callback hooks for authorization, access, type-check, +fixup and logger stages of the request + +callback hooks can now be turned off at compile time with +-DNO_PERL_...., and are turned off by default, except for the +handler stage (PerlHandler) + +reworked installation procedure to follow apache 1.2 recomendations, +the procedure will still work with older versions of apache. +No more Makefile.tmpl.x.x.x mess!! + +updated #if MODULE_MAGIC_NUMBERS >='s so we're inline with apache 1.2-dev-19961009130008 + +=item 0.83_03 + +Perl*Handler's are now called with Apache->request as an argument +PerlHandler's may still ask for Apache->request so existing code and +mechanisms such as Apache::Registry will continue to work +However, other handlers such as PerlAuthenHandler and PerlTransHandler, +cannot use Apache->request. + +added Apache::Constants module, based on patch to Apache.xs +from Gisle + +updated Apache::Debug with patch from Gisle to +- update the status codes from the latest + HTTP::Status and produce a prettier and more output. + +- We also ensure that we do not generate output for HEAD requests and we + set up status correctly. + +updated Apache.pm and Apache::Options docs, thanks to Gisle + +fixed PerlScript bug spotted by Gisle + +renamed Apache::Msql to Apache::MsqlProxy + +=item 0.83_02 + +bug patch to Apache::Registry from Andreas + +=item 0.83_01 + +minor clean-up + +fixed port and query_string related bugs in Apache::Msql example + +applied patch from Salvador Ortiz to fix PerlTransHandler bugs +spotted by Hugues Lafarge + +applied Apache::Registry patch from Andreas +- allows filanames to start with a digit (you probably saw a "bad + symbol after ::" error) + +- strips path_info before deciding which package the script is compiled + into. + +=item *developer's release* release 0.83 - September 12, 1996 + +added Apache::Msql module + +added $r->handler method + +added $r->proxyreq method + +added PerlTransHandler directive + +minor clean-up + +=item *developer's test* release 0.82 - September 11, 1996 + +added Apache::Authen and Apache::AuthenDBI modules + +added $r->get_basic_auth_pw method + +added $r->note_basic_auth_failure method + +added PerlAuthHandler directive + +added $r->dir_config method + +added PerlSetVar directive + +we now have mod_perl.h + +fix for using mod_perl_fast with Apache-SSL + +=item release 0.81 - September 08, 1996 + +added Apache::CGI->exit method as suggested by Andreas + +items needed for 1.2 are now conditional using MODULE_MAGIC_NUMBER + +included Makefile.tmpl.1.2 + +=item release 0.80 - September 06, 1996 + +fix so we can send $strings of binary data to the client + +fix so we can log bytes sent + +added Andreas' CGI::XA kit for users of CGI.pm + mod_perl_fast + +added PerlSetupEnv directive + +added PerlSendHeader directive + +we now take advantage of Perl's new IO abstraction so STDIN and +STDOUT are hooked up to the client. +Thanks to Sven Verdoolaege for the +initial patch + +added $r->connection->close method + +added $r->exit method + +applied patch from Rob Hartill so read_client_block +works with apache-1.2 changes + +updated UsersGuide to suggest using configuration that does not +require patching mod_alias.c, thanks to Rob Hartill + +added $r->method_number method + +$r->method() now accepts an argument to change the request method +(for things like internal re-directs) + +added send_cgi_header method + +added internal_redirect_handler method + +applied NeXT fix from Andreas + +applied patch from Andreas to fix eval error line number +in Apache::Registry + +changed Changes file so it can be read with 'perldoc Changes' + +=item release 0.76b2 - August 16, 1996 + +updated Apache::CGI, now requires CGI.pm 2.22+ + +#undef pregcomp to fix namespace clash with Apache 1.2 + +added (placeholder for) PerlSetVar directive (need to think about it some more) + +applied patch from Andreas Koenig +to fix bug introduced with perl5.003_01 + IRIX combo + +=item release 0.76b1 - July 26, 1996 + +included Sven Verdoolaege's (experimental) patch for minimal TIEHANDLE +support, so we can tie *STDOUT, 'print' instead of '$r->print' that is. + +added (experimental) Apache::TieHandle module + +included Chip Salzenberg's FileHandle.pm patch + +added UsersGuide document + +if no PerlHandler is defined we fail with a SERVER_ERROR + +Apache::Registry now checks to make sure uri is not a directory + +applied Apache::Registry patch from Andreas for minor clean-up +and an extra error check + +=item release 0.75a1 - July 21, 1996 + +added Apache::Registry module contributed by +Andreas Koenig + +Apache::SSI now checks ExecCGI option before doing an 'exec' + +included patch for mod_alias.c to allow for PerlAlias directive + +added allow_options and is_perlaliased methods to Apache.pm + +added Apache::Options module + +added Apache::Debug module + +applied patch from Andreas Koenig to +-fake up a PerlScript if one is not specified +-ITERATE over PerlModule directive so it will accept multiple modules +-no longer store request_rec in $Apache::Request +we now require ExtUtils::Embed as it has been re-named for +the standard perl distribution as of 5.003_01 + + +=item release 0.71b1 - July 19, 1996 + +added PERL_CCFLAGS to Makefile.tmpl as suggested by +Lincoln Stein + +subroutines no longer need to return '0' for OK status, 200 and 1 +are 'OK' too. + +added 'PerlHandler' as replacement for 'PerlResponse', +seems like a more appropriate name after Salvador's +'AddHandler' suggestion + +added item to the handler_rec so we can say 'AddHandler' +Thanks to Salvador Ortiz + +fixed bug with storing 'PerlModule's read from srm.conf +Thanks to Salvador Ortiz for the spot and helping with the fix +more Makefile.tmpl fixes from Andreas Koenig + +=item release 0.70b1 - July 14, 1996 + +applied patches from Andreas Koenig +to fix Makefile.tmpl bug, NeXT define troubles, +typos and documentation clean-up + +Added Apache::SSI module for server side includes + +Added 'PerlModule' directive for loading modules in srm.conf + +fixed read_client_block bug that was causing trailing garbage to show up +n the client for some people. +Thanks to Alan Beale for the fix. + + +=item release 0.60a5 - June 25, 1996 + +fixed bug in mod_perl_fast that was causing bizarre problems for some people + +=item release 0.60a4 - June 18, 1996 + +dropped content and args methods from Apache.xs, moved to Apache.pm +The xs implementation was causing problems for some people + +added Apache::unescape_url function + +added $r->header_in method + + +=item release 0.60a3 - June 17, 1996 + +Added read() alias for read_client_block + +Updated Makefile.tmpl to use the renamed ExtUtils::embed + +Fixed various small bugs that were causing big problems + +pid $$ now set in mod_perl_fast, thanks to Alan Beale + +Added basic_http_header() method + + +=item release 0.60a2 - May 21, 1996 + +fixed bug in mod_perl_fast.c the caused problems with +$r->content and $r->args + +Added Apache::CGI module for those who use CGI.pm + +There's now a Makefile.PL (currently for installing perl-only modules). + + +=item release 0.60a1 - May 18, 1996 + +Started getting ready for optional Safe wrapper around scripts + +Added $r->get_remote_host() method, putting $r->connection->remote_host back to normal + +=item release 0.50a2 - May 9, 1996 + +new (faster) approach with mod_perl_fast + +Thanks to John Detloff +for friendly error checking code. + +we now use an Apache.pm file + +moved more code from mod_perl to Apache.xs so mod_perl_fast could share it + +rganized Apache.xs + +fixed $r->connection->remote_host + +hiding of 'Authorization' header is optional now + +added 'print' alias to 'write_client' + +dropped set_ prefix for several methods + +=item release 0.50a1 - May 1, 1996 + +xs_init now gets linked with us, as generated by Devel::embed +so we can bootstrap static extensions (including Apache) + +stomped out *main:: variables, moved to Apache.xs as methods + +added method 'request' to return the request pointer object +And did a typedef request_rec * Apache +so we don't need to say @request_recPtr::ISA = 'Apache'; anymore + +added method 'write_client' for sending a @list of data to the client + +added methods that simply access members of request_rec +-method +-uri +-protocol +-path_info +-filename + +added method 'args' +when called in a scalar context, it returns the query string +when called in a list context, it splits the query_string into key => vairs + +moved parsing code to Apache.xs, and now data is only read when the user +asks for it with the content() method. + +added method 'content' +when called in a scalar context, it reads data from the client +when called in a list context, it splits the content into key => vairs + +added method 'headers_in' to return a %hash of request headers +the 'Authentication' header is not returned + +added perl_call_argv to Apache->bootstrap ourselves + +we now flush the script's %ENV +users can set-up a standard CGI %ENV via method $r->cgi_vars + +the script's STDERR in now redirected to the error_log + +added client_to_stdout and client_to_stdin methods to +hookup the script's STDOUT and STDIN +** This is broken right now ** + +added method 'connection' and Apache::Connection class +returns a object reference to the request_rec's conn_rec +methods availible include: + + - remote_host + - remote_ip + - remote_logname + - remote_user + - auth_type + +added method 'server' and Apache::Server class +returns a object reference to the request_rec's server_rec +methods availible include: + + - server_admin + - server_host + - port + +Changes for Apache 1.1x +-rprintf to bputs, etc. + + +=item March 25, 1996 + +Initial version of mod_perl.c and perl_glue.xs +by Gisle Aas +Thanks for getting this started Gisle! + + +=back + +=cut diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Connection/Connection.pm ./usr.sbin/httpd/mod_perl/Connection/Connection.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Connection/Connection.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Connection/Connection.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,9 @@ +package Apache::Connection; + +use mod_perl (); + +$VERSION = '1.00'; +__PACKAGE__->mod_perl::boot($VERSION); + +1; +__END__ diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Connection/Makefile.PL ./usr.sbin/httpd/mod_perl/Connection/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Connection/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Connection/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,12 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + 'NAME' => 'Apache::Connection', + 'VERSION_FROM' => 'Connection.pm', # finds $VERSION + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Constants/Constants.pm ./usr.sbin/httpd/mod_perl/Constants/Constants.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Constants/Constants.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Constants/Constants.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,248 @@ +package Apache::Constants; + +use mod_perl (); + +{ + no strict; + $VERSION = "1.09"; + __PACKAGE__->mod_perl::boot($VERSION); +} + +unless(defined &import) { + require Exporter; + require Apache::Constants::Exports; + *import = \&Exporter::import; +} + +sub autoload { + if (defined &__AUTOLOAD) { #make extra sure we don't recurse + #why must we stringify first??? + __AUTOLOAD() if "$Apache::Constants::AUTOLOAD"; + goto &$Apache::Constants::AUTOLOAD; + } + else { + require Carp; + Carp::confess("__AUTOLOAD is undefined, ", + "trying to AUTOLOAD $Apache::Constants::AUTOLOAD"); + } +} + +if ($ENV{MOD_PERL}) { + #outside of mod_perl this will recurse looking for __AUTOLOAD, grr + *AUTOLOAD = \&autoload; +} + +my %ConstNameCache = (); + +sub export { + my $class = shift; + for my $new (@_) { + next if grep { $new eq $_ } @Apache::Constants::EXPORT_OK; + push @Apache::Constants::EXPORT_OK, $new; + if(%Apache::Constants::EXPORT) { + $Apache::Constants::EXPORT{$new} = 1; + } + } +} + +sub name { + my($self, $const) = @_; + require Apache::Constants::Exports; + return $ConstNameCache{$const} if $ConstNameCache{$const}; + + for (@Apache::Constants::EXPORT, + @Apache::Constants::EXPORT_OK) { + if ((\&{$_})->() eq $const) { + return ($ConstNameCache{$const} = $_); + } + } +} + +1; + +__END__ + +=head1 NAME + +Apache::Constants - Constants defined in apache header files + +=head1 SYNOPSIS + + use Apache::Constants; + use Apache::Constants ':common'; + use Apache::Constants ':response'; + +=head1 DESCRIPTION + +Server constants used by apache modules are defined in +B and other header files, this module gives Perl access +to those constants. + +=head1 EXPORT TAGS + +=over 4 + +=item common + +This tag imports the most commonly used constants. + + OK + DECLINED + DONE + NOT_FOUND + FORBIDDEN + AUTH_REQUIRED + SERVER_ERROR + +=item response + +This tag imports the B response codes, plus these +response codes: + + DOCUMENT_FOLLOWS + MOVED + REDIRECT + USE_LOCAL_COPY + BAD_REQUEST + BAD_GATEWAY + RESPONSE_CODES + NOT_IMPLEMENTED + CONTINUE + NOT_AUTHORITATIVE + +B and B are aliases for B. + +=item methods + +This are the method numbers, commonly used with +the Apache B method. + + METHODS + M_CONNECT + M_DELETE + M_GET + M_INVALID + M_OPTIONS + M_POST + M_PUT + M_TRACE + M_PATCH + M_PROPFIND + M_PROPPATCH + M_MKCOL + M_COPY + M_MOVE + M_LOCK + M_UNLOCK + +=item options + +These constants are most commonly used with +the Apache B method: + + OPT_NONE + OPT_INDEXES + OPT_INCLUDES + OPT_SYM_LINKS + OPT_EXECCGI + OPT_UNSET + OPT_INCNOEXEC + OPT_SYM_OWNER + OPT_MULTI + OPT_ALL + +=item satisfy + +These constants are most commonly used with +the Apache B method: + + SATISFY_ALL + SATISFY_ANY + SATISFY_NOSPEC + +=item remotehost + +These constants are most commonly used with +the Apache B method: + + REMOTE_HOST + REMOTE_NAME + REMOTE_NOLOOKUP + REMOTE_DOUBLE_REV + +=item http + +This is the full set of HTTP response codes: +(NOTE: not all implemented here) + + HTTP_OK + HTTP_MOVED_TEMPORARILY + HTTP_MOVED_PERMANENTLY + HTTP_METHOD_NOT_ALLOWED + HTTP_NOT_MODIFIED + HTTP_UNAUTHORIZED + HTTP_FORBIDDEN + HTTP_NOT_FOUND + HTTP_BAD_REQUEST + HTTP_INTERNAL_SERVER_ERROR + HTTP_NOT_ACCEPTABLE + HTTP_NO_CONTENT + HTTP_PRECONDITION_FAILED + HTTP_SERVICE_UNAVAILABLE + HTTP_VARIANT_ALSO_VARIES + +=item server + +These are constants related to server version: + + MODULE_MAGIC_NUMBER + SERVER_VERSION + SERVER_BUILT + +=item config + +These are constants related to configuration directives: + + DECLINE_CMD + +=item types + +These are constants related to internal request types: + + DIR_MAGIC_TYPE + +=item override + +These constants are used to control and test the context of configuration +directives. + + OR_NONE + OR_LIMIT + OR_OPTIONS + OR_FILEINFO + OR_AUTHCFG + OR_INDEXES + OR_UNSET + OR_ALL + ACCESS_CONF + RSRC_CONF + +=item args_how + + RAW_ARGS + TAKE1 + TAKE2 + TAKE12 + TAKE3 + TAKE23 + TAKE123 + ITERATE + ITERATE2 + FLAG + NO_ARGS + +=back + +=head1 AUTHORS + +Doug MacEachern, Gisle Aas and h2xs diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Constants/Makefile.PL ./usr.sbin/httpd/mod_perl/Constants/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Constants/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Constants/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,13 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + NAME => "Apache::Constants", + VERSION_FROM => "Constants.pm", + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/File/File.pm ./usr.sbin/httpd/mod_perl/File/File.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/File/File.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/File/File.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,220 @@ +package Apache::File; + +use strict; +use Fcntl (); +use mod_perl (); + +{ + no strict; + $VERSION = '1.01'; + __PACKAGE__->mod_perl::boot($VERSION); +} + +my $TMPNAM = 'aaaaaa'; +my $TMPDIR = $ENV{'TMPDIR'} || $ENV{'TEMP'} || '/tmp'; +my $Mode = Fcntl::O_RDWR()|Fcntl::O_EXCL()|Fcntl::O_CREAT(); +my $Perms = 0600; + +sub tmpfile { + my $class = shift; + my $limit = 100; + my $r = Apache->request; + while($limit--) { + my $tmpfile = "$TMPDIR/${$}" . $TMPNAM++; + ($tmpfile) = $tmpfile =~ /^([^<>|;*]+)$/; #untaint + my $fh = $class->new; + sysopen($fh, $tmpfile, $Mode, $Perms); + $r->register_cleanup(sub { unlink $tmpfile }) if $r; + if($fh) { + return wantarray ? ($tmpfile,$fh) : $fh; + } + } +} + +1; +__END__ + +=head1 NAME + +Apache::File - advanced functions for manipulating files at the server side + +=head1 SYNOPSIS + + use Apache::File (); + +=head1 DESCRIPTION + +Apache::File does two things: it provides an object-oriented interface +to filehandles similar to Perl's standard IO::File class. While the +Apache::File module does not provide all the functionality of +IO::File, its methods are approximately twice as fast as the +equivalent IO::File methods. Secondly, when you use Apache::File, it +adds several new methods to the Apache class which provide support for +handling files under the HTTP/1.1 protocol. + +=head1 Apache::File methods + +=over 4 + +=item new() + +This method creates a new filehandle, returning the filehandle object +on success, undef on failure. If an additional argument is given, it +will be passed to the open() method automatically. + + use Apache::File (); + my $fh = Apache::File->new; + + my $fh = Apache::File->new($filename) or die "Can't open $filename $!"; + +=item open() + +Given an Apache::File object previously created with new(), this +method opens a file and associates it with the object. The open() +method accepts the same types of arguments as the standard Perl open() +function, including support for file modes. + + $fh->open($filename); + + $fh->open(">$out_file"); + + $fh->open("|$program"); + +=item close() + +The close() method is equivalent to the Perl builtin close function, +returns true upon success, false upon failure. + + $fh->close or die "Can't close $filename $!"; + +=item tmpfile() + +The tmpfile() method is responsible for opening up a unique temporary +file. It is similar to the tmpnam() function in the POSIX module, but +doesn't come with all the memory overhead that loading POSIX does. It +will choose a suitable temporary directory (which must be writable by +the Web server process). It then generates a series of filenames using +the current process ID and the $TMPNAM package global. Once a unique +name is found, it is opened for writing, using flags that will cause +the file to be created only if it does not already exist. This +prevents race conditions in which the function finds what seems to be +an unused name, but someone else claims the same name before it can be +created. + +As an added bonus, tmpfile() calls the register_cleanup() method +behind the scenes to make sure the file is unlinked after the +transaction is finished. + +Called in a list context, tmpfile() returns the temporary file name +and a filehandle opened for reading and writing. In a scalar context +only the filehandle is returned. + + + my($tmpnam, $fh) = Apache::File->tmpfile; + + my $fh = Apache::File->tmpfile; + +=back + +=head1 Apache Methods added by Apache::File + +When a handler pulls in Apache::File, the module adds a number of new +methods to the Apache request object. These methods are generally of +interest to handlers that wish to serve static files from disk or +memory using the features of the HTTP/1.1 protocol that provide +increased performance through client-side document caching. + +=over 4 + +=item $r->discard_request_body() + +This method tests for the existence of a request body and if present, +simply throws away the data. This discarding is especially important +when persistent connections are being used, so that the request body +will not be attached to the next request. If the request is malformed, +an error code will be returned, which the module handler should +propagate back to Apache. + + if ((my $rc = $r->discard_request_body) != OK) { + return $rc; + } + +=item $r->meets_conditions() + +In the interest of HTTP/1.1 compliance, the meets_conditions() method +is used to implement ``conditional GET'' rules. These rules include +inspection of client headers, including If-Modified-Since, +If-Unmodified-Since, If-Match and If-None-Match. + +As far as Apache modules are concerned, they need only check the +return value of this method before sending a request body. If the +return value is anything other than OK, the module should return from +the handler with that value. A common return value other than OK is +HTTP_NOT_MODIFIED, which is sent when the document is already cached +on the client side, and has not changed since it was cached. + + if((my $rc = $r->meets_conditions) != OK) { + return $rc; + } + #else ... go and send the response body ... + +=item $r->mtime() + +This method returns the last modified time of the requested file, +expressed as seconds since the epoch. The last modified time may also +be changed using this method, although update_mtime() method is better +suited to this purpose. + + my $date_string = localtime $r->mtime; + +=item $r->set_content_length() + +This method sets the outgoing Content-length header based on its +argument, which should be expressed in byte units. If no argument is +specified, the method will use the size returned by $r->filename. This +method is a bit faster and more concise than setting Content-length in +the headers_out table yourself. + + $r->set_content_length; + $r->set_content_length(-s $r->finfo); #same as above + $r->set_content_length(-s $filename); + +=item $r->set_etag() + +This method is used to set the outgoing ETag header corresponding to +the requested file. ETag is an opaque string that identifies the +currrent version of the file and changes whenever the file is +modified. This string is tested by the meets_conditions() method if +the client provide an If-Match or If-None-Match header. + + $r->set_etag; + +=item $r->set_last_modified() + +This method is used to set the outgoing Last-Modified header from the +value returned by $r->mtime. The method checks that the specified time +is not in the future. In addition, using set_last_modified() is faster +and more concise than setting Last-Modified in the headers_out table +yourself. + +You may provide an optional time argument, in which case the method +will first call the update_mtime() to set the file's last modification +date. It will then set the outgoing Last-Modified header as before. + + $r->update_mtime((stat $r->finfo)[9]); + $r->set_last_modified; + $r->set_last_modified((stat $r->finfo)[9]); #same as the two lines above + +=item $r->update_mtime() + +Rather than setting the request record mtime field directly, you can +use the update_mtime() method to change the value of this field. It +will only be updated if the new time is more recent than the current +mtime. If no time argument is present, the default is the last +modified time of $r->filename. + + $r->update_mtime; + $r->update_mtime((stat $r->finfo)[9]); #same as above + $r->update_mtime(time); + +=cut diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/File/Makefile.PL ./usr.sbin/httpd/mod_perl/File/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/File/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/File/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,12 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + NAME => "Apache::File", + VERSION_FROM => "File.pm", + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL ./usr.sbin/httpd/mod_perl/INSTALL --- ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/INSTALL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,425 @@ +=head1 NAME + +INSTALL - Apache mod_perl installation instructions + +=head1 DESCRIPTION + +How to build, test, configure and install mod_perl + +=head1 PREREQUISITES + +=over 3 + +Apache version 1.3.6+ + +Perl version 5.004 or higher (5.005_03 or higher recommended) + +Win32 users, see INSTALL.win32 + +=back + +=head1 Build and install mod_perl + +=over 3 + +In this current directory run: + + perl Makefile.PL + make + make test (optional) + make install + +Makefile.PL will search for apache source trees to configure against, +if no source trees are found, you will be prompted for a path to one. + +When asked: + + "Configure mod_perl with ../apache_xxx/src ?" + +answering 'y' just tells Makefile.PL where we can find src/*.h + +When asked: + + "Shall I build httpd in $adir for you?" + +answering 'y' will run ../apache_xxx/src/Configure +and httpd will be built when running 'make' + +To avoid this prompt and default to the first apache source tree found +to configure and build against, use the following command: + + perl Makefile.PL DO_HTTPD=1 + +To avoid the prompts and avoid building httpd, use the following +command: + + perl Makefile.PL NO_HTTPD=1 + +You may wish see the instructions below on how to build by hand. + +In any case, you need to 'make install' so the perl side of mod_perl +will be installed. + +By default, all callback hooks except for PerlHandler are turned off. +You may edit src/modules/perl/Makefile, or enable when running +Makefile.PL + +Possible arguments are: + + PERL_POST_READ_REQUEST + PERL_TRANS + PERL_INIT + + PERL_HEADER_PARSER + PERL_AUTHEN + PERL_AUTHZ + PERL_ACCESS + PERL_TYPE + PERL_FIXUP + PERL_LOG + PERL_CLEANUP + PERL_CHILD_INIT + PERL_CHILD_EXIT + PERL_DISPATCH + + PERL_STACKED_HANDLERS + PERL_METHOD_HANDLERS + PERL_SECTIONS + PERL_SSI + +Example to enable PerlAuthenHandler and PerlFixupHandler: + + perl Makefile.PL PERL_AUTHEN=1 PERL_FIXUP=1 + +To enable all callback hooks: + + perl Makefile.PL ALL_HOOKS=1 + +To enable _all_ of the above, set EVERYTHING=1 + + perl Makefile.PL EVERYTHING=1 + +To enable tracing set PERL_TRACE=1 + + perl Makefile.PL PERL_TRACE=1 + +If a file name `makepl_args.mod_perl' is found in the same directory +as the mod_perl build location with any of these options, it will be +read in by Makefile.PL + +Example: + + % ls -1 . + apache_1.3/ + makepl_args.mod_perl + mod_perl-1.12/ + + % cat makepl_args.mod_perl + EVERYTHING=1 DO_HTTPD=1 + + % cd mod_perl-1.12 + % perl Makefile.PL && make test && make install + +You'll see all options enabled and you will not be prompted for apache +source location, it will default to ../apache_1.3 + +There is a sample makepl_args.mod_perl in the eg/ directory, in which +you might find a few options to enable experimental features to play +with too! :-) + +=item Installation of Apache header files + +By default, the apache headers files are installed into +$Config{sitearchexp}/auto/Apache/include + +The reason for installing the header files is to make life simple for +module authors/users when building/installing a module that taps into +some Apache C functions, e.g. Embperl, Apache::Peek, etc. + +If you wish not to install these files, tell Makefile.PL like so: + + perl Makefile.PL APACHE_HEADER_INSTALL=0 + +=item Linking Perl extensions static with httpd + +Normally, if an extension is linked static with Perl it is listed in +Config.pm's $Config{static_exts}, in which case, mod_perl will also +link this extension static with httpd. However, if an extension is +linked static with Perl after it is installed, it is not listed in +Config.pm. You may either edit Config.pm and add these extensions, or +configure mod_perl like so: + + perl Makefile.PL "PERL_STATIC_EXTS=Something::Static Another::One" + +=back + +=head1 Testing mod_perl + +=over 3 + +Running 'make test' will start an httpd on port 8529 running under +the uid and gid of the 'perl Makefile.PL' process, the httpd will +be terminated when the tests are finshed. + +To change the default port say: + + perl Makefile.PL PORT=xxxx + +To simply start the newly build httpd before 'make install' run: + + make start_httpd + +To shutdown this httpd run: + + make kill_httpd + +See t/README on how to run the mod_perl test suite by hand + +NOTE to Ben-SSL users: +httpsd does not seem to handle '/dev/null' as the location of certain +files, you'll have to change these by hand. +Tests are run with 'SSLDisable' + +=back + +=head1 Using an alternative Configuration file + +=over 3 + +If you wish to use a B file without having mod_perl's +Makefile.PL give it's copy to apache's B, configure +like so: + + perl Makefile.PL CONFIG=Configuration.custom + +Where B is the name of any file relative to the +apache source tree you build against. See the "building apache and +mod_perl by hand" instructions below on how to add the mod_perl +information to your custom Configuration file. + +=back + +=head1 Building apache and mod_perl by hand + +=over 3 + +** Only if you did not let Makefile.PL take care of this already ** + +=item mod_perl Makefile + +When Makefile.PL is run $APACHE_SRC/modules/perl/Makefile will be +modified to enable options (e.g. ALL_HOOKS=1) + +You may also edit mod_perl-x.xx/src/modules/perl/Makefile before +or after running Makefile.PL if you wish + +=item Configuration + +Edit apache_xxx/src/Configuration, adding: + + AddModule modules/perl/libperl.a + +We suggest you add this entry at the end of the Configuration file if +you want your callback hooks to have precedence over core handlers. + +Add the following to EXTRA_LIBS: + + EXTRA_LIBS=`perl -MExtUtils::Embed -e ldopts` + +Add the following to EXTRA_CFLAGS: + + EXTRA_CFLAGS=`perl -MExtUtils::Embed -e ccopts` + +=item mod_perl source files + +Copy the source files into the apache build directory: + + % cp -r src/modules/perl apache_xxx/src/modules/ + +Run: + + % perl Makefile.PL DYNAMIC=1 && make install + +When prompted, you must tell Makefile.PL where to find apache sources +(for header files), answer 'n' when asked +"Shall I build httpd in ../apache_x.x.x/src for you?" + +Follow the apache install docs from there + +=back + +=head1 Configuring and building with Stronghold + +=over 3 + +You must first build and install Stronghold without mod_perl, +following Stronghold's install procedure. + +Then, you may rebuild following the instructions above to: + + Build and install mod_perl + + or + + Building apache and mod_perl by hand + +Before running `make test', you must add your `StrongholdKey' +to t/conf/httpd.conf + +I you are configuring by hand, be sure to edit +src/modules/perl/Makefile and uncomment #APACHE_SSL + +For Solaris 2.5 users, there has been a report related to the REGEX +that comes with Stronghold, after building Apache with mod_perl would +produce core dumps. +To get around this: + +In STRONGHOLD/src/Configuration, Change: + + Rule WANTHSREGEX=default + +To: + + Rule WANTHSREGEX=no + +=back + +=head1 Installing on multiple machines + +=over 3 + +You may wish to build httpd once, then copy it to other machines. +The Perl side of mod_perl needs the apache headers files to compile, +to avoid dragging and build apache on all your other machines, there +are a few Makefile targets to help you out: + + 'make tar_Apache' + +This will tar all files mod_perl installs in your 'site_perl' directory, +into a file called 'Apache.tar'. +You can then unpack this under 'site_perl' on another machine. + + 'make offsite-tar' + +This will copy all header files from the apache source directory you +configured mod_perl against, then it will 'make dist' where you'll +a mod_perl-x.xx.tar.gz created, ready to unpack on another machine +to compile and install the Perl side of mod_perl. + +=back + +=head1 Notes + +=over 3 + +=item Compilers + +On most systems, both Perl and Apache+mod_perl must be built using the +same compiler. Sometimes Perl's configuration will choose one +compiler, e.g. I, but Apache's configuration chooses a different +one, e.g. I. If you run into this problem, consult Perl's and +Apache's INSTALL documents on how to ensure both are built with the +same compiler. + +=item BSDI users + +Gary Shea discovered a nasty BSDI bug (seen in +versions 2.1 and 3.0) related to dynamic loading and two workarounds: + +Turns out they use argv[0] to determine where to find the link +tables at run-time, so if a program either changes argv[0], +or does a chdir() (like apache!), it can easily confuse the +dynamic loader. The short-term solutions to the problem are +pitifully simple. Either of the following will work: + +1) Call httpd with a full path, e.g. /opt/www/bin/httpd + +2) Put the httpd you wish to run in a directory in your PATH +before any other directory containing a version of httpd, then +call it as 'httpd' -- don't use a relative path! + +=item AIX users + +If you build mod_perl as a DSO you will get core dumps as soon as you +try to use xs modules in perl, e.g. use Fcntl or use Socket. The +following patch to perl 5.005_3 does fix that problem: + + --- perl5.005_03/ext/DynaLoader/dl_aix.xs.orig Fri Mar 3 17:00:58 2000 + +++ perl5.005_03/ext/DynaLoader/dl_aix.xs Sun Apr 2 13:37:05 2000 + @@ -74,8 +74,8 @@ + } Module, *ModulePtr; + + /* + - * We keep a list of all loaded modules to be able to call the fini + - * handlers at atexit() time. + + * We keep a list of all loaded modules to be able to reference count + + * duplicate dlopen's. + */ + static ModulePtr modList; + + @@ -88,7 +88,6 @@ + + static void caterr(char *); + static int readExports(ModulePtr); + -static void terminate(void); + static void *findMain(void); + + static char *strerror_failed = "(strerror failed)"; + @@ -165,7 +164,6 @@ + if (!mainModule) { + if ((mainModule = findMain()) == NULL) + return NULL; + - atexit(terminate); + } + /* + * Scan the list of modules if have the module already loaded. + @@ -222,7 +220,16 @@ + mp->refCnt = 1; + mp->next = modList; + modList = mp; + - if (loadbind(0, mainModule, mp->entry) == -1) { + + /* + + * Assume anonymous exports come from the module this dlopen + + * is linked into, that holds true as long as dlopen and all + + * of the perl core are in the same shared object. Also bind + + * against the main part, in the case a perl is not the main + + * part, e.g mod_perl as DSO in Apache so perl modules can + + * also reference Apache symbols. + + */ + + if (loadbind(0, (void *)dlopen, mp->entry) == -1 || + + loadbind(0, mainModule, mp->entry) == -1) { + dlclose(mp); + errvalid++; + strcpy(errbuf, "loadbind: "); + @@ -336,12 +343,6 @@ + safefree(mp->name); + safefree(mp); + return result; + -} + - + -static void terminate(void) + -{ + - while (modList) + - dlclose(modList); + } + + /* Added by Wayne Scott + +Please make sure that you rebuild both perl and mod_perl after applying +this patch. + +=item more info + +Type 'perldoc mod_perl' for info on configuring, running +and writing Apache/Perl scripts and modules. + +=back + +=head1 Support + +See the SUPPORT file. + + + + + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.apaci ./usr.sbin/httpd/mod_perl/INSTALL.apaci --- ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.apaci Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/INSTALL.apaci Sun Jun 1 18:04:27 2003 @@ -0,0 +1,300 @@ +=head1 NAME + +INSTALL.apaci - Installing mod_perl under Unix with the new hybrid build environment for Apache 1.3 + +=head1 SUMMARY + +This document describes how to build and install mod_perl as clean as possible +with Apache 1.3 under Unix platforms by making use of both the Apache 1.3 +ConfigStart/End facility and the new Autoconf-style Interface (APACI). In +addition the Dynamic Shared Object (DSO) mechanism can be used to build +mod_perl as an Apache module which can be loaded on-demand under run-time. + +=head1 ATTENTION + +I + +=head1 BACKGROUND + +The source configuration mechanism in Apache 1.3 provides four major +highlights mod_perl can benefit from: + +=over 3 + +=item B + +This is a mechanism modules can use to link theirself into the configuration +processing. It is useful for automatically adjusting configuration and build +parameters from the modules sources. It is triggered by +C/C sections inside IC<.module> files. + +=item B + +This is the new top-level C script from Apache 1.3 which provides a +GNU Autoconf-style interface. It is useful for configuring the source tree +without manually editing any C files. Any parametrization +can be done via command line options to the C script. Internally +this is just a nifty a wrapper to the old C script. + +=item B + +This is beside Windows NT support one of most interesting features in Apache +1.3. Its a way to build Apache modules as so-called C +(usually named IC<.so>) which can be loaded via the C +directives from within Apache's C file. The benefit is that the +modules is part of the C program only on-demand, i.e. only when the +user wants the module it is loaded into the address space of the C +module. This is for instance interesting for memory consumption and easy +upgrade issues. The DSO mechanism is provided by Apache's C which +needs to be compiled into the C program. This is automatically done +when DSO is enabled for module C via C +or by explicitly adding C via C. + +=item B + +This is a new support tool from Apache 1.3 which can be used to build an +Apache module as a DSO even B the Apache source-tree. One can say +APXS is what MakeMaker and XS is for Perl. It knows the platform dependent +build parameters for making DSO files and provides an easy way to run the +build commands with them. + +=back + +Taking these four features together provides a way to integrate mod_perl into +Apache in a very clean and smooth way. I. + +=head1 DESCRIPTION + +To benefit from the above described features a new hybrid build environment +was created for the Apache-side of mod_perl. The Apache-side consists of the C +source files of mod_perl which have to be compiled into the C program. +They are usually copied to the subdirectory C in the Apache +source tree. To integrate this subtree into the Apache build process a lot of +adjustments were done by mod_perl's C in the past. And +additionally the C controlled the Apache build process. The +side-effect of this approach was that it is both an not very clean and +especially captive way. Because it assumed mod_perl is the only third-party +modules which has to be integrated into Apache. This is very problematic. + +The new approach described below avoids these problems. It only prepares the +C subtree inside the Apache source tree I +adjusting or editing anything else. This way no conflicts can occur. Instead +mod_perl is activated (and then configures itself) when the Apache source tree +is configured via standard APACI calls later. + +=head1 THE GAME ITSELF + +There are various ways available to build Apache with the new hybrid build +environment: + +=head2 The all-in-one way + +If your goal is just to build and install Apache 1.3 with mod_perl out of +their source trees and have no special interests in further adjusting or +enhancing Apache do the following: + + $ gunzip and mod_perl into the C hierarchy of +your existing Perl installation. All in one step. + +=head2 The flexible way + +This is the standard situation when you want to be flexible while building: +Statically building mod_perl into the C binary of Apache but via +different steps, so you have a chance for other third-party Apache modules, +etc. + +=over 3 + +=item B<1. Prepare the Apache 1.3 source tree> + +The first step is the extract the distributions: + + $ gunzip + +The second step is to install the Perl-side of mod_perl into the Perl system +and prepare the C subdirectory inside the Apache source +tree: + + $ cd mod_perl-1.XX + $ perl Makefile.PL \ + APACHE_SRC=../apache_1.3.X/src \ + DO_HTTPD=1 \ + USE_APACI=1 \ + PREP_HTTPD=1 \ + EVERYTHING=1 \ + [...] + $ make + $ make test + $ make install + $ cd .. + +(The C set the path to your Apache source tree, the C +option forces this path and only this path to be used, the C option +triggers the new hybrid build environment and the C forces only a +preparation of the C tree but no automatic builds.) + +This now prepares the Apache-side of mod_perl in the Apache source tree but +don't touches anything else inside it. It then just builds the Perl-side of +mod_perl and installs it into the Perl installation hierarchy. + +Important: If you use C as described above, to complete the +build you must go into an apache source directory and run C and +C. + +=item B<3. Additionally prepare other third-party modules> + +Now you still have a chance to prepare more third-party modules. For instance +the PHP3 language can be added similarly to the above mod_perl procedure. + +=item B<4. Build the Apache package> + +Finally its time to build the Apache package and thus also the +Apache-side of mod_perl and any other prepared third-party modules: + + $ cd apache_1.3.X + $ ./configure \ + --prefix=/path/to/install/of/apache \ + --activate-module=src/modules/perl/libperl.a \ + [...] + $ make + $ make test + $ make install + +(The C<--prefix> option is usually always needed and the C<--activate-module> +option activates mod_perl for the configuration process and thus also for the +build process.) + +=back + +Now bask in the glow and be happy to received a mod_perl-aware Apache 1.3 +system without having to mangle the Apache source tree for mod_perl plus the +freedom of being able to adding more third-party modules. + +=head1 EXPERIMENTAL + +With Apache 1.3 there is support for building modules as Dynamic Shared +Objects (DSO). So there is support for DSO in mod_perl now, too. I + +=head2 When DSO can be used + +If you want to build C as DSO you must make sure that Perl +was built with system's native malloc(). If Perl was built with its +own malloc() and C<-Dbincompat5005>, it pollutes the main C +program with I and I symbols. When C restarts +(happens at startup too), any references in the main program to +I and I become invalid, and this causes memory leaks and +segfaults. + +Notice that mod_perl's build system warns about this problem. + +With Perl 5.6.0+ this pollution can be prevented with +C<-Ubincompat5005>. or C<-Uusemymalloc> for any version of Perl, but +there's a chance that might hurt performance depending on platform, so +C<-Ubincompat5005> is likely a better choice. + +If you get the following reports with Perl version 5.6.0+: + + % perl -V:usemymalloc + usemymalloc='y'; + % perl -V:bincompat5005 + bincompat5005='define'; + +rebuild Perl with C<-Ubincompat5005>. + +For Perl versions pre-5.6.x, if you get: + + % perl -V:usemymalloc + usemymalloc='y'; + +rebuild Perl with C<-Uusemymalloc>. + +now rebuild mod_perl. + + +=head2 Build mod_perl as DSO inside Apache source tree via APACI + +We already said that the new mod_perl build environment is a hybrid one. What +does it mean? It means for instance that the same C stuff +can be used to build mod_perl as a DSO, too. I. When you want to build C (sorry +for the name, C would be more correct, but because of historic +Apache issues the name has to be C. Don't confuse this with +the real C or even C from the Perl installation) +all you have to do is to add one single option to the above steps. + +You have two options here, dependend on which way you choose above: If you +choose the all-in-one way above then add + + USE_DSO=1 + +to the mod_perl/Makefile.PL options. If you choose the flexible way then +add + + --enable-shared=perl + +to the Apache/configure options. + +As you can see only an additional C or C<--enable-shared=perl> +option is needed. Anything else is done automatically: C is +automatically enabled, the Makefiles are adjusted automatically and even the +C target from APACI now additionally installs the C into +the Apache installation tree. And even more: The C and +C directives are automatically added to the C file. + +=head2 Build mod_perl as DSO outside Apache source tree via APXS + +Above we've seen how to build mod_perl as DSO I the Apache source +tree. But there is a nifty alternative: Building mod_perl as DSO I +the Apache source tree via the new Apache 1.3 support tool C (APache +eXtension). The advantage is obvious: You can extend an already installed +Apache with mod_perl even if you don't have the sources (for instance you +installed an Apache binary package from your vendor). + +Here are the steps: + + $ gunzip B the Apache source tree with +the new Apache 1.3 support tool C and installs it into the existing +Apache hierarchy. + +=head1 AUTHOR + + Ralf S. Engelschall + rse@engelschall.com + rse@apache.org + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.raven ./usr.sbin/httpd/mod_perl/INSTALL.raven --- ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.raven Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/INSTALL.raven Sun Jun 1 18:04:27 2003 @@ -0,0 +1,50 @@ +This document explains how to install mod_perl with Raven SSL and Apache. +Please consult http://www.covalent.net/support if you have additional +questions. + +METHOD 1: Installing mod_perl dynamically (DSO) - Installs Raven SSL and +mod_perl dynamically + +1) untar and gunzip Raven SSL and mod_perl into their respective directories +2) cd raven_ssl-x.x.x. Install Raven SSL and Apache via +./setup --with-apache +3) cd mod_perl directory +4) perl Makefile.PL USE_APXS=1 \ + WITH_APXS=/usr/local/apache/bin/apxs \ + EVERYTHING=1 + [...] +5) make ; make install +6) move the LoadModule and Addmodule Perl lines in the Apache configuration +file above the + lines + + + +METHOD 2: Installing mod_perl statically - Installs Raven SSL dynamically +and mod_perl statically + +1) untar and gunzip Apache, Raven SSL and mod_perl into their respective +directories +2) cd raven_ssl-x.x.x. Install Raven SSL via ./setup +3) /usr/local/raven/bin/raven_admin_tls + select Option 1, 'Export Raven' + note: this option exports the required EAPI patches and the needed Raven +SSL module files into your Apache source tree +4) cd mod_perl-x.x +5) perl Makefile.PL APACHE_PREFIX=/path/to/apache_1.x.x \ + APACHE_SRC=/path/to/apache_x.x.x \ + EVERYTHING=1 \ + USE_APACI=1 \ + PREP_HTTPD=1 \ + DO_HTTPD=1 +6) make ; make install +7) cd apache directory +8) ./configure --target=httpsd \ + --enable-module=most \ + --enable-shared=max \ + --enable-suexec \ + --suexec-logfile=logs/suexec.log \ + --activate-module=src/modules/perl/libperl.a +9) make ; make install +10) in the Apache .conf file make sure that the AddModule mod_perl.c line is +above diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.simple ./usr.sbin/httpd/mod_perl/INSTALL.simple --- ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.simple Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/INSTALL.simple Sun Jun 1 18:04:27 2003 @@ -0,0 +1,17 @@ +#where APACHE_PREFIX is where you wish to have Apache installed +#e.g. APACHE_PREFIX=/usr/local/apache + +% lwp-download http://www.apache.org/dist/apache_x.x.x.tar.gz + +% lwp-download http://perl.apache.org/dist/mod_perl-x.xx.tar.gz + +% tar -zxf apache_x.x.x.tar.gz + +% tar -zxf mod_perl-x.xx.tar.gz + +% cd mod_perl-x.xx + +# mod_perl will build Apache for you +% perl Makefile.PL DO_HTTPD=1 USE_APACI=1 APACHE_PREFIX=/usr/local/apache + +% make test && make install diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.simple.mod_ssl ./usr.sbin/httpd/mod_perl/INSTALL.simple.mod_ssl --- ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.simple.mod_ssl Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/INSTALL.simple.mod_ssl Sun Jun 1 18:04:27 2003 @@ -0,0 +1,21 @@ +#download the sources +% lwp-download http://www.apache.org/dist/apache_x.xx.tar.gz +% lwp-download http://perl.apache.org/dist/mod_perl-x.xx.tar.gz +% lwp-download http://www.engelschall.com/sw/mod_ssl/distrib/mod_ssl-x.x.x-x.x.x.tar.gz + +#unpack the sources +% tar -zxf mod_perl-x.xx +% tar -zxf apache_x.xx.tar.gz +% tar -zxf mod_ssl-x.x.x-x.x.x.tar.gz + +#configure +% cd mod_ssl-x.x.x-x.x.x +% ./configure --with-apache=../apache_x.xx +% cd ../mod_perl-x.xx +% perl Makefile.PL USE_APACI=1 EVERYTHING=1 \ + SSL_BASE=/opt/ssl \ + APACHE_PREFIX=/opt/apachessl \ + APACI_ARGS=--enable-module=ssl,--enable-module=rewrite + +# build/test/install Apache/mod_ssl/mod_perl +% make test && make install diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.simple.ssl ./usr.sbin/httpd/mod_perl/INSTALL.simple.ssl --- ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.simple.ssl Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/INSTALL.simple.ssl Sun Jun 1 18:04:27 2003 @@ -0,0 +1,19 @@ + +% lwp-download http://www.apache.org/dist/apache_x.xx.tar.gz +% lwp-download http://perl.apache.org/dist/mod_perl-x.xx.tar.gz +% lwp-download http://www.apache-ssl.org/.../apache_x.x.x+ssl_x.xx.tar.gz +% tar -zxf apache_x.xx.tar.gz +% cd apache_x.xx +% tar -zxf ../apache_x.x.x+ssl_x.xx.tar.gz +% patch < SSLpatch +% +% cd - +% tar -zxf mod_perl-x.xx.tar.gz +% cd mod_perl-x.xx +% perl Makefile.PL && make test && make install + (answer 'y' to the 2 prompts below) +% Configure mod_perl with ../apache_x.xx/src ? [y] y +% Shall I build httpd in ../apache_x.xx/src for you? [y] y + (... see make stuff here ...) +% cp ../apache_x.xx/src/httpsd + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.simple.stronghold ./usr.sbin/httpd/mod_perl/INSTALL.simple.stronghold --- ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.simple.stronghold Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/INSTALL.simple.stronghold Sun Jun 1 18:04:27 2003 @@ -0,0 +1,13 @@ + + +% lwp-download http://perl.apache.org/dist/mod_perl-x.xx.tar.gz +% tar -zxf mod_perl-x.xx.tar.gz +% cd mod_perl-x.xx +% perl Makefile.PL && make test && make install + (answer 'y' to the 2 prompts below) + +% Configure mod_perl with /usr/local/stronghold/src ? [y] y +% Shall I build httpd in /usr/local/stronghold/src for you? [y] y + (... see make stuff here ...) +% cp /usr/local/stronghold/src/httpsd diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.win32 ./usr.sbin/httpd/mod_perl/INSTALL.win32 --- ../src.danvfs/usr.sbin/httpd/mod_perl/INSTALL.win32 Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/INSTALL.win32 Sun Jun 1 18:04:27 2003 @@ -0,0 +1,183 @@ +=head1 NAME + +INSTALL.win32 - Apache mod_perl installation instructions for Win32 + +=head1 DESCRIPTION + +How to build, test, configure and install mod_perl under Win32 + +=head1 PREREQUISITES + +=over 3 + +patience - mod_perl is considered alpha under NT and Windows9x. + +MSVC++ 5.0+, Apache version 1.3-dev or higher and Perl 5.004_02 or higher. + +As of version 1.24_01, mod_perl will build on Win32 ActivePerls +based on Perl-5.6.0 (builds 6xx). + +=back + +=head1 BINARIES + +See http://perl.apache.org/distributions.html for Win32 binaries, +including ActivePerl ppms of mod_perl and some Apache::* packages. + +=head1 CHANGES + +Beginning with version 1.3.15, Apache has changed the convention +for naming Win32 modules in order to follow that for Unix systems. +Consequently, the name of the mod_perl module built here has +been changed from ApacheModulePerl.dll to mod_perl.so. This +is just a change in convention; if you are building mod_perl +against pre-1.3.15 Apache sources, and wish to follow the old +convention, simply copy mod_perl.so to your Apache modules directory +as ApacheModulePerl.dll. + +=head1 BUILDING + +There are two ways to build mod_perl - with MS Developer Studio, +and through command-line arguments to 'perl Makefile.PL'. + +=head2 Building with MS Developer Studio + +=over 3 + +=item Setup the Perl side + +Run + + perl Makefile.PL + nmake install + +This will install the Perl side of mod_perl and setup files for the +library build. + +=item Build mod_perl.so + +Using MS developer studio, + + select "File -> Open Workspace ...", + select "Files of type [Projects (*.dsp)]" + open mod_perl-x.xx/src/modules/win32/mod_perl.dsp + +=item Settings + + select "Tools -> Options -> [Directories]" + + select "Show directories for: [Include files]" + +You'll need to add the following paths: + + C:\apache_x.xx\src\include + . (should expand to C:\...\mod_perl-x.xx\src\modules\perl) + C:\perl\lib\Core + +select "Project -> Add to Project -> Files" adding: + + perl.lib (or perl56.lib) (e.g. C:\perl\lib\Core\perl.lib) + ApacheCore.lib (e.g. C:\Apache\ApacheCore.lib) + + select "Build -> Set Active Configuration... -> + [mod_perl - Win32 Release]" + + select "Build -> Build mod_perl.so" + +You may see some harmless warnings, which can be reduced (along with +the size of the DLL), by setting: + + "Project -> Settings -> [C/C++] -> Category: [Code Generation] -> + Use runtime library: [Multithreaded DLL] + +=item Testing + +Once mod_perl.so is built and apache.exe is installed you may +test mod_perl with: + + nmake test + +=item Apache setup + +You do not need to rebuild apache, just copy mod_perl.so to +$SERVER_ROOT/modules + +=back + +=head2 Building with arguments to 'perl Makefile.PL' + +Generating the Makefile as, for example, + + perl Makefile.PL APACHE_SRC=..\apache_1.3.xx INSTALL_DLL=\Apache\modules + +will build mod_perl (including mod_perl.so) entirely from +the command line. The arguments accepted include + +=over 3 + +=item APACHE_SRC + +This can be one of two values: either the path to the Apache build +directory (eg, ..\apache_1.3.xx), or to the installed Apache location +(eg, \Apache). This is used to set the locations of ApacheCore.lib +and the Apache header files. + +=item INSTALL_DLL + +This gives the location of where to install mod_perl.so +(eg, \Apache\modules). No default is assumed - if this argument +is not given, mod_perl.so must be copied manually. + +=item DEBUG + +If true (DEBUG=1), a Debug version will be built (this assumes +that a Debug Apache has been built). If false, or not given, +a Release version will be built. + +=item EAPI + +If true (EAPI=1), EAPI (Extended API) will be defined when +compiling. This is useful when building mod_perl against mod_ssl +patched Apache sources. If false, or not given, EAPI will +not be defined. + +=back + +After this, running + + nmake + nmake test + nmake install + +will complete the installation. + +This latter method of building mod_perl will also install the +Apache and mod_perl header files, which can then be accessed +through the Apache::src module. + +=head1 CONFIGURATION + +Add this line to httpd.conf: + + LoadModule perl_module modules/mod_perl.so + +Be sure that 'C:\perl\bin' is in your path so apache can find perl.dll + +See the cgi_to_mod_perl.pod and mod_perl.pod documents for general +configuration. + +=head1 NOTES + +mod_perl-win32 is considered alpha, at the time of this writing, so is +Apache-NT (1.3a1) + +CGI::Switch does not work with apache_1.3a1 because basic_http_header() +is not exported by the ApacheCore.dll For now, just change: + + use CGI::Switch (); + my $q = CGI::Switch->new; + + - to - + + use CGI (); + my $q = CGI->new; diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/LICENSE ./usr.sbin/httpd/mod_perl/LICENSE --- ../src.danvfs/usr.sbin/httpd/mod_perl/LICENSE Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/LICENSE Sun Jun 1 18:04:27 2003 @@ -0,0 +1,49 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + */ + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Leak/Leak.pm ./usr.sbin/httpd/mod_perl/Leak/Leak.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Leak/Leak.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Leak/Leak.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,86 @@ +package Apache::Leak; + +use strict; +use DynaLoader (); +use Exporter (); +*import = \&Exporter::import; +{ + no strict; + @EXPORT = qw(leak_test); + $VERSION = '1.00'; + @ISA = qw(DynaLoader); + __PACKAGE__->bootstrap($VERSION); +} + +sub LOOP_N () {2} + +sub leak_test (&;$$) { + my($cv, $x, $fh) = @_; + $x ||= LOOP_N; + $fh ||= \*STDERR; + my $first = $x; + + while($x--) { + my $handle; + my $enter = NoteSV($handle); + my $leave = 0; + print $fh "ENTER: $enter SVs\n"; + { + $cv->(); + } + $leave = CheckSV($handle); + print $fh "\nLEAVE: $leave SVs\n"; + if($enter != $leave) { + my $n = $leave - $enter; + if($x+1 == $first) { + } + else { + print $fh "!!! $n SVs leaked !!!\n"; + } + } + } +} + +sub handler { + my $r = shift; + my $uri = $r->uri; + my $handle; + my $count = NoteSV($handle); + $r->push_handlers(PerlLogHandler => sub { + warn "Leak test for $uri:\n"; + warn " ENTER: $count SVs\n"; + $count = CheckSV($handle); + warn " LEAVE: $count SVs\n"; + }); + 0; +} + +1; +__END__ + +=head1 NAME + +Apache::Leak - Module for tracking memory leaks in mod_perl code + +=head1 SYNOPSIS + + use Apache::Leak; + + leak_test { + my $obj = Foo->new; + $obj->thingy; + }; + #now look in error_log for results + +=head1 DESCRIPTION + +"Under Construction." + +=head1 SEE ALSO + +Devel::Leak + +=head1 AUTHOR + +Doug MacEachern +Leak.xs derived from Nick Ing-Simmons' Devel::Leak diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Leak/Leak.xs ./usr.sbin/httpd/mod_perl/Leak/Leak.xs --- ../src.danvfs/usr.sbin/httpd/mod_perl/Leak/Leak.xs Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Leak/Leak.xs Sun Jun 1 18:04:27 2003 @@ -0,0 +1,179 @@ +/* + Copyright (c) 1995,1996-1998 Nick Ing-Simmons. All rights reserved. + This program is free software; you can redistribute it and/or + modify it under the same terms as Perl itself. +*/ +/* + modified by dougm for use with 5.004_04 + future versions may be made special for the mod_perl environment +*/ + +#include +#include +#include + +#include "patchlevel.h" +#if ((PATCHLEVEL == 4) && (SUBVERSION <= 76)) +#define PL_sv_arenaroot sv_arenaroot +#endif + +typedef long used_proc _((void *, SV *, long)); +typedef struct hash_s *hash_ptr; + +#define MAX_HASH 1009 + +static hash_ptr pile = NULL; + +static void +LangDumpVec(char *who, int count, SV **data) +{ + int i; + PerlIO_printf(PerlIO_stderr(), "%s (%d):\n", who, count); + for (i = 0; i < count; i++) + { + SV *sv = data[i]; + if (sv) { + PerlIO_printf(PerlIO_stderr(), "%2d ", i); + sv_dump(sv); + } + } +} + +struct hash_s { + struct hash_s *link; + SV *sv; + char *tag; +}; + +static char *lookup(hash_ptr *ht, SV *sv, void *tag) +{ + unsigned hash = ((unsigned long) sv) % MAX_HASH; + hash_ptr p = ht[hash]; + while (p) { + if (p->sv == sv) { + char *old = p->tag; + p->tag = (char *) tag; + return old; + } + p = p->link; + } + if ((p = pile)) + pile = p->link; + else + p = (hash_ptr) malloc(sizeof(struct hash_s)); + p->link = ht[hash]; + p->sv = sv; + p->tag = (char *)tag; + ht[hash] = p; + return NULL; +} + +static void check_arenas() +{ + SV *sva; + for (sva = PL_sv_arenaroot; sva; sva = (SV *) SvANY(sva)) { + SV *sv = sva + 1; + SV *svend = &sva[SvREFCNT(sva)]; + while (sv < svend) { + if (SvROK(sv) && ((IV) SvANY(sv)) & 1) { + warn("Odd SvANY for %p @ %p[%d]",sv,sva,(sv-sva)); + abort(); + } + ++sv; + } + } +} + +static long int sv_apply_to_used(void *p, used_proc *proc, long int n) +{ + SV *sva; + for (sva = PL_sv_arenaroot; sva; sva = (SV *) SvANY(sva)) { + SV *sv = sva + 1; + SV *svend = &sva[SvREFCNT(sva)]; + + while (sv < svend) { + if (SvTYPE(sv) != SVTYPEMASK) { + n = (*proc) (p, sv, n); + } + ++sv; + } + } + return n; +} + +static char * t_old = "old"; +static char * t_new = "new"; + +static long note_sv(void *p, SV *sv, long int n) { + lookup((struct hash_s **)p, sv, t_old); + return n+1; +} + +static long note_used(hash_ptr **x) +{ + hash_ptr *ht; + Newz(603, ht, MAX_HASH, hash_ptr); + *x = ht; + return sv_apply_to_used(ht, note_sv, 0); +} + +static long check_sv(void *p, SV *sv, long hwm) +{ + char *state = lookup((struct hash_s **)p, sv, t_new); + if (state != t_old) { + PerlIO_printf(PerlIO_stderr(), "%s %p : ", state ? state : t_new, sv); + sv_dump(sv); + } + return hwm+1; +} + +static long check_used(hash_ptr **x) { + hash_ptr *ht = *x; + long count = sv_apply_to_used(ht, check_sv, 0); + long i; + for (i = 0; i < MAX_HASH; i++) { + hash_ptr p = ht[i]; + while (p) { + hash_ptr t = p; + p = t->link; + if (t->tag != t_new) { + LangDumpVec(t->tag ? t->tag : "NUL", 1, &t->sv); + } + t->link = pile; + pile = t; + } + } + free(ht); + *x = NULL; + return count; +} + +MODULE = Apache::Leak PACKAGE = Apache::Leak + +PROTOTYPES: Enable + +IV +NoteSV(obj) + hash_ptr * obj = NO_INIT + + CODE: + RETVAL = note_used(&obj); + + OUTPUT: + obj + RETVAL + +IV +CheckSV(obj) + hash_ptr * obj + + CODE: + RETVAL = check_used(&obj); + + OUTPUT: + RETVAL + +void +check_arenas() + + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Leak/Makefile.PL ./usr.sbin/httpd/mod_perl/Leak/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Leak/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Leak/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,7 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => "Apache::Leak", + VERSION_FROM => "Leak.pm", +); + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Leak/typemap ./usr.sbin/httpd/mod_perl/Leak/typemap --- ../src.danvfs/usr.sbin/httpd/mod_perl/Leak/typemap Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Leak/typemap Sun Jun 1 18:04:27 2003 @@ -0,0 +1,2 @@ +hash_ptr * T_PTR + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Log/Log.pm ./usr.sbin/httpd/mod_perl/Log/Log.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Log/Log.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Log/Log.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,56 @@ +package Apache::Log; + +use mod_perl (); + +$VERSION = '1.01'; +__PACKAGE__->mod_perl::boot($VERSION); + +1; +__END__ + +=head1 NAME + +Apache::Log - Interface to Apache logging + +=head1 SYNOPSIS + + use Apache::Log (); + my $rlog = $r->log; + $rlog->debug("You only see this if `LogLevel' is set to `debug'"); + + my $slog = $r->server->log; + +=head1 DESCRIPTION + +The Apache::Log module provides an interface to Apache's I +and I routines. + +=over 4 + +=item emerg + +=item alert + +=item crit + +=item error + +=item warn + +=item notice + +=item info + +=item debug + +=back + +=head1 AUTHOR + +Doug MacEachern + +=head1 SEE ALSO + +mod_perl(3), Apache(3). + +=cut diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Log/Makefile.PL ./usr.sbin/httpd/mod_perl/Log/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Log/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Log/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,13 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + NAME => "Apache::Log", + VERSION_FROM => "Log.pm", + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/MANIFEST ./usr.sbin/httpd/mod_perl/MANIFEST --- ../src.danvfs/usr.sbin/httpd/mod_perl/MANIFEST Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/MANIFEST Sun Jun 1 18:04:27 2003 @@ -0,0 +1,238 @@ +Changes +Constants/Constants.pm +Constants/Makefile.PL +File/File.pm +File/Makefile.PL +ModuleConfig/ModuleConfig.pm +ModuleConfig/Makefile.PL +Log/Makefile.PL +Log/Log.pm +URI/Makefile.PL +URI/URI.pm +Util/Makefile.PL +Util/Util.pm +Server/Makefile.PL +Server/Server.pm +Connection/Makefile.PL +Connection/Connection.pm +LICENSE +CREDITS +INSTALL +INSTALL.apaci +SUPPORT +INSTALL.win32 +INSTALL.raven +MANIFEST +STATUS +Makefile.PL +README +apache-modlist.html +mod_perl.gif +mod_perl.pod +mod_perl_cvs.pod +mod_perl_tuning.pod +cgi_to_mod_perl.pod +mod_perl_traps.pod +mod_perl_method_handlers.pod +eg/makepl_args.mod_perl +eg/README +lib/mod_perl_hooks.pm.PL +lib/mod_perl.pm +lib/Apache/src.pm +lib/Apache/httpd_conf.pm +lib/Apache/test.pm +lib/Apache/Debug.pm +lib/Apache/ExtUtils.pm +lib/Apache/FakeRequest.pm +lib/Apache/Opcode.pm +lib/Apache/Options.pm +lib/Apache/PerlRun.pm +lib/Apache/PerlSections.pm +lib/Apache/Registry.pm +lib/Apache/RegistryNG.pm +lib/Apache/RegistryBB.pm +lib/Apache/RegistryLoader.pm +lib/Apache/Resource.pm +#lib/Apache/Safe.pm +lib/Apache/SIG.pm +lib/Apache/SizeLimit.pm +lib/Apache/StatINC.pm +lib/Apache/Symdump.pm +lib/Apache/Constants/Exports.pm +Apache/Apache.pm +Apache/typemap +Apache/Makefile.PL +Symbol/Makefile.PL +Symbol/Symbol.pm +Symbol/Symbol.xs +Symbol/test.pl +Leak/Leak.pm +Leak/Leak.xs +Leak/Makefile.PL +Leak/typemap +src/modules/perl/apache_inc.h +src/modules/perl/perl_PL.h +src/modules/perl/Exports.c +src/modules/perl/File.xs +src/modules/perl/Constants.xs +src/modules/perl/Apache.xs +src/modules/perl/Connection.xs +src/modules/perl/Server.xs +src/modules/perl/ModuleConfig.xs +src/modules/perl/Log.xs +src/modules/perl/URI.xs +src/modules/perl/Util.xs +src/modules/perl/Table.xs +src/modules/perl/ldopts +src/modules/perl/mod_perl.c +src/modules/perl/mod_perl.h +src/modules/perl/op_mask.c +src/modules/perl/mod_perl_opmask.c +src/modules/perl/mod_perl_xs.h +src/modules/perl/perl_util.c +src/modules/perl/perlio.c +src/modules/perl/perl_config.c +src/modules/perl/Makefile +src/modules/win32/mod_perl.dsp +src/modules/win32/mod_perl.def +src/opcodes.txt +t/report.PL +t/README +t/TEST +t/TEST.win32 +t/conf/httpd.conf.pl +t/conf/httpd.conf-dist +t/conf/httpd.conf-win32 +t/conf/mod_perl_srm.conf +t/net/config.pl.dist +t/modules/actions.t +t/modules/cgi.t +t/modules/constants.t +#t/modules/eperl.t +#t/modules/embperl.t +t/modules/file.t +t/modules/httpdconf.t +t/modules/log.t +t/modules/uri.t +t/modules/util.t +t/modules/psections.t +t/modules/perlrun.t +t/modules/include.t +t/modules/ssi.test +t/modules/src.t +t/modules/stage.t +t/modules/status.t +t/modules/symbol.t +t/modules/module.t +t/modules/request.t +t/modules/cookie.t +t/internal/api.t +t/internal/auth.t +t/internal/croak.t +t/internal/dirmagic.t +t/internal/error.t +t/internal/headers.t +t/internal/hooks.t +t/internal/http-get.t +t/internal/http-post.t +t/internal/proxy.t +t/internal/redirect.t +t/internal/rwrite.t +t/internal/stacked.t +#t/internal/resolver.t +t/internal/table.t +t/internal/taint.t +t/net/perl/have_module.pl +t/net/perl/module.pl +t/net/perl/file.pl +t/net/perl/log.pl +t/net/perl/uri.pl +t/net/perl/util.pl +t/net/perl/file_upload.cgi +t/net/perl/tie_table.pl +t/net/perl/qredirect.pl +t/net/perl/hooks.pl +t/net/perl/action.pl +t/net/perl/api.pl +t/net/perl/constants.pl +t/net/perl/cgi.pl.PL +t/net/perl/ssi.pl +t/net/perl/echo +t/net/perl/test +t/net/perl/taint.pl +t/net/perl/raw.pl +t/net/perl/rwrite.pl +t/net/perl/sym.pl +t/net/perl/throw_error.pl +t/net/perl/server_error.pl +t/net/perl/dirty-script.cgi +t/net/perl/dirty-test.cgi +t/net/perl/dirty-lib +t/net/perl/request-upload.pl +t/net/perl/request-param.pl +t/net/perl/request-cookie.pl +#t/net/perl/resolver.pl +t/net/perl/io/redir.pl +t/net/perl/io/redir1.pl +t/net/perl/io/redir2.pl +t/net/perl/io/perlio.pl +t/net/perl/io/ssi1.pl +t/net/perl/io/ssi2.pl +t/net/perl/io/include.pl +t/net/perl/io/dir_config.pl +t/net/perl/noenv/test.pl +lib/Apache/RedirectLogFix.pm +lib/Apache/Include.pm +lib/Apache/Status.pm +lib/Bundle/Apache.pm +t/docs/book.gif +t/docs/auth/.htaccess +t/docs/dirmagic/cal.txt +t/docs/null.txt +t/docs/error.txt +t/docs/env.iphtml +t/docs/lists.ehtml +t/docs/test.ep +t/docs/test.html +t/docs/rgy-include.shtml +t/docs/badsyntax.pl +t/docs/startup.pl +t/docs/rl.pl +t/docs/stacked.pl +t/docs/LoadClass.pm +t/docs/content.html +t/docs/content.shtml +t/docs/STAGE/u1/nada.txt +t/TestDirectives/Makefile.PL +t/TestDirectives/TestDirectives.pm +benchmark/lwp-simple.pod +benchmark/stopwatch.pod +faq/Makefile +faq/mod_perl_api.pod +faq/mod_perl_cgi.pod +faq/mod_perl_faq.pod +faq/mjtg-news.txt +htdocs/manual/mod/mod_perl.html +Table/Makefile.PL +Table/Table.pm +apaci/Makefile.libdir +apaci/Makefile.tmpl +apaci/README +apaci/configure +apaci/libperl.module +apaci/mod_perl.config.sh +apaci/load_modules.pl.PL +apaci/find_source.PL +apaci/apxs_cflags.PL +apaci/perl_config.PL +apaci/mod_perl.exp +.gdbinit +INSTALL.simple +INSTALL.simple.ssl +INSTALL.simple.stronghold +INSTALL.simple.mod_ssl +t/docs/subr/.exists +PerlRunXS/Makefile.PL +PerlRunXS/PerlRunXS.pm +src/modules/perl/PerlRunXS.xs + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Makefile.PL ./usr.sbin/httpd/mod_perl/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,2605 @@ +#!perl + +BEGIN { + $Is_Win32 = ($^O eq "MSWin32"); + $Is_Cygwin = ($^O =~ m/cygwin/g); + if($Is_Win32) { + require 5.004_02; + } elsif($Is_Cygwin) { + require 5.005_03; + } else { + require 5.003_97; + } +} + +sub MMN_130 () { 19980527 } + +use ExtUtils::MakeMaker; +use Config (); +use FileHandle (); +use DirHandle (); +use File::Compare (); +use File::Basename qw(dirname basename); +use File::Path qw(mkpath rmtree); +use Cwd; +use File::Copy qw(cp); + +#use Apache::ExtUtils qw(%Config); + +unless (%Config) { + *Config = \%Config::Config; +} + +my %vcache = (); #SERVER_VERSION +my %mcache = (); #MODULE_MAGIC_NUMBER + +#version 1.5 that ships with 5.003 is broken! +*cp = sub { + system "cp @_"; + for (@_) { -e $_ or die $! } +} if $File::Copy::VERSION < 2.0; + +my $Is_dougm = (defined($ENV{USER}) && ($ENV{USER} eq "dougm")); +my $USE_THREADS; +my $thrlib = join '|', qw(-lpthread); + +if ($] < 5.005_60) { + $USE_THREADS = (defined($Config{usethreads}) && + ($Config{usethreads} eq "define")); +} +else { + $USE_THREADS = (defined($Config{use5005threads}) && + ($Config{use5005threads} eq "define")); +} + +#hmm, seems the #include flip/flop isn't needed anymore +#so ignore the stuff above for now +$USE_THREADS = $ENV{PERL_USE_THREADS} || 0; + +require "./lib/mod_perl.pm"; +$VERSION = $mod_perl::VERSION = $mod_perl::VERSION; +{ + $VERSION =~ s/(\d\d)(\d\d)$/$1_$2/; +} +{ + local *FH; + open FH, "Changes"; + while() { + if(/^=item.*-dev/) { + $VERSION .= "-dev"; + last; + } + last if /^=item/; + } + close FH; +} + +use subs qw(iedit asrc); + +if($] < 5.004_04) { + print < "Ben-SSL", + "apache_ssl.c" => "Ben-SSL", + "mod_ssl.h" => "Stronghold", + "modules/modssl" => "Stronghold", +); + +unless (-e "t/docs/test.shtml") { + cp "t/docs/test.html", "t/docs/test.shtml"; +} + +for (qw(.htaccess hooks.txt)) { + my $file = "t/docs/$_"; + local *FH; + open FH, ">$file" or + die "can't write test file: $file: $!"; + chmod 0666, $file; + close FH; +} + +chmod 0644, "t/conf/mod_perl_srm.conf"; + +mkdir "t/logs", 0777; +chmod 0777, "t/logs"; + +unless ($Is_Win32) { + system "chmod a+x t/net/perl/* t/net/perl/io/*"; +} + +#generated by us at one time or another +my(@do_clean) = qw{ + t/docs/.htaccess + t/docs/hooks.txt + src/Configuration + lib/Apache/MyConfig.pm + Apache/Apache.xs + Constants/Constants.xs + t/modules/ssi.t + t/logs/error_log + t/conf/srm.conf + t/conf/dev-null + t/logs/httpd.pid + src/modules/perl/mod_perl_version.h + t/net/perl/cgi.pl + t/report + t/httpd + apaci/find_source + apaci/apxs_cflags + apaci/mod_perl.config +}; +#t/conf/httpd.conf +#t/net/config.pl + +for(@do_clean) { unlink $_ } + +unless ($Is_Win32) { + rename "t/conf/httpd.conf", "t/conf/httpd.conf.old"; +} + +rmtree "t/docs/stacked", 0, 0; + +gen_script("t/net/perl/cgi.pl"); +gen_script("t/report"); +gen_script("apaci/find_source"); +gen_script("apaci/apxs_cflags"); +gen_script("apaci/perl_config", "$PWD/lib"); +gen_script("apaci/load_modules.pl"); + +write_version_h("src/modules/perl"); + +my(@test_pre_init) = qq( +test_pre_init: +); + +# Automatic setup support +my(@adirs, %seen, %mft_map, %vers_map, $src_dir, $vers, $conf, $ans); +%vers_map = ( + '1.1.1' => "Makefile.tmpl", + '1.1.3' => "Makefile.tmpl", + '1.2' => "Makefile.tmpl-1.2", + '1.1.1Xcert-Sentry' => "Makefile.tmpl-XCert", + '1.1.1Ben-SSL' => "Makefile.tmpl-Ben-SSL", + '1.1.3Ben-SSL' => "Makefile.tmpl-Ben-SSL", + '1.2Ben-SSL' => "", + NONE => "", +); + +$LIBPERL = "DEFAULT"; +$USE_APACI = $USE_DSO = $USE_APXS = 0; +$WITH_APXS = ""; +$APACI_ARGS = ""; +@APACI_ARGS = (); +$EVERYTHING = $EXPERIMENTAL = 0; +$PERL_DEBUG = ""; +$PERL_DESTRUCT_LEVEL = ""; +$PERL_STATIC_EXTS = ""; +$PERL_USELARGEFILES = 1; +$PERL_EXTRA_CFLAGS = ""; +$PERL_EXTRA_LIBS = ""; +$SSLCacheServerPort = 8539; +$SSL_BASE = ""; +$Port = $ENV{HTTP_PORT} || 8529; +#so Doug can 'make test' different-builds@sametime/samebox +if(!$Is_Win32 and $ENV{RANDOM_PORT} and $$ > 8000 and $$ < 30000) { + $PORT ||= $$; + print "I'll use Port $PORT\n"; +} +$PORT ||= $Port; +$TARGET = ""; +$DO_HTTPD = $ENV{DO_HTTPD} || 0; +$NO_HTTPD = $ENV{NO_HTTPD} || 0; +$PREP_HTTPD = 0; +$PERL_TRACE = 0; +$ALL_HOOKS = 0; +$APACHE_SRC = ""; +$APACHE_PREFIX = ""; +$APACHE_HEADER_INSTALL = 1; +$PERL_SECTIONS = 0; +$PERL_SSI = 0; +$ADD_VERSION = 1; +$STATIC = 1; +$DYNAMIC = 0; +$CONFIG = ""; +$ADD_MODULE = ""; +$PERL_DIRECTIVE_HANDLERS = 0; +$PERL_TABLE_API = 0; +$PERL_LOG_API = 0; +$PERL_URI_API = 0; +$PERL_UTIL_API = 0; +$PERL_FILE_API = 0; +$PERL_CONNECTION_API = 1; #these two were split out late in the game +$PERL_SERVER_API = 1; #so they are on by default +$PERL_RUN_XS = 0; +$MOD_PERL_PREFIX; + +my %experimental = map { $_,1 } qw{ +PERL_AUTOPRELOAD +PERL_RUN_XS +PERL_MARK_WHERE +DO_INTERNAL_REDIRECT +PERL_TIE_SCRIPTNAME +PERL_STASH_POST_DATA +XS_IMPORT +PERL_SAFE_STARTUP +PERL_DEFAULT_OPMASK +PERL_ORALL_OPMASK +}; + +my %PassEnv = map { $_,1 } qw(SSL_BASE); + +my @mp_args = (keys %PassEnv, + qw(EXPERIMENTAL EVERYTHING DO_HTTPD NO_HTTPD CONFIG ADD_MODULE + APACHE_PREFIX + USE_APACI USE_DSO USE_APXS WITH_APXS APACI_ARGS PREP_HTTPD + ALL_HOOKS ADD_VERSION STATIC DYNAMIC PORT XS_IMPORT)); + +sub is_mp_arg { + my $arg = shift; + + return 1 if $experimental{$arg}; + + for (@mp_args) { + return 1 if $arg eq $_; + } + return 0; +} + +#callback hooks +@callback_hooks = qw{ + PERL_DISPATCH + PERL_CHILD_INIT PERL_CHILD_EXIT + PERL_POST_READ_REQUEST PERL_TRANS PERL_HEADER_PARSER + PERL_ACCESS PERL_AUTHEN PERL_AUTHZ + PERL_TYPE PERL_FIXUP + PERL_HANDLER PERL_LOG + PERL_INIT PERL_CLEANUP PERL_RESTART + PERL_STACKED_HANDLERS + PERL_METHOD_HANDLERS + PERL_DIRECTIVE_HANDLERS + PERL_TABLE_API + PERL_LOG_API + PERL_URI_API + PERL_UTIL_API + PERL_FILE_API + PERL_CONNECTION_API + PERL_SERVER_API +}; + +$callback_alias{PERL_INIT} = "PERL_HEADER_PARSER"; +$callback_alias{PERL_CLEANUP} = "PERL_LOG"; +%callback_hooks = map { $_,0 } @callback_hooks; +$callback_hooks{PERL_HANDLER} = 1; #PerlHandler always on +%cant_hook = (); + +my @mm_args; +{ + my($fh,$file); + for (qw(./ ../ ./. ../.), "$ENV{HOME}/.") { + last if $fh = FileHandle->new($file = $_."makepl_args.mod_perl"); + } + if($fh) { + print "Reading Makefile.PL args from $file\n"; + while(<$fh>) { + chomp; + s/^\s+//; s/\s+$//; + next if /^#/ || /^$/; + last if /^__END__/; + if(/^APACI_ARGS/) { + s/^APACI_ARGS=//; + push @APACI_ARGS, $_; + } + else { + unshift @ARGV, split /\s+/, $_; + } + } + close $fh; + } + if(@APACI_ARGS) { + unshift @ARGV, "APACI_ARGS=" . join(",", @APACI_ARGS); + } +} + +my $vcpp = ($Config{cc} =~ /^cl(\.exe)?$/); +my %win32_args; +my %win32_accept = map {$_ => 1} qw(APACHE_SRC INSTALL_DLL DEBUG EAPI); + +while($_ = shift) { + ($k,$v) = split /=/, $_, 2; + if ($vcpp) { + if ($win32_accept{$k}) { + $win32_args{$k} = ($k eq 'DEBUG' or $k eq 'EAPI') ? 1 : $v; + } + else { + push @mm_args, $_; + } + next; + } + unless (/^(PERL|APACHE)/ or is_mp_arg($k)) { + push @mm_args, $_; + } + + if ($k eq 'PREFIX') { + require File::Spec; + $MOD_PERL_PREFIX = + File::Spec->catfile($v, 'lib', 'site_perl', + $Config{'version'}, $Config{'archname'}); + } + + $v = 1 unless defined $v; + if($experimental{$k}) { + $experimental{$k}++; + $PERL_EXTRA_CFLAGS .= " -D${k}=1"; + } + ${$k} = $v, next if defined ${$k}; + $callback_hooks{$k} = $v if exists $callback_hooks{$k}; +} + +my $win32_auto; +if ($vcpp and $win32_args{APACHE_SRC}) { + $EVERYTHING = 1; + my $fixed_apsrc = win32_fix_path($win32_args{APACHE_SRC}); + $APACHE_SRC = -d "$fixed_apsrc/include" ? $fixed_apsrc : + (-d "$fixed_apsrc/src/include" ? $fixed_apsrc . '/src' : + die "Cannot find the Apache include directory under $fixed_apsrc"); + $win32_auto = 1; +} + +my %very_experimental = map {$_,1} +qw(PERL_DEFAULT_OPMASK PERL_SAFE_STARTUP PERL_ORALL_OPMASK + PERL_STARTUP_DONE_CHECK PERL_DSO_UNLOAD); + +if($EXPERIMENTAL) { + for (keys %experimental) { + next if $very_experimental{$_}; #have to *really* ask for this one + next if $experimental{$_}++ > 1; + $PERL_EXTRA_CFLAGS .= " -D$_=1"; + } +} + +if($experimental{PERL_DEFAULT_OPMASK} > 1) { + $experimental{PERL_SAFE_STARTUP} = 2; + $PERL_EXTRA_CFLAGS .= " -DPERL_SAFE_STARTUP=1"; +} + +for (keys %PassEnv) { + $ENV{$_} = $$_ if $$_; +} + +$USE_APACI = 1 if $USE_DSO; +if(0) { +#if($USE_DSO or $USE_APXS and !$DO_HTTPD) { + print "*" x 65, $/; + print <= 5.006) { + $PERL_EXTRA_CFLAGS .= " $Config{ccflags}"; +} + +# apache-1.3.xx won't compile with -D_GNU_SOURCE +$PERL_EXTRA_CFLAGS =~ s/-D_GNU_SOURCE//; + +if ($USE_APACI) { + print "Will configure via APACI"; + if($USE_DSO) { + print " (DSO enabled)"; + } + $NO_HTTPD = 1 if $PREP_HTTPD; + print "\n"; +} + +@ARGV = @mm_args; +$STATIC = 0 if $DYNAMIC; +$Configuration = $CONFIG || "Configuration"; + +for (keys %callback_alias) { + $callback_hooks{$callback_alias{$_}}++ + if $callback_hooks{$_}; +} + +if($EVERYTHING) { + @callback_hooks{qw(PERL_STACKED_HANDLERS PERL_METHOD_HANDLERS)} = (1) x 2; + for(qw(ALL_HOOKS PERL_SSI PERL_SECTIONS PERL_DIRECTIVE_HANDLERS + PERL_LOG_API PERL_URI_API PERL_UTIL_API PERL_TABLE_API PERL_FILE_API)) { + $$_ = 1; + } +} + +if($ALL_HOOKS) { + for (@callback_hooks) { + next if /(Api|Table|Handler)s?$/i; + $callback_hooks{$_}++; + } +} + +if($DYNAMIC) { + $PERL_DIRECTIVE_HANDLERS = $PERL_TABLE_API = $PERL_FILE_API = + $PERL_LOG_API = $PERL_URI_API = $PERL_UTIL_API = 1; +} + +my @xs_modules = qw{ +Apache Apache::Constants +}; + +if($Is_Win32) { + $NO_HTTPD = 1; +} + + +unless ($NO_HTTPD && !$PREP_HTTPD) { +for $src_dir ($APACHE_SRC, <../apache*/src>, + <../stronghold*/src>, , + "../src", "./src") +{ + next unless -d $src_dir; + next if $seen{$src_dir}++; + next unless $vers = httpd_version($src_dir); + unless(exists $vers_map{$vers}) { + print STDERR "Apache version '$vers' unsupported\n"; + next; + } + $mft_map{$src_dir} = $vers_map{$vers}; + #print STDERR "$src_dir -> $vers_map{$vers}\n"; + push @adirs, $src_dir; + $modified{$src_dir} = (stat($src_dir))[9]; + last if $DO_HTTPD; +} + +unless (@adirs) { + print "Enter `q' to stop search\n"; + while(1) { + print "Please tell me where I can find your apache src\n" ; + $src_dir = prompt("", $APACHE_SRC_DEFAULT); + last if $src_dir eq "q"; + if(-d $src_dir) { + push(@adirs, $src_dir); + $mft_map{$src_dir} = $vers_map{httpd_version($src_dir)}; + last; + } + else { + print "Can't stat `$src_dir'\n"; + } + } +} + +} + + if($PERL_EXTRA_CFLAGS) { + $PERL_EXTRA_CFLAGS = join(" ", split(",", $PERL_EXTRA_CFLAGS)); + $PERL_EXTRA_CFLAGS =~ s/\s+/ /g; + } + + if($PERL_DEBUG) { + my $lib = "$Config{archlibexp}/CORE/libperld$Config{lib_ext}"; + if (-e $lib) { + $LIBPERL = "-lperld"; + $libperl = " -- $LIBPERL"; + } + $PERL_EXTRA_CFLAGS .= " -g"; + $PERL_TRACE=1; + $PERL_DESTRUCT_LEVEL=2; + print "DEBUG mode...\n"; + print "...adding `-g' to EXTRA_CFLAGS\n"; + print "...turning on PERL_TRACE\n"; + print "...setting PERL_DESTRUCT_LEVEL=2\n"; + print "...linking against libperld\n" if $libperl; + sleep(1); + } + + $PERL_EXTRA_CFLAGS .= " -DPERL_DESTRUCT_LEVEL=$PERL_DESTRUCT_LEVEL" + if $PERL_DESTRUCT_LEVEL; + +for $adir (sort {$modified{$b} <=> $modified{$a}} @adirs) { + $conf = "$adir/$Configuration"; + $httpd_h = asrc($adir)."/httpd.h"; + + if (-e $httpd_h) { + unless($NO_HTTPD and not $DYNAMIC and not $PREP_HTTPD) { + unless($DO_HTTPD) { + $ans = prompt("Configure mod_perl with $adir ?", "y"); + next unless $ans =~ /^y$/i; + } + $APACHE_SRC = $adir; + $IsBenSSL = -e "$adir/apache_ssl.c"; + last unless(-e $conf || -e "$conf.tmpl"); #building from 'make offsite-tar' + } + #++$NO_HTTPD if $USE_APACI; + my $mmn = magic_number($APACHE_SRC); + if(($mmn < MMN_130) and $USE_APACI) { #1.3.0 + print "Sorry, need 1.3.0+ for USE_APACI\n"; + $USE_APACI = $USE_DSO = 0; + + } + for my $api (qw(LOG URI UTIL FILE TABLE)) { + local $_ = join "_", "PERL", $api, "API"; + if(($mmn < MMN_130) and $$_) { #1.3.0 + $$_ = 0; + $cant_hook{$_} = "(need 1.3.0 or higher)"; + } + } + if($USE_DSO and $PERL_SSI) { + $PERL_SSI=0; + $cant_hook{PERL_SSI} = "(doesn't work w/ USE_DSO=1)"; + } + unless ($DO_HTTPD or $NO_HTTPD) { + $ans = prompt("Shall I build httpd in $adir for you?", "y"); + ++$NO_HTTPD, ++$PREP_HTTPD unless $ans =~ /^y$/i; + } + + if($NO_HTTPD) { + #must generate Makefile.config for 1.3bx + unless (-e "$adir/Makefile.config") { + my $cfgfile = $CONFIG ? $CONFIG : "Configuration"; + print "(cd $adir && ./Configure -file $cfgfile)"; + } + } + + #copy the source files + if(!$NO_HTTPD or $USE_APACI or $PREP_HTTPD) { + mkpath "$adir/modules/perl"; + #ignore make's output here + `(cd $adir/modules/perl && make clean 2> /dev/null)`; + + local(*MANI); + open MANI, "MANIFEST" or die "open MANIFEST $!"; + my $atopdir = dirname($adir); + + unlink "$atopdir/perlxsi.c"; + #only rm and cp files mod_perl ships with + while() { + next unless m,^src/modules/perl/,; chomp; + #print "rm -f $adir/$_\n"; + unlink "$atopdir/$_"; + next if not m,.+\.(xs|c|h)$, and $USE_APACI; + next if $DYNAMIC and /\.xs$/; + #print "cp $_ $atopdir/$_\n" if $USE_APACI; + my $dest = "$atopdir/$_"; + cp $_, $dest; + #$mani_src{$_}++; + } + close MANI; + + cp "src/modules/perl/mod_perl_version.h", + "$atopdir/src/modules/perl/mod_perl_version.h"; + + if($USE_APACI) { + open MANI, "MANIFEST" or die "open MANIFEST $!"; + while() { + next unless m,^apaci/,; chomp; + s/\.PL$//; + (my $to = $_) =~ s,^apaci/,src/modules/perl/,; + unlink "$atopdir/$to"; + print "cp $_ $atopdir/$to\n"; + my $dest = "$atopdir/$to"; + cp $_, $dest; + chmod 0755, $dest if -x $_; + } + close MANI; + } + } + + ($APACHE_ROOT = $APACHE_SRC) =~ s,/src/?$,,; + + last if $NO_HTTPD; # or $USE_APACI; + + unless(-e "src/Configuration" and (-M "src/Configuration" < -M $conf) and not $USE_APACI) { + unless(-e $conf) { + cp "$conf.tmpl", $conf; + } + cp $conf, "src/Configuration"; + $conf = "src/Configuration"; + + conf_fixup("$adir/Makefile.tmpl", $conf); + } + } + + if ($NO_HTTPD) { + + } + elsif($USE_APACI) { + #take care of things later + } + else { + $conf = "src/Configuration"; + my($dash_make, $cfgfile); + $dash_make = " -make $PWD/src/$mft_map{$adir} " + if $can_dash_make{asrc $adir} and $mft_map{$adir}; + #print STDERR "(cd $adir; ./Configure${dash_make} -file $PWD/$conf)\n"; + $cfgfile = $CONFIG ? $CONFIG : "$PWD/$conf"; + $dash_make ||= ""; + system "(cd $adir && ./Configure${dash_make} -file $cfgfile)"; + + open FH, "$APACHE_SRC/Makefile" or + die "can't open $APACHE_SRC/Makefile $!"; + while() { + $SSL_BASE ||= $1 if /^\s*SSL_BASE\s*=\s*(.*)/; + $EXTRA_CFLAGS = $1 if /CFLAGS1\s*=\s*(.*)/; + $SSLINCS = $1 if /SSLINCS\s*=\s*(.*)/; + } + close FH; + + if($SSL_BASE) { + $SSL_INCLUDE = " -I$SSL_BASE/include "; + $SSL_CFLAGS = "-DAPACHE_SSL $SSL_INCLUDE"; + } + + #stronghold + if($SSLINCS) { + $SSL_INCLUDE = " $SSLINCS "; + $SSL_CFLAGS = "-DAPACHE_SSL $SSL_INCLUDE"; + } + } + print "EXTRA_CFLAGS: $EXTRA_CFLAGS\n" if $EXTRA_CFLAGS; + print "SSL_CFLAGS: $SSL_CFLAGS\n" if $SSL_CFLAGS; + last if $APACHE_SRC; +} + +if($PERL_DIRECTIVE_HANDLERS) { + push @xs_modules, "Apache::ModuleConfig"; + $callback_hooks{PERL_DIRECTIVE_HANDLERS} = 1; +} + +#if($PERL_RUN_XS or $experimental{PERL_RUN_XS} > 1) { +if (0) { + my $mmn = $USE_APXS ? MMN_130 : magic_number($APACHE_SRC); + if($mmn >= MMN_130) { + push @xs_modules, "Apache::PerlRunXS"; + } + else { + $PERL_RUN_XS = 0; + $experimental{PERL_RUN_XS} = 0; + print "Sorry, need 1.3.0+ for Apache::PerlRunXS\n"; + } +} +for (qw(Log URI Util Connection Server File Table)) { + my $s = "PERL_".uc($_)."_API"; + if($$s or $Is_Win32) { + push @xs_modules, "Apache::$_"; + $callback_hooks{$s} = 1; + } +} + +my @xs_mod_snames = map { (my $s = $_) =~ s/.*:://; $s } @xs_modules; + +win32_setup() if $Is_Win32; + +if($DYNAMIC) { + print "Will build Apache::* extensions dynamic\n"; + for (@xs_mod_snames) { + cp "src/modules/perl/${_}.xs", "${_}/${_}.xs"; + } +} + +if($APACHE_SRC or $USE_APXS) { + ++$STATIC if grep { $_ eq lc($Config{osname}) } qw(aix svr4 unixware); + + my $mmn = $USE_APXS ? MMN_130 : magic_number($APACHE_SRC); + my $httpdv = $USE_APXS ? 130 : httpd_version($APACHE_SRC,1); + + unless($httpdv >= 130) { + phat_warn("Apache Version 1.3.0 required, aborting..."); + exit(1); + } + + if($httpdv >= 130) { + if($callback_hooks{PERL_CHILD_INIT}) { + $My::child_init++; + } + } + else { + $callback_hooks{PERL_CHILD_INIT} = 0; + $cant_hook{PERL_CHILD_INIT} = + "(need 1.3.0 or higher)"; + } + + if($mmn >= 19970728) { + $callback_hooks{PERL_CHILD_EXIT} = $My::child_exit = + $callback_hooks{PERL_CHILD_INIT} = $My::child_init = 1; + } + else { + $callback_hooks{PERL_CHILD_EXIT} = 0; + $cant_hook{PERL_CHILD_EXIT} = + "(need 1.3.0 or higher)"; + } + + unless($mmn >= 19970825) { + $callback_hooks{PERL_POST_READ_REQUEST} = 0; + $cant_hook{PERL_POST_READ_REQUEST} = + "(need 1.3.0 or higher)"; + } + + setup_for_static() unless $USE_APXS; + + iedit "$APACHE_SRC/modules/perl/Makefile", + "s!^PERL\\s*=.*!PERL=$Config{'perlpath'}!" unless $USE_APACI or $USE_APXS; + + for (@callback_hooks) { + ($k,$v) = ($_,$callback_hooks{$_}); + + unless ($USE_APACI or $USE_APXS) { + iedit "$APACHE_SRC/modules/perl/Makefile", "s/^$k /#$k /" if $v; + } + + $why = ($cant_hook{$k} || "(enable with $k=1)") unless $v; + $k =~ s/([A-Z]+)/ucfirst(lc($1))/ge; + $k =~ s/_//g; + $k .= "Handler" unless $k =~ /(Api|Table|Handler)s?$/; + push @mod_perl_hooks, $k; + print $k . '.' x (28 - length($k)); + print $v ? "enabled\n" : "disabled $why\n"; + } + + unless($httpdv >= 120) { + $PERL_SECTIONS = $PERL_SSI = 0; + $cant_hook{PERL_SECTIONS} = $cant_hook{PERL_SSI} = + "(need 1.2.0 or higher)"; + } + + $PERL_SECTIONS = $PERL_SSI = 0 if $Is_Win32; + unless ($Is_Win32) { + for (qw(PERL_SECTIONS PERL_SSI), keys %experimental) { + $k = $_; + + if($experimental{$_}) { + next unless $experimental{$_} > 1; + print $k . '.' x (28 - length($k)); + print "enabled (experimental)"; + } + else { + $why = ($cant_hook{$_} || "(enable with $k=1)") unless $$_; + $k =~ s/([A-Z]+)/ucfirst(lc($1))/ge; + $k =~ s/_//g; + $k =~ s/Ssi$/SSI/; #*shrug* + push @mod_perl_hooks, $k; + print $k . '.' x (28 - length($k)); + print $$_ ? "enabled" : "disabled $why\n"; + } + + print "\n"; + unless ($USE_APACI or $USE_APXS) { + iedit "$APACHE_SRC/modules/perl/Makefile", "s/^($_) /#\$1 /" + if $$_; + } + } + } + unless ($USE_APACI or $USE_APXS) { + iedit "$APACHE_SRC/modules/perl/Makefile", "s/^#TRACE/TRACE/" if $PERL_TRACE; + } + + my $ssl_name = is_ssl(); + if($ssl_name) { + print "I see you are building with $ssl_name,\nI'll set the SSL flags in mod_perl's Makefile\n"; + + if($ssl_name =~ /stronghold/i) { + my $skey; + my $lfile; + my $conf = "$APACHE_SRC/../conf/httpd.conf"; + if(-e $conf) { + open FH, $conf; + while() { + chomp; + if(/^StrongholdKey/) { + $skey = $_; + last; + } + elsif(s/^StrongholdLicenseFile\s+//) { + $lfile = $_; + unless ($lfile =~ m:^/:) { + $lfile = "$PWD/$APACHE_SRC/../$lfile"; + } + } + } + close FH; + } + + if($skey) { + $StrongholdKey = $skey; + print "Using $skey for 'make test'\n"; + } + elsif(-e $lfile) { + $StrongholdKey = join " ", + "StrongholdLicenseFile", $lfile; + print "Using $StrongholdKey for 'make test'\n"; + } + else { + print "Before running `make test', ", + "you must add your `StrongholdLicenseFile' to t/conf/httpd.conf\n"; + } + } + + unless ($USE_APACI or $USE_APXS) { + iedit "$APACHE_SRC/modules/perl/Makefile", + "s:^#APACHE_SSL.*:APACHE_SSL = $SSL_CFLAGS:"; + } + } + + #my $incdir = ($mmn >= 19970825) ? "../../main" : "../.."; + my $minc = asrc($APACHE_SRC); + $minc =~ /(main|include)/; + my $incdir = $1 ? "../../$1" : "../.."; + my $edit_note = quotemeta(<= 19970912 and not $USE_APACI and not $USE_APXS and not $Is_Win32) { #1.3b1 + system "cat $APACHE_SRC/Makefile.config $APACHE_SRC/modules/perl/Makefile > /tmp/mpmf.$$"; + system "mv /tmp/mpmf.$$ $APACHE_SRC/modules/perl/Makefile"; + } + + if($callback_hooks{PERL_TRANS}) { + push @test_pre_init, + "\t", '$(CP) t/conf/mod_perl_srm.conf t/conf/srm.conf', "\n"; + } + unless ($USE_APXS) { + unless (-l "t/httpd" or $Is_Win32) { + system "$Config{lns} $APACHE_SRC/httpd t/httpd"; + } + write_extra_tests(); + } +} + +unless (-e "t/net/config.pl") { + cp "t/net/config.pl.dist", "t/net/config.pl"; +} + +init_config_pl() if $Is_Win32; + +my (%win32_path); +if ($win32_auto) { + require File::Spec; + win32_inc_and_lib(); + win32_fix_dsp(); +} + +write_my_config($APACHE_SRC); + +unless($Is_Win32 or -e "t/conf/httpd.conf" or ($NO_HTTPD && !$PREP_HTTPD)) { + init_tests_and_config(); +} + +init_tests_and_config() if $USE_APXS; + +sub init_config_pl { + my $mmn = magic_number($APACHE_SRC) || 0; + + my $hf = FileHandle->new(">>t/net/config.pl") or + die "can't open t/net/config.pl $!"; + + my $apaci_cfg = APACI->init; + + my($k,$v); + my(%all) = %callback_hooks; + while (($k,$v) = each %experimental) { + $all{$k} = ($experimental{$k} > 1) ? 1 : 0; + } + print $hf "%callback_hooks = (\n"; + while (($k,$v) = each %all) { + print $hf " $k => $v,\n"; + my $yes_no = $v ? "yes" : "no"; + print $apaci_cfg "$k = $yes_no\n" if $apaci_cfg; + } + print $hf " MMN => $mmn,\n"; + print $hf " USE_DSO => 1,\n" if $USE_DSO; + print $hf ");\n1;\n"; + $hf->close; + $apaci_cfg->close if $apaci_cfg; +} + +sub init_tests_and_config { + local *FH; + open FH, ">t/conf/dev-null"; + print FH "#mod_ssl has a problem with /dev/null\n"; + close FH; + + cp "t/conf/httpd.conf-dist", "t/conf/httpd.conf"; + chmod 0644, "t/conf/httpd.conf"; + + $uid = $>; + $gid = $); + + #use only first value if $) contains more than one + $gid =~ s/^(\d+).*$/$1/; + + $User = $Is_Win32 ? "nobody" : + $ENV{APACHE_USER} || (getpwuid($uid) || "#$uid"); + $Group = $Is_Win32 ? "nogroup" : + $ENV{APACHE_GROUP} || (getgrgid($gid) || "#$gid"); + + if($User eq "root") { + my $other = (getpwnam('nobody'))[0]; + $User = $other if $other; + } + if($User eq "root") { + print "Cannot run tests as User `$User'\n"; + $User = prompt("Which User?", "nobody"); + $Group = prompt("Which Group?", $Group); + } + print STDERR "Will run tests as User: '$User' Group: '$Group'\n"; + + if($Port != $PORT) { + iedit "t/conf/httpd.conf", "s/^(Port) .*/\$1 $PORT/"; + iedit "t/net/config.pl", "s/$Port/$PORT/;"; + } + if($experimental{PERL_SAFE_STARTUP} > 1) { + if($experimental{PERL_DEFAULT_OPMASK} < 2) { + iedit "t/conf/httpd.conf", "s/^#(PerlOpmask)/\$1/"; + } + } + + init_config_pl(); + + if($USE_APACI and not $PREP_HTTPD and not $USE_APXS) { + my $shrpenv = $Config{shrpenv} || ""; + $shrpenv .= ' ' if $shrpenv; + my $cmd = "CC=\"${shrpenv}$Config{cc}\" "; + + if($PERL_EXTRA_CFLAGS) { + $cmd .= qq(CFLAGS="$PERL_EXTRA_CFLAGS" ); + } + + if ($USE_DSO) { + # override apache's notion of this flag + $cmd .= qq(LDFLAGS_SHLIB_EXPORT="$Config{ccdlflags}" ); + + #if Perl is linked with -lpthread, httpd needs tobe too + if ($Config{libs} =~ /($thrlib)/) { + $PERL_EXTRA_LIBS .= " $1"; + } + } + if ($PERL_EXTRA_LIBS) { + $cmd .= qq(LIBS="$PERL_EXTRA_LIBS" ); + } + $cmd .= "sh ./configure " . + "--activate-module=src/modules/perl/libperl.a"; + + # Do not disable the rule EXPAT for Stronghold, since this + # rule is not implementated yet and breaks the configure process. + if(is_ssl() !~ /stronghold/i) { + $cmd .= " --disable-rule=EXPAT"; + } + + if($USE_DSO) { + $cmd .= " --enable-shared=perl"; + } + if($APACI_ARGS) { + $cmd .= " " . join " ", split(',', $APACI_ARGS); + } + if($APACHE_PREFIX and $APACI_ARGS !~ /--prefix=/) { + $cmd .= " --prefix=$APACHE_PREFIX"; + } + if ($APACI_ARGS =~ /--target=(\S+)/) { + $TARGET = $1; + } + if($ADD_MODULE) { + for (split ",", $ADD_MODULE) { + if(/^([a-zA-Z0-9][a-zA-Z0-9_]+)$/) { + $cmd .= " --enable-module=$1"; + } + elsif(m:(src/modules/[^/]+/[^/]+)$:) { + $cmd .= " --activate-module=$1"; + } + } + } + print "(cd $APACHE_ROOT && $cmd)\n"; + system "(cd $APACHE_ROOT && $cmd)"; + } + + if($USE_APXS) { + my $cmd = "./configure --with-perl=$^X"; + $cmd .= " --with-apxs=$WITH_APXS" if $WITH_APXS; + system "(cd apaci && $cmd)"; + } + + #expand ./t to full path + iedit "t/conf/httpd.conf", "s: \./t(\\S*): $PWD/t\$1:"; + + for (qw(User Group)) { + iedit "t/conf/httpd.conf", "s/^$_ .*/$_ $$_/"; + } + conf_append(<= 121 or $mmn >= MMN_130; + conf_append("PerlChildInitHandler My::child_init") if $My::child_init; + conf_append("PerlChildExitHandler My::child_exit") if $My::child_exit; + conf_append("PerlTransHandler My::ProxyTest") + if $callback_hooks{PERL_TRANS} and + $callback_hooks{PERL_STACKED_HANDLERS} and + $mmn > 19980270 and $Is_dougm; + + conf_append(< +SetHandler perl-script +PerlHandler Stacked::one Stacked::two Stacked::three Stacked::four + +EOF +} + +{ + (my $pmv = $VERSION) =~ s/_//g; + $pmv =~ s/-dev$//; + my $hooks = "@mod_perl_hooks"; + my $dummy = "hooks=`$hooks'\n" unless $hooks; + cp "lib/mod_perl_hooks.pm.PL", "lib/mod_perl_hooks.pm"; + + if ($Is_Win32) { + my @args = ($^X, '-spi.bak', '-e', "\"s/sub mod_perl::hooks.*/sub mod_perl::hooks { qw($hooks) }/\"", 'lib/mod_perl_hooks.pm'); + system(@args) == 0 or die "@args failed\n"; + } + iedit "lib/mod_perl_hooks.pm", + qq(s/sub mod_perl::hooks.*/sub mod_perl::hooks { qw($hooks) }/); + + require "lib/mod_perl_hooks.pm"; + my @list = mod_perl::hooks(); + if ($Is_Cygwin) { + } + else { + @list == @mod_perl_hooks or die "Edit of lib/mod_perl_hooks.pm failed $!\n"; + } + + unlink $Is_Win32 ? "lib/mod_perl_hooks.pm.bak" : "lib/mod_perl_hooks.pm~"; +} + +#checking for LWP code, borrowed from LWP's own Makefile.PL :-) +unless ($Is_Win32) { + print "Checking CGI.pm VERSION.........."; + eval { + require CGI; + }; + if($CGI::VERSION >= 2.39) { + print "ok\n"; + } + else { + print "I suggest upgrading from $CGI::VERSION to 2.39+\n"; + sleep 2; + } + print "Checking for LWP::UserAgent......"; + eval { + require LWP::UserAgent; + }; + if ($@) { + $no_lwp++; + $missing_modules++; + print "failed\n"; + print <t/docs/blib.pl"; + print FH "use lib qw(\n", + (map { "$PWD/$_\n" } qw(blib/lib blib/arch)), + ");\n1;\n"; + close FH; + + for my $f (qw(.htaccess hooks.txt)) { + open FH, ">t/docs/$f"; + print FH " "; + close FH; + chmod 0666, "t/docs/$f";#make sure httpd can write to it + } + + if($PERL_SSI) { + cp "t/modules/ssi.test", "t/modules/ssi.t"; + } else { + unlink "t/modules/ssi.t"; # might be there from prior run + } + + mkdir "t/docs/subr", 0755; + if ($Is_Win32) { + open FH, ">t/docs/subr/index.html" + or die "Cannot open t/docs/subr/index.html: $!"; + print FH scalar(localtime); + close FH; + } + else { + system "date > t/docs/subr/index.html"; + } + + return unless + $callback_hooks{PERL_STACKED_HANDLERS} + and $callback_hooks{PERL_FIXUP}; + local *FH; + my $meth_test; + if($callback_hooks{PERL_METHOD_HANDLERS}) { + $meth_test = <<'EOF'; +#see startup.pl +PerlFixupHandler MyClass->method +PerlFixupHandler $MyClass::Object->method +PerlFixupHandler MyClass +PerlFixupHandler LoadClass +PerlFixupHandler LoadClass->method +EOF + } + my $dir = "t/docs/stacked"; + mkdir $dir, 0755; + cp "t/docs/test.html", $dir; + open FH, ">$dir/.htaccess"; + print FH < \@DIR, + NAME => "mod_perl", + VERSION => $VERSION, + ($] < 5.005 ? () : + ( + ABSTRACT => 'Embed a Perl interpreter in the Apache HTTP server', + AUTHOR => 'Doug MacEachern ', + )), + #should override `CCFLAGS', can't with older perls + #CCDLFLAGS => "$Config{ccdlflags} $EXTRA_CFLAGS", + DEFINE => $EXTRA_CFLAGS, + macro => { + PERL => $Config{'perlpath'}, + OPCODE_FILE => "src/opcodes.txt", + APACHE_ROOT => $APACHE_ROOT, + APACHE_SRC => $APACHE_SRC, + ARCHNAME => $Config{archname}, + HTTPD => $TARGET, + PORT => $PORT, + PWD => $PWD, + PERL5LIB => "PERL5LIB=$ENV{PERL5LIB}", + SHRPENV => $Config{shrpenv}, + CVSROOT => 'cvs.apache.org:/home/cvs', + }, + 'dist' => { + COMPRESS=> 'gzip -9f', SUFFIX=>'gz', + CI => qq(ci -u -m\\"See Changes file\\"), + }, + clean => { + FILES => "@do_clean", + } +); + +if ($Is_Win32) { + print <<'END'; + +Beginning with version 1.3.15, Apache uses a different convention for +Win32 module names. Correspondingly, the name of the mod_perl module +built here has been changed from ApacheModulePerl.dll to mod_perl.so. +Please see INSTALL.win32 for further details. + +END +} + +print "*** BSDI users: be sure to read the INSTALL `Notes' section ***\n" + if $Config{osname} =~ /bsdos/i; + +cleanup_for_static(); + +sub MY::dist_basics { + my $self = shift; + my $string = $self->MM::dist_basics; + if($USE_APXS) { + $string =~ s/(distclean\s+::\s+)/$1 apxs_distclean /; + } + return $string; +} + +sub MY::clean { + my $self = shift; + my $string = $self->MM::clean(@_); + if ($win32_auto) { + $string .= sprintf + qq{\tmsdev src\\modules\\win32\\mod_perl.dsp \\\n} . + qq{\t/MAKE "mod_perl - Win32 %s" /CLEAN\n}, + ($win32_args{DEBUG} == 1) ? 'Debug' : 'Release'; + return $string; + } + unless($NO_HTTPD) { + my $asrc = asrc($APACHE_SRC, "http_main.c"); + return $string unless $APACHE_SRC and -e "$asrc/http_main.c"; + $string .= "\t-cd \$(APACHE_SRC) && \$(MAKE) clean\n"; + } + if($USE_APXS) { + $string .= "\t-cd ./apaci && \$(MAKE) clean\n"; + } + $string; +} + +sub MY::install { + my $self = shift; + my $string = $self->MM::install; + my $add = ""; + if($USE_APXS) { + $add = "apxs_install"; + } + elsif ($win32_auto and $win32_args{INSTALL_DLL}) { + $add = 'amp_install'; + } + elsif($USE_APACI) { + if($APACI_ARGS =~ /--prefix=/ or $APACHE_PREFIX) { + $add = "apaci_install"; + } + } + if($add and (!$NO_HTTPD and !$PREP_HTTPD) or $USE_APXS or $win32_auto) { + $string =~ s/(pure_install\s+)(.*)/$1 $add $2/; + } + return $string; +} + +sub MY::top_targets { + my $self = shift; + my $string = $self->MM::top_targets; + return $string unless $USE_APXS or $USE_APACI or $APACHE_SRC or $win32_auto; + + if ($win32_auto) { + $string =~ s/(pure_all\s+::.*\s+subdirs\s+)(.*)/$1 amp_dll $2/; + $string .= sprintf qq{\namp_dll:\n} . + qq{\tmsdev src\\modules\\win32\\mod_perl.dsp \\\n} . + qq{\t/MAKE "mod_perl - Win32 %s" /USEENV\n}, + ($win32_args{DEBUG} == 1) ? 'Debug' : 'Release'; + if ($win32_args{INSTALL_DLL}) { + $string .= sprintf qq{\namp_install:\n\t\$(CP) "%s" "%s"}, + "$win32_path{MODPERL_LIB}/mod_perl.so", + $win32_args{INSTALL_DLL} . + ($win32_args{APACHE_VERS} < 1315 ? + '/ApacheModulePerl.dll' : '/mod_perl.so'); + } + return $string; + } + + if($USE_APXS) { + $string =~ s/(pure_all\s+::\s+)(.*)/$1 apxs_libperl $2/; + } + elsif($USE_APACI and !$PREP_HTTPD) { + $string =~ s/(pure_all\s+::\s+)(.*)/$1 apaci_httpd $2/; + } + elsif($APACHE_SRC) { + return $string unless -f "$APACHE_SRC/$Configuration"; + my $asrc = asrc($APACHE_SRC, "http_main.c"); + if(-e "$asrc/http_main.c" and !$NO_HTTPD) { + $string =~ s/(pure_all\s+::\s+)(.*)/$1 apache_httpd $2/; + } + } + + $string .= <<'EOF'; + +gen_exports: + $(PERL) -I./lib -MExtUtils::testlib -MApache::Constants::Exports \ + -e 'Apache::Constants::Exports->gen_ctags' > Exports.c + +gen_op_mask: + $(PERL) -MExtUtils::testlib -MApache::Opcode \ + -e 'Apache::Opcode->gen_op_mask' -- $(OPCODE_FILE) > op_mask.c + +update_op_mask: gen_op_mask + @$(RM_F) $(APACHE_SRC)/modules/perl/mod_perl_opmask.o + $(CP) op_mask.c $(APACHE_SRC)/modules/perl/op_mask.c + +apxs_distclean: + (cd ./apaci && $(MAKE) distclean) + +apxs_libperl: + (cd ./apaci && $(PERL5LIB) $(MAKE)) + +apxs_install: apxs_libperl + (cd ./apaci && $(MAKE) install;) + +apache_httpd: $(APACHE_SRC)/Makefile.tmpl + (cd $(APACHE_SRC) && $(PERL5LIB) $(SHRPENV) $(MAKE) CC="$(CC)";) + +apaci_httpd: + (cd $(APACHE_ROOT) && $(PERL5LIB) $(MAKE)) + +apaci_install: + (cd $(APACHE_ROOT) && $(MAKE) install) + +tar_Apache: + (cd $(INSTALLSITELIB)/$(ARCHNAME); \ + $(TAR) -cf $(PWD)/Apache.tar mod_perl.pm Apache.pm Apache auto/Apache; ) + +offsite-tar: + $(CP) MANIFEST MANIFEST.orig + echo src/Makefile.config >> MANIFEST + $(CP) $(APACHE_SRC)/Makefile.config src/Makefile.config + mkdir "src/include" + $(PERL) -e 'for (<$(APACHE_SRC)/include/*.h>) {' \ + -e 'system "$(CP) $$_ src/include/";' \ + -e 's,^$(APACHE_SRC),,;' \ + -e 'system "echo src$$_ >> MANIFEST";' \ + -e '}' + $(MAKE) dist + $(RM_RF) src/include/ + $(RM) src/Makefile.config + $(MV) MANIFEST.orig MANIFEST + +EOF + + $string; +} + +sub MY::pasthru { + return unless $APACHE_SRC; + my $self = shift; + chomp(my $str = $self->MM::pasthru); + join $/, "$str\\", + "\t".'APACHE_SRC="$(APACHE_SRC)"\\', + "\t".'DEFINE="$(DEFINE)"', + ""; +} + +sub MY::test { + my $self = shift; + my $test = $self->MM::test; + my $mmn = magic_number($APACHE_SRC); + return <<'EOF' if $USE_APXS and not $Is_dougm; +test: + @echo "Can't make test with APXS (yet)" +EOF + return <<'EOF' if $USE_DSO and ($mmn <= 19980527) and not $Is_dougm; +test: + @echo "Can't make test with DSO (yet)" +EOF + + my $script = "t/TEST"; + $script .= ".win32" if $Is_Win32; + my $my_test = $Is_Win32 ? q( + +test: run_tests + +) : + +q( + +test: pure_all start_httpd run_tests kill_httpd + +); + my $have_so = $USE_DSO || ($APACI_ARGS =~ /--enable-shared=/); + push @test_pre_init, "\t", + './apaci/load_modules.pl $(APACHE_SRC)', "\n" if $have_so; + + join '', @test_pre_init, + qq( +MP_TEST_SCRIPT=$script +), + q( +TEST_VERBOSE=0 + +kill_httpd: + kill `cat t/logs/httpd.pid` + @$(RM_F) t/conf/srm.conf + @$(RM_F) t/logs/mod_perl.lock* + $(RM_F) t/logs/httpd.pid + $(RM_F) t/logs/error_log + +start_httpd: test_pre_init + @(cd t/conf; test -f httpd.conf || cp httpd.conf-dist httpd.conf) + @(cd t/net; test -f config.pl || cp config.pl.dist config.pl) + @$(TOUCH) t/conf/srm.conf + $(APACHE_SRC)/$(HTTPD) -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t & + @echo httpd listening on port $(PORT) + @echo will write error_log to: t/logs/error_log + @echo "letting apache warm up...\c" + @sleep 2 + @echo done + +start_httpd_fork: + $(APACHE_SRC)/$(HTTPD) -f `pwd`/t/conf/httpd.conf -d `pwd`/t + +rehttpd: kill_httpd start_httpd + +run_tests: + $(FULLPERL) $(MP_TEST_SCRIPT) $(TEST_VERBOSE) + +), + +$my_test, + +q( + +test_report: + $(MAKE) test | t/report +); +} + +use File::Find; + +sub MY::subdirs { + my $self = shift; + if($ENV{TEST_PERL_DIRECTIVES}) { + push @{$self->{DIR}}, "t/TestDirectives"; + } + $self->MM::subdirs(@_); +} + +sub wanted { + return unless /\.h$/ or /os-inline\.c$/; + (my $d = $File::Find::dir) =~ s:^\Q$APACHE_SRC::; + $d =~ s:^/::; + + my $from = "$File::Find::dir/$_"; + my $to = '$(INST_ARCHLIB)/' . "auto/Apache/include/"; + $to .= "$d/" if $d; + $to .= $_; + + $My::self->{PM}->{$from} = $to; +} + +sub win32_mph { + return unless /\.h$/ or /os-inline\.c$/; + (my $d = $File::Find::dir) =~ s:^\Q$MODPERL_SRC::; + $d =~ s:^/::; + my $from = "$File::Find::dir/$_"; + my $to = '$(INST_ARCHLIB)/' . "auto/Apache/include/modules/perl/"; + $to .= "$d/" if $d; + $to .= $_; + + $My::self->{PM}->{$from} = $to; +} + +sub MY::post_initialize { + my($self) = shift; + + return unless $APACHE_HEADER_INSTALL; + my($ap_src, $ap_inc); + if ($APACHE_SRC) { + $ap_src = $APACHE_SRC; + $ap_inc = "$ap_src/include"; + } + elsif ($USE_APXS) { + #$base = `$WITH_APXS -q INCLUDEDIR`; + $ap_inc = $ap_src = 'src'; #just install mod_perl headers + } + + return unless $ap_src and -d $ap_src; + + $My::self = $self; + { + local $APACHE_SRC = $ap_src; + finddepth(\&wanted, $ap_src); + } + if ($Is_Win32) { + local $MODPERL_SRC = win32_fix_path($PWD) . '/src/modules/perl'; + finddepth(\&win32_mph, $MODPERL_SRC); + } + $self->{PM}{"Apache/typemap"} = '$(INST_ARCHLIB)/' . "auto/Apache/typemap"; + $self->{PM}{"apaci/mod_perl.exp"} = '$(INST_ARCHLIB)/' . "auto/Apache/mod_perl.exp"; + for (qw(ap_config_auto.h)) { + my $from = "$ap_inc/$_"; + my $to = '$(INST_ARCHLIB)/' . "auto/Apache/include/$_"; + unless ($self->{PM}->{$from}) { + $self->{PM}->{$from} = $to; + system "$Config{touch} $from"; + } + } + + ''; +} + +sub MY::postamble { + + return <<'EOF'; +cvs_export : + cvs -d $(CVSROOT) export -rv$(VERSION_SYM) -d$(DISTVNAME) . + +cvs_tag : + cvs -d $(CVSROOT) tag v$(VERSION_SYM) modperl + @echo update mod_perl.pm VERSION now + +EOF +} + +#' + +sub MY::manifypods { + my $self = shift; + my $ver = $self->{VERSION} || ""; + local($_) = $self->MM::manifypods(@_); + s/pod2man\s*$/pod2man --release mod_perl-$ver/m; + $_; +} + +sub fold_dots { + my $v = shift; + $v =~ s/\.//g; + $v .= "0" if length $v < 3; + $v; +} + +sub vcache { + my($v,$dir) = @_; + $vcache{$dir} = fold_dots($v); +} + +sub httpd_version { + my($dir, $vnumber) = @_; + local $^W=0; + $dir = asrc($dir) || ""; + if($vnumber) { + return $vcache{$dir} if $vcache{$dir}; + } + my $fh = FileHandle->new("$dir/httpd.h") or return; + my($server, $version, $rest); + my($fserver, $fversion, $frest); + my($string, $extra, @vers); + while(<$fh>) { + next unless /^#define/; + s/SERVER_PRODUCT \"/\"Apache/; #1.3.13 + next unless s/^#define\s+SERVER_(BASE|)(VERSION|REVISION)\s+"(.*)\s*".*/$3/; + unless (m:/:) { + $_ = "Apache/$_"; #1.3.14, argh + } + chomp($string = $_); + + #print STDERR "Examining SERVER_VERSION '$string'..."; + #could be something like: + #Stronghold-1.4b1-dev Ben-SSL/1.3 Apache/1.1.1 + @vers = split /\s+/, $string; + foreach (@vers) { + next unless ($fserver,$fversion,$frest) = + m,^([^/]+)/(\d\.\d+\.?\d*)([^ ]*),i; + #print STDERR "match ($fserver,$fversion,$frest)\n"; + if($fserver =~ /Xcert-Sentry/i or $fserver eq "Ben-SSL") { + $extra ||= $fserver; + #print STDERR "I see $fserver/$fversion, ok\n"; + next; + } + + if($fserver eq "Apache") { + ($server, $version) = ($fserver, $fversion); + if($version eq '1.2' and $frest =~ s/^b(\d+).*/$1/) { + if($frest >= 8 and is_ssl($dir)) { + $do_link_swap++; + $can_dash_make{$dir}++; + + return $vnumber ? vcache($version,$dir) : "NONE"; + } + warn "Apache/1.2b$frest is not supported, upgrade to 1.2.0.\n"; + return undef; + } + elsif($version >= 1.2) { + $do_link_swap++ if is_ssl($dir); + $can_dash_make{$dir}++; + return $vnumber ? vcache($version,$dir) : "NONE"; + } + } + else { + #print STDERR "'$fserver/$fversion' unrecognized.\n"; + next; + } + print STDERR "Found $fserver '$fversion' in $dir/httpd.h\n"; + } + } + $fh->close; + #print STDERR "return $version$extra\n"; + return($version.$extra); +} + +use lib "./lib"; +use Apache::src (); + +sub magic_number { + my $d = asrc shift; + my $src = Apache::src->new; + $src->dir($d); + return($mcache{$d} = $src->module_magic_number); +} + +sub cleanup_for_static { + return unless $STATIC; + for (@xs_mod_snames) { + rename "${_}/${_}.xs.disabled", "${_}/${_}.xs"; + } +} + +sub setup_for_static { + my $d = "$APACHE_SRC/modules/perl"; + my $mf = "$APACHE_SRC/modules/perl/Makefile"; + my @static_src = (); + + unless ($USE_APACI) { + iedit $mf, "s/(PERL_STATIC_EXTS) =.*/\$1 = $PERL_STATIC_EXTS/" + if $PERL_STATIC_EXTS; + } + return unless $STATIC; + + cp "Apache/typemap", $d; + + for (@xs_mod_snames) { + rename "${_}/${_}.xs", "${_}/${_}.xs.disabled" if -e "${_}/${_}.xs"; + push @static_src, "$_.c"; + } + +=pod + my @xs_names = (); + my @xs_files = (); + my $dir = "src/modules/perl"; + my $dh = DirHandle->new($dir) or die; + + for my $file ($dh->read) { + next unless $file =~ /\.xs$/; + push @xs_names, module_name_from_xs("$dir/$file"); + push @xs_files, $file; + unless ($mani_src{"$dir/$file"}) { + cp "$dir/$file", $d; + print "Adding module `$xs_names[-1]' to httpd\n"; + } + } + #print "XS_NAMES=@xs_names\n"; + #print "XS_FILES=@xs_files\n"; + + #XXX think about this some more + iedit $mf, "s/^#STATIC_SRC.*/STATIC_SRC = @xs_files/"; + iedit $mf, "s/^#STATIC_EXTS.*/STATIC_EXTS = @xs_names/"; + +=cut + + unless ($USE_APACI) { + #XXX: ho,hum, need to generate the whole damn thing + #instead of all these frigging iedits. + if ($DYNAMIC) { + } + else { + iedit $mf, "s/^#STATIC_SRC.*/STATIC_SRC = @static_src/"; + iedit $mf, "s/^#STATIC_EXTS.*/STATIC_EXTS = @xs_modules/"; + iedit $mf, "s/^#STATIC_/STATIC_/"; + } + #bloody hell, make sucks and so does this. + #this has only cause a few people pain, enough. + iedit $mf, "s/ \Q\$(STATIC_SRC)\E/ @static_src/"; + } +} + +sub module_name_from_xs { + my $file = shift; + my $fh = FileHandle->new($file) or + die "can't open file $file $!"; + my($module, $package, $prefix, %seen); + while(<$fh>) { + if( ($module, $package, $prefix) = + /^MODULE\s*=\s*([\w:]+)(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/) + { + $seen{$module}++; + } + } + if(keys %seen > 1) { + warn "$module name guess might be incorrect"; + } + return (keys %seen)[0]; +} + +sub asrc { + my $d = shift; + my $file = shift || "httpd.h"; + return $d if -e "$d/$file"; + return "$d/include" if -e "$d/include/$file"; + return "$d/main" if -e "$d/main/$file"; + return undef; +} + +sub conf_append { + local *CFG; + open CFG, ">>t/conf/httpd.conf" or die "open httpd.conf $!"; + print CFG join "\n", @_, ""; + close CFG; +} + +sub edit_extra_cflags { + my($cfg) = @_; + my $fh = IO::File->new($cfg) or die "open $cfg $!"; + my $repl = ""; + my @file = (); + my $ccopts = ccopts(); + my $dssv = "-DSERVER_SUBVERSION"; + my $ssv = qq($dssv=\\"mod_perl/$VERSION\\" ); + + my $inc = " $ccopts -I. -I../.. -DUSE_PERL_SSI" if $PERL_SSI; + $inc .= " -DAPACHE_SSL" if is_ssl() and $PERL_SSI; + $inc .= $SSL_INCLUDE if $SSL_INCLUDE; + $inc .= " -DSTRONGHOLD" if is_ssl() =~ /stronghold/i; + $inc .= " $PERL_EXTRA_CFLAGS" if $PERL_EXTRA_CFLAGS; + $inc .= " -DMOD_PERL"; + + while (<$fh>) { + push @file, $_; + next unless /EXTRA_CFLAGS\s*=/; + next if /mod_perl/; + next if /^#/; + chomp; + + $repl = $_; + + my $backwhack = ""; + if($repl =~ s/(\\)\s*$//) { + $backwhack = $1; + } + my $mmn = magic_number($APACHE_SRC); + if($mmn >= 19980507) { + $ADD_VERSION = 0; + } + if($ADD_VERSION) { + if(/$dssv=/) { + $repl =~ + s{ + $dssv\s*=\s*(.?)['"](.*?)(.?)["'] + }[ + qq($dssv="$1"$2 mod_perl/$VERSION$3"") + ]ex; + } + else { + $repl .= " $ssv"; + } + } + + $file[-1] = "$repl $inc $backwhack\n"; + + } + close $fh; + + if($repl) { + $fh = IO::File->new(">$cfg") or die "open $cfg $!"; + print $fh @file; + close $fh; + } +} + +sub conf_fixup { + my($mf, $cfg) = @_; + return if $USE_APACI; + + my $mmn = magic_number($APACHE_SRC); + #source re-org + my $sro = 1 if $mmn >= 19970825; + + edit_extra_cflags($cfg); + $PERL_STATIC_EXTS ||= ""; + $libperl ||= ""; + my $ldopts = "`$^X $PWD/src/modules/perl/ldopts $PERL_STATIC_EXTS $libperl`"; + iedit $cfg, + q{next unless /EXTRA_LIBS\s*=/;}. + q{next if /perl/; chomp;}. + qq{\$_ .= q| $ldopts\n|;}; + + for (split ",", $ADD_MODULE) { + add_module($cfg,$_); + } + + if(is_ssl() =~ /stronghold/i) { + if($do_link_swap) { + warn "swapping link order in $mf for Stronghold\n"; + my $repl = quotemeta('$(REGLIB) $(LIBS)'); + iedit $mf, "s:\Q\$(LIBS) \$(REGLIB)\E:$repl:;"; + + #XXX hack + $repl = quotemeta('CFLAGS=$(CFLAGS)'); + iedit $mf, qq(s:\Q\"CFLAGS=\$(CFLAGS)"\E:'$repl':;); #" + } + my $repl = q{AUX_CFLAGS='\$(CFLAGS)'}; + iedit $mf, qq{s/AUX_CFLAGS="..CFLAGS."/$repl/}; + } + { + my $repl = q{CC='\$(CC)'}; + iedit $mf, qq{s/CC=..CC. /$repl /}; + } + open(CONF, $cfg) || die "Can't open $cfg: $!"; + while () { + $seen_modperl++ if + /^Module\s+perl_module/i || + /^AddModule\s+.*libperl/; + } + close(CONF); + unless ($seen_modperl) { + print "Appending mod_perl to $conf\n"; + open(CONF, ">>$cfg") || die "Can't open $cfg: $!"; + my $line; + $line = $sro ? "AddModule modules/perl/libperl.a" : + "Module perl_module modules/perl/libperl.a"; + print CONF <) { + if(/^\\w{0,3}Module\\s+.*$name\.[oa]/i) { + close IN; +# print STDERR "has module $name\n"; + return 1; + } + } + return 0; +} + +sub add_module { + my($cfg, $name) = @_; + iedit $cfg, "s/^#\\s+(\\w{0,3}Module\\s+.*$name\.[oa])/\$1/"; +} + +sub gen_script { + my $file = shift; + my(@lib) = @_; + local(*IN,*OUT); + open IN, "$file.PL" or die "Couldn't open $file.PL: $!"; + open OUT, ">$file" or die "Couldn't open $file: $!"; + print OUT "#!$Config{perlpath}\n"; + if (@lib) { + print OUT "use lib qw(@lib);\n"; + } + print OUT join '', ; + close OUT; + close IN; + chmod 0755, "$file"; +} + +sub iedit { + my $file = shift; + return if $Is_Win32; + + #print STDERR "-e @_\n"; + if ($Is_Cygwin) { + system $^X, "-e", "@_", $file; + } else { + system $^X, "-pi~", "-e", "@_", $file; + } +} + +sub win32_setup { + my $d = "src/modules/perl"; + dirent_kludge($d); + cp "Apache/typemap", $d; + chdir $d; + system "$^X -MExtUtils::Embed -e xsinit -- -std @xs_modules $PERL_STATIC_EXTS"; + my $lib = $Config{privlibexp}; + for (@xs_mod_snames) { + system "$^X $lib/ExtUtils/xsubpp -typemap $lib/ExtUtils/typemap $_.xs > $_.c"; + + } + chdir "../../../"; + + open(F, '>t/docs/init.pl') + or die "Cannot open t/docs/init.pl: $!"; + print F <<"END"; +#!perl +\$Apache::Server::CWD = '$PWD'; + +END + close F; +} + +sub dirent_kludge { + my $d = shift; + local *FH; + open FH, ">$d/dirent.h" or die "can't write $d/dirent.h $!"; + print FH <$d/mod_perl_version.h" or die "can't write $d/mod_perl_version.h $!"; + print FH < } . + ($my_config{$_} =~ /^\d+$/ ? $my_config{$_} : qq{'$my_config{$_}'}) + } sort keys %my_config; + + local *FH; + open FH, '>lib/Apache/MyConfig.pm' || + die "Can't open lib/Apache/MyConfig.pm: $!"; + print FH < module provides access to the various hooks +and features set when mod_perl is built. This circumvents the +need to set up a live server just to find out if a certain callback +hook is available. + +Itterate through \%Apache::MyConfig::Setup to get obtain build +information then see Appendix B of the Eagle book for more detail +on each key. + +EOT + close FH; + +} + +# obtain the Apache and mod_perl lib and include directories for Win32 +sub win32_inc_and_lib { + + my $modperl_src = win32_fix_path(cwd) . '/src'; + $win32_path{MODPERL_INC} = $modperl_src . '/modules/perl'; + $win32_path{MODPERL_LIB} = ($win32_args{DEBUG} == 1) ? + $modperl_src . '/modules/win32/Debug' : + $modperl_src . '/modules/win32/Release'; + + unless ( -d $win32_args{APACHE_SRC}) { + opendir(DIR, '../') or die "Cannot read parent directory: $!\n"; + my @dirs = map {"../$_"} + grep {/apache/ and -d "../$_"} readdir DIR; + closedir DIR or die "Cannot close parent directory: $!\n"; + die "Cannot find the apache sources\n" + unless ($win32_args{APACHE_SRC} = find_dir(\@dirs, 'apache source')); + } + $win32_args{APACHE_SRC} = win32_fix_path($win32_args{APACHE_SRC}); + if (-d "$win32_args{APACHE_SRC}/libexec") { + $win32_path{APACHE_LIB} = $win32_args{APACHE_SRC} . '/libexec'; + $win32_path{APACHE_INC} = $win32_args{APACHE_SRC} . '/include'; + $win32_args{APACHE_VERS} = httpd_version($win32_path{APACHE_INC}, 1); + } + else { + $win32_args{APACHE_SRC} .= '/src' unless $win32_args{APACHE_SRC} =~ /src$/; + $win32_path{APACHE_INC} = $win32_args{APACHE_SRC} . '/include'; + $win32_args{APACHE_VERS} = httpd_version($win32_path{APACHE_INC}, 1); + $win32_path{APACHE_LIB} = ($win32_args{DEBUG} == 1) ? + $win32_args{APACHE_SRC} . + ($win32_args{APACHE_VERS} < 1315 ? '/CoreD' : '/Debug') : + $win32_args{APACHE_SRC} . + ($win32_args{APACHE_VERS} < 1315 ? '/CoreR' : '/Release'); + } + die "Cannot find ApacheCore.lib under $win32_path{APACHE_LIB}\n" + unless -f "$win32_path{APACHE_LIB}/ApacheCore.lib"; + die "Cannot find httpd.h under $win32_path{APACHE_INC}\n" + unless -f "$win32_path{APACHE_INC}/httpd.h"; + + if ($win32_args{INSTALL_DLL} ) { + $win32_args{INSTALL_DLL} = + win32_fix_path($win32_args{INSTALL_DLL}); + unless ( -d $win32_args{INSTALL_DLL}) { + my @dirs = grep {-d} + ('\Program Files\Apache Group\Apache\modules', + '\Apache\modules', '\Program Files\Apache\modules'); + $win32_args{INSTALL_DLL} = find_dir(\@dirs, 'Apache/modules'); + if ($win32_args{INSTALL_DLL} and -d $win32_args{INSTALL_DLL}) { + $win32_args{INSTALL_DLL} = + win32_fix_path($win32_args{INSTALL_DLL}); + } + else { + print <<'END'; + +**** The Apache/modules directory was not found. ******* +**** Please install mod_perl.so manually. ******* + +END + } + } + } +} + +# fix mod_perl.dsp with the perl and apache inc and lib directories +sub win32_fix_dsp { + + my $amp = 'src/modules/win32'; + my $dsp = 'mod_perl.dsp'; + unless ( -f "$amp/$dsp.orig") { + rename("$amp/$dsp", "$amp/$dsp.orig") + or die "Couldn't rename $amp/$dsp: $!\n"; + } + my $perl_inc = win32_fix_path_dsp("$Config{archlibexp}/CORE"); + + open(OLDDSP, "$amp/$dsp.orig") + or die "Couldn't read $amp/$dsp.orig: $!\n"; + open(NEWDSP, ">$amp/$dsp") + or die "Couldn't create $amp/$dsp: $!\n"; + while () { + if (/^SOURCE=.*ApacheCore\.lib/) { + printf NEWDSP "SOURCE=%s\n", + win32_fix_path_dsp("$win32_path{APACHE_LIB}/ApacheCore.lib"); + } + elsif (/^SOURCE=.*perl(56)?\.lib/) { + print NEWDSP qq{SOURCE=$perl_inc\\$Config{libperl}\n}; + } + elsif (/ADD CPP/) { + my $apache_inc = win32_fix_path_dsp($win32_path{APACHE_INC}); + s!(/D "WIN32")!/I "$apache_inc" /I "$apache_inc/../os/win32" /I "$perl_inc" $1!; + s!(/D "WIN32")!$1 /D "EAPI" ! if $win32_args{EAPI}; + print NEWDSP $_; + } + else { + print NEWDSP $_; + } + } + close OLDDSP; + close NEWDSP; + return; +} + +# find a directory of type $type, given some possible $dirs +sub find_dir { + my ($dirs, $type) = @_; + my $j = 0; + my $src; + while (1) { + $src = @$dirs > 0 ? $dirs->[$j] : ''; + $src = prompt("\nWhere is your $type directory? (q to quit)", $src); + return undef if $src eq 'q'; + return $src if -d $src; + print qq{'$src': no such directory\n}; + $j = ($j == @$dirs-1) ? 0 : $j + 1; + } +} + +# fix a path for Win32 Makefile +sub win32_fix_path { + local $_ = shift; + $_ = File::Spec->rel2abs($_) if not File::Spec->file_name_is_absolute($_); + tr!\\!/!; + s!/$!!; + return $_; +} + +# fix a path for mod_perl.dsp +sub win32_fix_path_dsp { + local $_ = shift; + tr!/!\\!; + s!^\w:!!; + return $_; +} + +#in version 1.2505 of Embed.pm we could just import these instead of using ``, +#but it might require lots of people to upgrade + +sub ccopts { + unless ($Embed::ccopts) { + $Embed::ccopts = "$Config{ccflags} -I$Config{archlibexp}/CORE"; + if($USE_THREADS) { + $Embed::ccopts .= " -DPERL_THREADS"; + } + } + $Embed::ccopts; +} + +sub ldopts { + $Embed::ldopts ||= `$^X -MExtUtils::Embed -e ldopts`; + if($^O eq "aix") { + $Embed::ldopts =~ s,(-bE:)(perl\.exp),$1$Config{archlibexp}/$2,; + } + $Embed::ldopts; +} + +sub perl_version { + my $v = "$]"; + $v =~ s/\.//g; + $v .= "0" while length($v) < 6; + $v; +} + +#for linking third-party xs modules static built w/ MakeMaker's: 'make static' +#must have when the xs module is compiled with profiling `-pg -a' flags +sub add_static_ar { + $PERL_STATIC_AR ||= ""; + my $cur = $APACHE_SRC =~ /^../ ? "$PWD/" : ""; + for (qw(blib/arch/auto arch/auto)) { + last if -d ($ar_dir = "$APACHE_SRC/modules/perl/$_"); + $ar_dir = ""; + } + return unless -d $ar_dir; + + finddepth(sub { + return unless /^[A-Z]\w+\.a$/; + (my $rel = $File::Find::dir) =~ s:$APACHE_SRC/?::; + (my $mod = $rel) =~ s:.*auto/::; + $mod =~ s,/,::,; + print "linking static $mod => $rel/$_\n"; + $PERL_STATIC_AR .= $cur . "$File::Find::dir/$_ "; + $PERL_STATIC_EXTS .= "$mod "; + }, $ar_dir); +} + +sub APACI::init { + return undef if $Is_Win32; + my $lib_cfg; + if($USE_APXS) { + $lib_cfg = "apaci/mod_perl.config"; + chmod 0644, $lib_cfg; + } + elsif($USE_APACI) { + $lib_cfg = "$APACHE_SRC/modules/perl/mod_perl.config"; + } + else { + return undef; + } + unless (File::Compare::compare($lib_cfg,"apaci/mod_perl.config") == 0) { + #warn "mod_perl.config already edited\n"; + #return undef; + } + + my $apaci_cfg = FileHandle->new(">$lib_cfg") or + die "can't open $lib_cfg $!"; + + my @static_src = (); + + for (@xs_mod_snames) { + push @static_src, "$_.c"; + } + + add_static_ar(); + + my $static_targets = ""; + $static_targets = <= 5.006 ? 'A' : 'D'; + phat_warn(<; + } + my $suggest = @maybe ? + "You could just symlink it to $maybe[0]" : + "You might need to install Perl from source"; + phat_warn(<= 5.006 and $Config{uselargefiles} + and $PERL_USELARGEFILES and $USE_APXS; + local $Apache::src::APXS = $WITH_APXS; + my $cflags = Apache::src->new->apxs('-q' => 'CFLAGS') || ''; + return if $cflags =~ /LARGEFILE/; + + $PERL_USELARGEFILES=0; #just do it since + return; #nobody seems to listen to the warning below + + phat_warn(<refCnt = 1; + mp->next = modList; + modList = mp; +- if (loadbind(0, mainModule, mp->entry) == -1) { ++ /* ++ * Assume anonymous exports come from the module this dlopen ++ * is linked into, that holds true as long as dlopen and all ++ * of the perl core are in the same shared object. Also bind ++ * against the main part, in the case a perl is not the main ++ * part, e.g mod_perl as DSO in Apache so perl modules can ++ * also reference Apache symbols. ++ */ ++ if (loadbind(0, (void *)dlopen, mp->entry) == -1 || ++ loadbind(0, mainModule, mp->entry) == -1) { + dlclose(mp); + errvalid++; + strcpy(errbuf, "loadbind: "); +@@ -336,12 +343,6 @@ + safefree(mp->name); + safefree(mp); + return result; +-} +- +-static void terminate(void) +-{ +- while (modList) +- dlclose(modList); + } + + /* Added by Wayne Scott + +EOF +} + +sub shrplib_check { + return unless $Config{'useshrplib'} and + $Config{'useshrplib'} eq 'define'; + + my $libperl = $Config{'libperl'} || 'libperl.so'; + + for my $dir (qw(/lib /usr/lib /usr/local/lib)) { + next unless -e "$dir/$libperl"; + + my $coredir = "$Config{'archlibexp'}/CORE"; + my $corelib = "$coredir/$libperl"; + + phat_warn(<new; + +WriteMakefile( + NAME => "Apache::ModuleConfig", + VERSION_FROM => "ModuleConfig.pm", + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/ModuleConfig/ModuleConfig.pm ./usr.sbin/httpd/mod_perl/ModuleConfig/ModuleConfig.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/ModuleConfig/ModuleConfig.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/ModuleConfig/ModuleConfig.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,31 @@ +package Apache::ModuleConfig; + +use strict; +use mod_perl (); + +{ + no strict; + $VERSION = "0.01"; + __PACKAGE__->mod_perl::boot($VERSION); +} + +sub has_srv_config { + my $file = (caller)[1]; + if($Apache::ServerStarting == 1) { + delete $INC{$file}; + } +} + +sub dir_merge { + my($base, $add) = @_; + my %new = (); + @new{ keys %$base, keys %$add} = + (values %$base, values %$add); + + return bless \%new, ref($base); +} + +1; + +__END__ + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/PerlRunXS/Makefile.PL ./usr.sbin/httpd/mod_perl/PerlRunXS/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/PerlRunXS/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/PerlRunXS/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,12 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + 'NAME' => 'Apache::PerlRunXS', + 'VERSION_FROM' => 'PerlRunXS.pm', + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/PerlRunXS/PerlRunXS.pm ./usr.sbin/httpd/mod_perl/PerlRunXS/PerlRunXS.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/PerlRunXS/PerlRunXS.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/PerlRunXS/PerlRunXS.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,74 @@ +package Apache::PerlRunXS; + +use strict; +use vars qw($Debug $VERSION); +use Apache::Constants qw(:common); + +unless (defined $Apache::Registry::NameWithVirtualHost) { + $Apache::Registry::NameWithVirtualHost = 1; +} + +$Debug ||= 0; +my $Is_Win32 = $^O eq "MSWin32"; + +$VERSION = '0.03'; + +__PACKAGE__->mod_perl::boot($VERSION); + +sub new { + my($class, $r) = @_; + return $r unless ref($r) eq "Apache"; + if(ref $r) { + $r->request($r); + } + else { + $r = Apache->request; + } + my $filename = $r->filename; + $r->log_error("Apache::PerlRunXS->new for $filename in process $$") + if $Debug && $Debug & 4; + + bless $r, $class; +} + +1; + +__END__ + +=head1 NAME + +Apache::PerlRunXS - XS implementation of Apache::PerlRun/Apache::Registry + +=head1 SYNOPSIS + + #in httpd.conf + + Alias /perl/ /perl/apache/scripts/ + PerlModule Apache::PerlRunXS + + + SetHandler perl-script + PerlHandler Apache::RegistryXS + Options +ExecCGI + #optional + PerlSendHeader On + ... + + +=head1 DESCRIPTION + +This XS implementation of Apache::PerlRun and Apache::Registry will some day +replace the Perl versions. + +=head1 SEE ALSO + +perl(1), mod_perl(3), Apache::Registry(3) + +=head1 AUTHOR + +Doug MacEachern + + + + + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/README ./usr.sbin/httpd/mod_perl/README --- ../src.danvfs/usr.sbin/httpd/mod_perl/README Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/README Sun Jun 1 18:04:27 2003 @@ -0,0 +1,99 @@ +The Apache/Perl integration project brings together the full power of +the Perl programming language and the Apache HTTP server. This is +achieved by linking the Perl runtime library into the server and +providing an object oriented Perl interface to the server's C language +API. +These pieces are seamlessly glued together by the `mod_perl' server +plugin, making it is possible to write Apache modules entirely in +Perl. In addition, the persistent interpreter embedded in the server +avoids the overhead of starting an external interpreter program and +the additional Perl start-up (compile) time. + +Without question, the most popular Apache/Perl module is +Apache::Registry module. This module emulates the CGI environment, +allowing programmers to write scripts that run under CGI or +mod_perl without change. Existing CGI scripts may require some +changes, simply because a CGI script has a very short lifetime of one +HTTP request, allowing you to get away with "quick and dirty" +scripting. Using mod_perl and Apache::Registry requires you to be +more careful, but it also gives new meaning to the work "quick"! +Apache::Registry maintains a cache of compiled scripts, which happens +the first time a script is accessed by a child server or once again if +the file is updated on disk. + +Although it may be all you need, a speedy CGI replacement is only a +small part of this project. Callback hooks are in place for each stage +of a request. Apache-Perl modules may step in during the handler, +header parser, uri translate, authentication, authorization, access, +type check, fixup, logger and cleanup stages of a request. + +Apache/Perl modules include: + Apache::Registry - Run unaltered CGI scripts + Apache::Status - Embedded interpreter runtime status + Apache::Embperl - Embed Perl code in HTML documents + Apache::SSI - Implement server-side includes in Perl + Apache::DBI - Maintain persistent DBI connections + Apache::Gateway - Implement an HTTP/1.1 gateway + Apache::GzipChain - Compress output on the fly + Apache::Filter - Filter document and script output + Apache::Sandwich - Generate page headers and footers + Apache::TransLDAP - Translate URIs via LDAP lookups + Apache::ASP - Implement "Active Server Pages" + Apache::AuthenDBI - Authenticate against a database via DBI + Apache::PHLogin - Authenticate against a PH database + Apache::DBILogger - Log requests to a database via DBI + Apache::Session - Persistent session management + Apache::Throttle - Content negotiation based on connection speed + +There's plenty more Apache/Perl software you might be interested in. +The Apache/Perl module list keeps track of modules inside and outside +the distribution, along with idea placeholders. + +It is also possible to use Perl to configure your server (in +*.conf files) with sections. This eases often complicated and +cumbersome configuration of vitrual host and various resources. Since +any Perl code can be used in these sections, configuration info could +be pulled in from an RDBMS with DBI or your favorite database package. + +While the output of mod_perl scripts can be included with Server Side +Includes just as CGI scripts can, mod_perl's integration with +mod_include gives an extra speed boost and allows Perl code to be +directly inside SSI files. + +For comments, questions, bug-reports, etc., join the Apache/Perl +mailing list by sending mail to modperl-subscribe@perl.apache.org. +sending mail to announce-subscribe@perl.apache.org +will subscribe you to the very low-traffic announcements list. + +Here is an important list of links to follow: + +Ken Williams' Epigone mail list archive: +http://forum.swarthmore.edu/epigone/modperl + +Frank Cringle's mod_perl FAQ: +http://perl.apache.org/faq/ + +Stas Bekman's "mod_perl Developer's Mini Guide": +http://perl.apache.org/guide/ + +Lincoln Stein and Doug MacEachern's book + "Writing Apache Modules with Perl and C": +http://www.modperl.com/ + +Andrew Ford's mod_perl quick reference card: +http://www.refcards.com/ + +Vivek Khera's mod_perl performance tuning guide: +http://perl.apache.org/tuning/ + +The Apache/Perl module list: +http://www.perl.com/CPAN/modules/by-module/Apache/apache-modlist.html + +The Apache/Perl homepage: +http://perl.apache.org/ + or +http://apache.perl.org/ + +Enjoy, +-Doug MacEachern (dougm@perl.apache.org) + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/STATUS ./usr.sbin/httpd/mod_perl/STATUS --- ../src.danvfs/usr.sbin/httpd/mod_perl/STATUS Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/STATUS Sun Jun 1 18:04:27 2003 @@ -0,0 +1,269 @@ +mod_perl 1.3 STATUS: + Last modified at [$Date: 2003/06/01 22:04:27 $] + + +Release: + + 1.27-dev: In development. + 1.26: Released July 11, 2001. + + +Available Patches: + + * Apache::Status allows standard keys to be overridden + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=101559176217056&w=2 + Status: + I'm not sure I understand this one, since the patch seems to do + the opposite of what the user is asking for --Geoff + patch available at + http://marc.theaimsgroup.com/?l=apache-modperl&m=101559176217056&w=2 + + +Needs Patch or Further Investigation + + * make test fails when a wrong combination of URI and LWP are + installed. (e.g. lwp 5.64 and URI 1.09). LWP's Makefile.PL + requires the right URI version, but certain binary distributors + miss this requirement and distribute LWP without making a + dependency on the right version of the URI package + Report: many reports in the last year. + Status: ??? + Suggestion: require libwww-perl 5.64 and URI 1.1 + + * two identical directives in configuration + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=97449481013350&w=2 + Status: + doc patch at http://marc.theaimsgroup.com/?l=apache-modperl&m=97450363501652&w=2 + however: this documented feature should be supported. + + * readdir() broken on linux with glibc 2.2 + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=98824089613574&w=2 + Status: + does anybody have an example to reproduce the bug? + + * warn() going to the wrong log + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=98190005604037&w=2 + Status: + coincidentially, I've noticed that s->error_fname is not populated + in a vhost when the vhost relies on the ErrorLog from the main + server --Geoff + + s->error_fname == NULL is expected, see ap_open_logs(), only + s->error_log is inherited. + + i would expect stderr to only ever be opened to the main + server log at startup. otherwise, we'd need to redirect stderr at the + start of every request and restore it at the end. seems expensive. + i would be suprised if this every worked as matt expected it + to. -dougm + + * segfaults with DBI->connect (mysql) + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=96392180616185&w=2 + Status: + + * revisit send_http_header and r->status + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=99063926111686&w=2 + Status: + + * Apache->request(bless {r => $r}, 'My::Apache') + Report: http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=98600785703290&w=2 + Status: + + * recursion triggered by internal_redirect() called by a pushed handler + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=94792974200198&w=2 + Status: + + * IPC::Open3 issues + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=98839218229712&w=2 + Status: + + * Prototype mismatch in Apache::PerlRun + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=97934624332223&w=2 + Status: + + * files that have been created after the server's (child?) startup are + being reported with negative age with -M test under Apache::Registry. + The workaround is to add $^T = time; at the beginning of the scripts. But + it would be much better if the Apache::Registry will do that + Report: ? + Status: + + * Apache::DProf seg-fault via Devel::DProf's prof_mark() + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=101923951812332&w=2 + Status: + + * collisions between Apache::Status and English.pm + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=102096856215178&w=2 + Status: + + +Open Issues or Core Enhancements: + + * method handler cached-CVs + Report: http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=99789775715863&w=2 + Status: + patch available + http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=101164617829467&w=2 + + * "$ENV{FOO} = 'foo'" is cleared from the %ENV array, but left in the + environ[], making it visible to subprocesses. + perl_util.c:perl_clear_env() only deletes from %ENV on purpose to + prevent other problems. need to rethink this. + + * option to startup with something other than /dev/null + + * PerlChildInitHandler should not be allowed inside + + * rid Apache->can_stack_handlers, make Apache->can('push_handlers') work + + * fileno(STD{IN,OUT}) should be r->connection->client->fd or + fileno(std{in,out}), rather than hardcoded fileno(stdout) + + * close STDERR; + + * Apache::FakeRequest improvments [Gary Richardson ] + + * xsubpp -nolinenumbers is not supported with 5.004 + + * 'make test' as root permissions problems + + * USE_APXS=1 + DYNAMIC=1 do not work together + + * support SSL_BASE=SYSTEM (i.e. test -d $SSL_BASE in Makefile.PL) + + * disable PERL_SSI unless mod_include is listed in httpd -l + and Action unless mod_action, etc. + + +Documentation: + + * document Apache::Status Apache::Request preference over CGI.pm + and make it more clear that Apache::Status should not be used in a + production environment, as it adds quite a bit of bloat + + * docs: update CREDITS, cleanup install docs + +Patches unlikely to be applied: + + * print() dereferencing issues + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=99905070209305&w=2 + Status: + patch available + http://marc.theaimsgroup.com/?l=apache-modperl&m=99999116330145&w=2 + + the feature of print() dereferencing scalars should be deprecated. + therefor, i don't think this patch should be applied as it + would introduce overhead to support a deprecated feature. + user should simply dereference themselves, print $$foo; -dougm + + * Apache::test + Report: http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=98278446807561&w=2 + Status: + patch available + + any further development of testing framework should be put + into Apache-Test within httpd-test/perl-framework + http://httpd.apache.org/test/ -dougm + + * get/set handlers issues + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=95721313917562&w=2 + Status: + patch available + http://perl.apache.org/~dougm/set_handlers.pat + + modperl 1.x is in maintainance mode, this change puts the + core stablity at risk to support functionality that few + require. -dougm + + * $r->args parsing of one=&two=2 + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=98018719907031&w=2 + Status: + patch available at + http://marc.theaimsgroup.com/?l=apache-modperl&m=98048943129379&w=2 + + $r->args and $r->content methods are cheap hacks that + probably never should have been written. if they are not + good enough as-is, user should use Apache::Request or another + library with more robustness. + +Known bugs unlikely to be fixed: + + * $r cannot use many api methods during ChildInit/ChildExit -> SEGV + Report: ? + Status: + "don't do that". these hooks were introduced after modperl + had already been written around all the hooks which took + only a request_rec argument. the "fake" request_rec passed + to these new hooks was a quick and dirty hack and will + probably stay that way. 2.0 does the right thing. + + * Apache->server->register_cleanup + Report: if modperl is linked static, Apache->server->register_cleanup + is only called on the first pass during server startup. + + Status: + this is a legacy bug related to modperl not doing a complete + teardown/startup of the interpreter on every restart, so it + only happens the first time a Perl{Require,Module} is loaded. + this is done properly with dso however. static users can + workaround the bug with PerlFreshRestart or delete $INC{__FILE__} + + * bytes_sent are not logged if header don't go through send_http_header(), + e.g CGI->header(-nph => 1, ...) Eric Cholet + Report: ? + + Status: + does anybody actually use nph script anymore? + + * /perl/perl-status?sig dumps core under hpux 10.20 [David-Michael.Lincke@unisg.ch] + Report: ? + + Status: + can't reproduce, can't fix. perl-status?sig is not very + useful info anyhow. + + * perl_config should not av_shift ARRAY refs from %Apache::ReadConfig:: + Report: ? + + Status: + i don't think this is actually a problem for anybody. + + * die and AUTOLOADed DESTROY == empty $@ (Perl or mod_perl bug?) + Report: ? + + Status: + this report is ages old and haven't heard any reports since. + if it is a bug, it is likely in perl. solution in that any + case: don't AUTOLOAD DESTROY. + + * can't multiple Apache::Include->virtual in a single request + Report: ? + + Status: + Apache::Include was indented as an example. the subrequest + api is not complicated, just use it directly for this + functionality. + + * Apache::Include->virtual should return run() value, not status() + Report: ? + + Status: see above. + + * SERVER_MERGE and DIR_MERGE + Report: http://marc.theaimsgroup.com/?l=apache-modperl&m=97351976714878&w=2 + Status: + The require() part may be legitimate. personally, I never + understood the DIR_CREATE happening before SERVER_CREATE + either, but it doesn't seem to affect anything. the double + DIR_MERGE is just a misunderstanding on Andy's part and is + a result of how Apache handles before and + after translation. --Geoff + + '.' is part of the default @INC, so this shouldn't be a problem. + + as for when the CREATE/MERGE functions are called, that's up + to apache when that happens. unless somebody can illustrate + that Perl directive handlers are treated any different than + C handlers, this is a documentation enhancement, not a bug. + the extra DIR_{CREATE,MERGE} is likely related to + s->lookup_defaults. -dougm diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/SUPPORT ./usr.sbin/httpd/mod_perl/SUPPORT --- ../src.danvfs/usr.sbin/httpd/mod_perl/SUPPORT Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/SUPPORT Sun Jun 1 18:04:27 2003 @@ -0,0 +1,172 @@ +=head1 SUPPORT + +=over 3 + +=item MAIL LIST + +For comments, questions, bug-reports, announcements, etc., send mail +to I. + +To subscribe to this list (which you must do to send mail to the +list), send a mail message to + +I + +We also have a mailing list just for announcements. Subscribe by +sending a message to + +I + +Discussions about the perl.apache.org website and general mod_perl +advocacy should go to the I +mailing list. Subscribe by sending mail to +I + +The HTML::Embperl mailing list is at I. +Subscribe by (you properly got the idea by now) sending mail to +I. + +All CVS commit messages goes to the I +list. Embperl CVS messages goes to I. + + +=item MAIL LIST ARCHIVES + +There are several modperl list archives, choose your favorite: + +http://perl.apache.org/#maillists + +=back + +=head1 REPORTING PROBLEMS + +=over 3 + +=item HOMEWORK + +Make sure you've done your homework before reporting a problem. +Check the mail archive, read cgi_to_mod_perl.pod, the guide, the FAQ +and other pod documents in the distribution. + +=item HOW + +When debugging, always start httpd with the C<-X> switch so only one +process is started. + +Always check the error_log. + +=item WHERE + +Please send mail to modperl@perl.apache.org + +=item WHAT + +Always include this information: + +Output of C + +Version of mod_perl + +Version of apache + +Options given to mod_perl's Makefile.PL + +Server configuration details + +Relevant sections of your ErrorLog (make test's is: t/logs/error_log) + +If 'make test' fails, the output of 'make test TEST_VERBOSE=1' + +Depending on the nature of your problem, you may also be asked: + +-Does 'make test' pass 100%? + +-Does your script still work under CGI? + +-Do you have a *small* test script that illustrates the problem? + +-Can you get a backtrace (if httpd is dumping core)? + +=item CORE DUMPS + +If you get a core dump, please send a backtrace if possible. +Before you try, build mod_perl with perl Makefile.PL PERL_DEBUG=1 +which will: + -add `-g' to EXTRA_CFLAGS + -turn on PERL_TRACE + -set PERL_DESTRUCT_LEVEL=2 (additional checks during Perl cleanup) + -link against libperld if it exists + +Here's how to get a backtrace: + + % cd mod_perl-x.xx + % touch t/conf/srm.conf + % gdb ../apache_x.xx/src/httpd + (gdb) run -X -f `pwd`/t/conf/httpd.conf -d `pwd`/t + [now make request that causes core dump] + (gdb) bt + +You can also attach to an already running process like so: + + % gdb httpd + +This attach approach is helpful when debugging a "spinning" process. +You can also get a Perl stacktrace of a "spinning" process by install a +C<$SIG{USR1}> handler in your code, like so: + + $SIG{USR1} = \&Carp::confess + +While the process is spinning, send it a I signal: + + % kill -USR1 + +Sometimes gdb can make heads or tails of the core file, try this: + + % gdb -core core + +or + + % gdb httpd core + +If the dump is happening in libperl a -DDEBUGGING enabled libperl +would help show us what's really happening. + +Go to your Perl source tree: + + % rm *.[oa] + % make LIBPERL=libperld.a + % cp libperld.a $Config{archlibexp}/CORE + +$Config{archlibexp} is: + + % perl -V:archlibexp + +Rebuild httpd/mod_perl with PERL_DEBUG=1, let's see a new backtrace. + +If you get a segfault but no core file gets dumped and you cannot +reproduce the segfault on will, you have to make sure that your +environment is set to allow a core file to be dumped. Change the +script that starts the server to do (in bash): + + ulimit -c unlimited + +before the code that starts the server. Alternatively you can execute +this command from the shell and then start the server from the same +shell. Now you should be able to get the core dumped. + +Of course the directory the server is running in (usually as defined +by ServerRoot) should be writable as well. + +=item SPINNING PROCESSES + +If a process is spinning (seemingly stuck in an endless loop, eating +up all cpu), you can use gdb to find which Perl code is causing the +spin: + +% gdb httpd +(gdb) where +(gdb) source mod_perl-x.xx/.gdbinit +(gdb) curinfo + +=back + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Server/Makefile.PL ./usr.sbin/httpd/mod_perl/Server/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Server/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Server/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,12 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + 'NAME' => 'Apache::Server', + 'VERSION_FROM' => 'Server.pm', + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Server/Server.pm ./usr.sbin/httpd/mod_perl/Server/Server.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Server/Server.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Server/Server.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,9 @@ +package Apache::Server; + +use mod_perl (); + +$VERSION = '1.01'; +__PACKAGE__->mod_perl::boot($VERSION); + +1; +__END__ diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Symbol/Makefile.PL ./usr.sbin/httpd/mod_perl/Symbol/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Symbol/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Symbol/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,9 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => "Apache::Symbol", + VERSION_FROM => "Symbol.pm", + 'dist' => { + COMPRESS=> 'gzip -9f', SUFFIX=>'gz', + }, +); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Symbol/Symbol.pm ./usr.sbin/httpd/mod_perl/Symbol/Symbol.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Symbol/Symbol.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Symbol/Symbol.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,203 @@ +package Apache::Symbol; + +use strict; +use DynaLoader (); + +@Apache::Symbol::ISA = qw(DynaLoader); +$Apache::Symbol::VERSION = '1.31'; +$Apache::Symbol::DEBUG ||= 0; + +use Devel::Symdump (); + +sub file2class { + my $file = shift; + return $file unless $file =~ s,\.pm$,,; + $file =~ s,/,::,g; + $file; +} + +sub undef_functions { + my( $package, $skip, $only_undef_exports ) = @_; + + my $stab = Devel::Symdump->rnew($package); + my @functions = $stab->functions; + + if( $only_undef_exports ) { + no strict 'refs'; + my $any_export_var; + $any_export_var = 1 if @{$package . "::EXPORT"}; + $any_export_var = 1 if @{$package . "::EXPORT_OK"}; + $any_export_var = 1 if %{$package . "::EXPORT_TAGS"}; + $any_export_var = 1 if @{$package . "::EXPORT_EXTRAS"}; + + if( $any_export_var ) { + my @names = (@{$package . "::EXPORT"}, + @{$package . "::EXPORT_OK"}, + @{$package . "::EXPORT_EXTRAS"}); + foreach my $tagdata (values %{$package . "::EXPORT_TAGS"}) { + push @names, @$tagdata; + } + my %exported = map { $package . "::" . $_ => 1 } @names; + @functions = grep( $exported{$_}, @functions ); + } + } + + for my $cv (@functions) { + no strict 'refs'; + next if substr($cv, 0, 14) eq "Devel::Symdump"; + next if $skip and $cv =~ /$skip/; + #warn "$cv=", *{$cv}{CODE}, "\n"; + Apache::Symbol::undef(*{$cv}{CODE}); + } + +} + +sub make_universal { + *UNIVERSAL::undef_functions = \&undef_functions; +} + +if($ENV{APACHE_SYMBOL_UNIVERSAL}) { + __PACKAGE__->make_universal; +} + +sub handler { + my $fh; + if ($Apache::Symbol::DEBUG) { + require IO::File; + $fh = IO::File->new(">/tmp/Apache::Symbol.debug"); + print $fh "Apache::Symbol debug for process $$\n"; + } + my $skip = join "|", __PACKAGE__, qw(Devel::Symdump); + + my $stab = Devel::Symdump->new('main'); + for my $class ($stab->packages) { + next if $class =~ /($skip)/; + if($class->can('undef_functions')) { + print $fh "$class->undef_functions\n" if $fh; + $class->undef_functions; + } + } + close $fh if $fh; + + 1; +} + +bootstrap Apache::Symbol $Apache::Symbol::VERSION; + +1; + +__END__ + +=head1 NAME + +Apache::Symbol - Things for symbol things + +=head1 SYNOPSIS + + use Apache::Symbol (); + + @ISA = qw(Apache::Symbol); + +=head1 DESCRIPTION + +B says: + + If you redefine a subroutine which was eligible for inlining you'll get + a mandatory warning. (You can use this warning to tell whether or not a + particular subroutine is considered constant.) The warning is + considered severe enough not to be optional because previously compiled + invocations of the function will still be using the old value of the + function. + +I means there is _no_ way to avoid this warning +no matter what tricks you pull in Perl. This is bogus for us mod_perl +users when restarting the server with B on or when +Apache::StatINC pulls in a module that has changed on disk. + +You can, however, pull some tricks with XS to avoid this warning, +B does just that. + +=head1 ARGUMENTS + +C takes two arguments: C and C. + +C is a regular expression indicating the function names to skip. + +Use the C flag to undef only those functions +which are listed in C<@EXPORT>, C<@EXPORT_OK>, C<%EXPORT_TAGS>, or +C<@EXPORT_EXTRAS>. C<@EXPORT_EXTRAS> is not used by the Exporter, it +is only exists to communicate with C. + +As a special case, if none of the EXPORT variables are defined ignore +C. This takes care of trivial modules that don't +use the Exporter. + +=head1 ARGUMENTS + +C takes two arguments: C and C. + +C is a regular expression indicating the function names to skip. + +Use the C flag to undef only those functions +which are listed in C<@EXPORT>, C<@EXPORT_OK>, C<%EXPORT_TAGS>, or +C<@EXPORT_EXTRAS>. C<@EXPORT_EXTRAS> is not used by the Exporter, it +is only exists to communicate with C. + +As a special case, if none of the EXPORT variables are defined ignore +C. This takes care of trivial modules that don't +use the Exporter. + +=head1 PLAYERS + +This module and the undefining of functions is optional, if you wish +to have this functionality enabled, there are one or more switches you +need to know about. + +=over 4 + +=item PerlRestartHandler + +Apache::Symbol defines a PerlRestartHandler which can be useful in +conjuction with C as it will avoid subroutine +redefinition messages. Configure like so: + + PerlRestartHandler Apache::Symbol + +=item Apache::Registry + +By placing the SYNOPSIS bit in you script, Apache::Registry will +undefine subroutines in your script before it is re-compiled to +avoid "subroutine re-defined" warnings. + +=item Apache::StatINC + +See Apache::StatINC's docs. + +=item APACHE_SYMBOL_UNIVERSAL + +If this environment variable is true when Symbol.pm is compiled, +it will define UNIVERSAL::undef_functions, which means all classes +will inherit B. + +=item Others + +Module such as B and B who compile +and script cache scripts ala Apache::Registry style can use +C with this bit of code: + + if($package->can('undef_functions')) { + $package->undef_functions; + } + +Where C<$package> is the name of the package in which the script is +being re-compiled. + +=back + +=head1 SEE ALSO + +perlsub(1), Devel::Symdump(3) + +=head1 AUTHOR + +Doug MacEachern diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Symbol/Symbol.xs ./usr.sbin/httpd/mod_perl/Symbol/Symbol.xs --- ../src.danvfs/usr.sbin/httpd/mod_perl/Symbol/Symbol.xs Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Symbol/Symbol.xs Sun Jun 1 18:04:27 2003 @@ -0,0 +1,130 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifdef PERL_OBJECT +#define sv_name(svp) svp +#define undef(ref) +#else +static void undef(SV *ref) +{ + GV *gv; + SV *sv; + CV *cv; + I32 has_proto=FALSE; + + if(SvROK(ref)) + sv = SvRV(ref); + else + croak("Apache::Symbol::undef called without a reference!"); + + switch (SvTYPE(sv)) { + case SVt_PVCV: + cv = (CV*)sv; + if (!CvXSUB(cv) && CvROOT(cv) && CvDEPTH(cv)) { + return; /* subroutine is active */ + } + + gv = (GV*)SvREFCNT_inc(CvGV(cv)); + if(SvPOK(cv)) + has_proto = TRUE; + + cv_undef(cv); + CvGV(cv) = gv; /* let user-undef'd sub keep its identity */ + if(has_proto) + SvPOK_on(cv); /* otherwise we get `Prototype mismatch:' */ + + break; + + default: + warn("Apache::Symbol::undef called without a CODE reference!\n"); + } +} + +static SV *sv_name(SV *svp) +{ + SV *sv = Nullsv; + SV *RETVAL = Nullsv; + + if(svp && SvROK(svp) && (sv = SvRV(svp))) { + switch(SvTYPE(sv)) { + case SVt_PVCV: + RETVAL = newSV(0); + gv_fullname(RETVAL, CvGV(sv)); + break; + + default: + break; + } + } + else if(svp && SvPOK(svp)) { + RETVAL = newSVsv(svp); + } + + return RETVAL; +} +#endif + +MODULE = Apache::Symbol PACKAGE = Apache::Symbol + +PROTOTYPES: DISABLE + +void +undef(sv) + SV *sv + +SV * +sv_name(sv) + SV *sv + +SV * +cv_const_sv(sv) + SV* sv + + PREINIT: + CV *cv; + GV *gv; + HV *stash; + + CODE: + + switch (SvTYPE(sv)) { + default: + if (!SvROK(sv)) { + char *sym; + + if (SvGMAGICAL(sv)) { + mg_get(sv); + sym = SvPOKp(sv) ? SvPVX(sv) : Nullch; + } + else { + STRLEN n_a; + sym = SvPV(sv, n_a); + } + if(sym) + cv = perl_get_cv(sym, TRUE); + break; + } + cv = (CV*)SvRV(sv); + if (SvTYPE(cv) == SVt_PVCV) + break; + + case SVt_PVHV: + case SVt_PVAV: + croak("Not a CODE reference"); + case SVt_PVCV: + cv = (CV*)sv; + break; + case SVt_PVGV: + if (!(cv = GvCVu((GV*)sv))) + cv = sv_2cv(sv, &stash, &gv, TRUE); + break; + } + + if(!(RETVAL = cv_const_sv(cv))) + XSRETURN_UNDEF; + + SvREADONLY_off(RETVAL); + + OUTPUT: + RETVAL diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Symbol/test.pl ./usr.sbin/httpd/mod_perl/Symbol/test.pl --- ../src.danvfs/usr.sbin/httpd/mod_perl/Symbol/test.pl Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Symbol/test.pl Sun Jun 1 18:04:27 2003 @@ -0,0 +1,44 @@ +BEGIN { + $^W=1; + print "1..3\n"; +} + +use ExtUtils::testlib; +use Apache::Symbol (); + +use strict; + +package Foo; + +@Foo::ISA = qw(Apache::Symbol); +sub one {1} + +sub constant_one () {1} + +#comment out the line below and you'll see something like: +#Subroutine one redefined at (eval 1) line 1. +#Constant subroutine constant_one redefined at (eval 2) line 1. + +Foo->undef_functions; + +eval "sub one {1}"; +eval "sub constant_one () {1}"; + +print "ok 1\n"; + +my $name = Apache::Symbol::sv_name(\&Foo::one); +print "not " unless $name eq "Foo::one"; + +print "ok 2\n"; + +package main; + +sub THREE () {3} +my $sv = Apache::Symbol::cv_const_sv(\&THREE) or print "not "; + +$sv ||= "3 (failed!)"; +print "ok $sv\n"; + + + + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Table/Makefile.PL ./usr.sbin/httpd/mod_perl/Table/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Table/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Table/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,12 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + 'NAME' => 'Apache::Table', + 'VERSION_FROM' => 'Table.pm', + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Table/Table.pm ./usr.sbin/httpd/mod_perl/Table/Table.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Table/Table.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Table/Table.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,118 @@ +package Apache::Table; + +use mod_perl (); + +$VERSION = '0.01'; +__PACKAGE__->mod_perl::boot($VERSION); + +1; + +__END__ + +=head1 NAME + +Apache::Table - Perl interface to the Apache table structure + +=head1 SYNOPSIS + + use Apache::Table (); + + my $headers_out = $r->headers_out; + while(my($key,$val) = each %$headers_out) { + ... + } + + my $table = $r->headers_out; + $table->set(From => 'dougm@perl.apache.org'); + +mod_perl needs to be compiled with at least one of the following options: + + DYNAMIC=1 + PERL_TABLE_API=1 + EVERYTHING=1 + +=head1 DESCRIPTION + +This module provides tied interfaces to Apache data structures. + +=head2 CLASSES + +=over 4 + +=item Apache::Table + +The I class provides methods for interfacing +with the Apache C structure. +The following I class methods, when called in a scalar context +with no "key" argument, will return a I reference blessed into the +I class and where I is tied to +I: + + headers_in + headers_out + err_headers_out + notes + dir_config + subprocess_env + +=head2 METHODS + +=over 4 + +=item get + +Corresponds to the C function. + + my $value = $table->get($key); + + my $value = $headers_out->{$key}; + +=item set + +Corresponds to the C function. + + $table->set($key, $value); + + $headers_out->{$key} = $value; + +=item unset + +Corresponds to the C function. + + $table->unset($key); + + delete $headers_out->{$key}; + +=item clear + +Corresponds to the C function. + + $table->clear; + + %$headers_out = (); + +=item add + +Corresponds to the C function. + + $table->add($key, $value); + +=item merge + +Corresponds to the C function. + + $table->merge($key, $value); + +=back + +=back + +=head1 AUTHOR + +Doug MacEachern + +=head1 SEE ALSO + +Apache(3), mod_perl(3) + +=cut diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/URI/Makefile.PL ./usr.sbin/httpd/mod_perl/URI/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/URI/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/URI/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,14 @@ +use ExtUtils::MakeMaker; +use Config; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + NAME => "Apache::URI", + VERSION_FROM => "URI.pm", + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/URI/URI.pm ./usr.sbin/httpd/mod_perl/URI/URI.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/URI/URI.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/URI/URI.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,123 @@ +package Apache::URI; + +use mod_perl (); + +$VERSION = '1.00'; +__PACKAGE__->mod_perl::boot($VERSION); + +1; +__END__ + +=head1 NAME + +Apache::URI - URI component parsing and unparsing + +=head1 SYNOPSIS + + use Apache::URI (); + my $uri = $r->parsed_uri; + + my $uri = Apache::URI->parse($r, "http://perl.apache.org/"); + +=head1 DESCRIPTION + +This module provides an interface to the Apache I module and +the I structure. + +=head1 METHODS + +=over 4 + +=item Apache::parsed_uri + +Apache will have already parsed the requested uri components, which can +be obtained via the I method defined in the I class. +This method returns an object blessed into the I class. + + my $uri = $r->parsed_uri; + +=item parse + +This method will parse a URI string into uri components which are stashed +in the I object it returns. + + my $uri = Apache::URI->parse($r, "http://www.foo.com/path/file.html?query+string"); + +This method is considerably faster than using I: + + timethese(5000, { + C => sub { Apache::URI->parse($r, $test_uri) }, + Perl => sub { URI::URL->new($test_uri) }, + }); + + Benchmark: timing 5000 iterations of C, Perl... + C: 1 secs ( 0.62 usr 0.04 sys = 0.66 cpu) + Perl: 6 secs ( 6.21 usr 0.08 sys = 6.29 cpu) + +=item unparse + +This method will join the uri components back into a string version. + + my $string = $uri->unparse; + + +=item scheme + + my $scheme = $uri->scheme; + + +=item hostinfo + + my $hostinfo = $uri->hostinfo; + + +=item user + + my $user = $uri->user; + + +=item password + + my $password = $uri->password; + + +=item hostname + + my $hostname = $uri->hostname; + +=item port + + my $port = $uri->port; + +=item path + + my $path = $uri->path; + +=item rpath + +Returns the I minus I. + + my $path = $uri->rpath; + + +=item query + + my $query = $uri->query; + + +=item fragment + + my $fragment = $uri->fragment; + + +=back + +=head1 AUTHOR + +Doug MacEachern + +=head1 SEE ALSO + +perl(1). + +=cut diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Util/Makefile.PL ./usr.sbin/httpd/mod_perl/Util/Makefile.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/Util/Makefile.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Util/Makefile.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,12 @@ +use ExtUtils::MakeMaker; + +use lib qw(../lib); +use Apache::src (); +my $src = Apache::src->new; + +WriteMakefile( + 'NAME' => 'Apache::Util', + 'VERSION_FROM' => 'Util.pm', # finds $VERSION + 'INC' => $src->inc, + 'TYPEMAPS' => $src->typemaps, +); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/Util/Util.pm ./usr.sbin/httpd/mod_perl/Util/Util.pm --- ../src.danvfs/usr.sbin/httpd/mod_perl/Util/Util.pm Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/Util/Util.pm Sun Jun 1 18:04:27 2003 @@ -0,0 +1,166 @@ +package Apache::Util; + +use strict; +use mod_perl (); +use vars qw($VERSION @EXPORT_OK %EXPORT_TAGS); + +use Exporter (); +use DynaLoader (); + +*unescape_uri = \&Apache::unescape_url; +*unescape_uri_info = \&Apache::unescape_url_info; + +*import = \&Exporter::import; + +@EXPORT_OK = qw(escape_html escape_uri unescape_uri unescape_uri_info + parsedate ht_time size_string validate_password); +%EXPORT_TAGS = (all => \@EXPORT_OK); +$VERSION = '1.02'; + +__PACKAGE__->mod_perl::boot($VERSION); + +1; +__END__ + + +=head1 NAME + +Apache::Util - Interface to Apache C util functions + +=head1 SYNOPSIS + + use Apache::Util qw(:all); + +=head1 DESCRIPTION + +This module provides a Perl interface to some of the C utility functions +available in Perl. The same functionality is avaliable in libwww-perl, but +the C versions are faster: + + use Benchmark; + timethese(1000, { + C => sub { my $esc = Apache::Util::escape_html($html) }, + Perl => sub { my $esc = HTML::Entities::encode($html) }, + }); + + Benchmark: timing 1000 iterations of C, Perl... + C: 0 secs ( 0.17 usr 0.00 sys = 0.17 cpu) + Perl: 15 secs (15.06 usr 0.04 sys = 15.10 cpu) + + use Benchmark; + timethese(10000, { + C => sub { my $esc = Apache::Util::escape_uri($uri) }, + Perl => sub { my $esc = URI::Escape::uri_escape($uri) }, + }); + + Benchmark: timing 10000 iterations of C, Perl... + C: 0 secs ( 0.55 usr 0.01 sys = 0.56 cpu) + Perl: 2 secs ( 1.78 usr 0.01 sys = 1.79 cpu) + +=head1 FUNCTIONS + +=over 4 + +=item escape_html + +This routine replaces unsafe characters in $string with their entity +representation. + + my $esc = Apache::Util::escape_html($html); + +This function will correctly escape US-ASCII output. If you are using +a different character set such as UTF8, or need more control on +the escaping process, use HTML::Entities. + +=item escape_uri + +This function replaces all unsafe characters in the $string with their +escape sequence and returns the result. + + my $esc = Apache::Util::escape_uri($uri); + +=item unescape_uri + +This function decodes all %XX hex escape sequences in the given URI. + + my $unescaped = Apache::Util::unescape_uri($safe_uri); + +=item unescape_uri_info + +This function is similar to unescape_uri() but is specialized to remove +escape sequences from the query string portion of the URI. The main +difference is that it translates the ``+'' character into spaces as well +as recognizing and translating the hex escapes. + +Example: + + $string = $r->uri->query; + my %data = map { Apache::Util::unescape_uri_info($_) } + split /[=&]/, $string, -1; + + This would correctly translate the query string + ``name=Fred+Flintstone&town=Bedrock'' into the hash: + + data => 'Fred Flintstone', + town => 'Bedrock' + +=item parsedate + +Parses an HTTP date in one of three standard forms: + + Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 + + Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 + + Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format + +Example: + + my $secs = Apache::Util::parsedate($date_str); + +=item ht_time + +Format a time string. + +Examples: + + my $str = Apache::Util::ht_time(time); + + my $str = Apache::Util::ht_time(time, "%d %b %Y %T %Z"); + + my $str = Apache::Util::ht_time(time, "%d %b %Y %T %Z", 0); + +=item size_string + +Converts the given file size into a formatted string. The size +given in the string will be in units of bytes, kilobytes, or +megabytes, depending on the size. + + my $size = Apache::Util::size_string -s $r->finfo; + +=item validate_password + +Validate a plaintext password against a smashed one. Use either +crypt() (if available), ap_MD5Encode() or ap_SHA1Encode depending +upon the format of the smashed input password. + +Returns true if they match, false otherwise. + + if (Apache::Util::validate_password("slipknot", "aXYx4GnaCrDQc")) { + print "password match\n"; + } + else { + print "password mismatch\n"; + } + +=back + +=head1 AUTHOR + +Doug MacEachern + +=head1 SEE ALSO + +perl(1). + +=cut diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apache-modlist.html ./usr.sbin/httpd/mod_perl/apache-modlist.html --- ../src.danvfs/usr.sbin/httpd/mod_perl/apache-modlist.html Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apache-modlist.html Sun Jun 1 18:04:27 2003 @@ -0,0 +1,378 @@ + + +The Apache/Perl Module List + + +

The Apache/Perl Module List

+ +Maintained by Doug MacEachern, +
$Revision: 1.1.1.1 $ $Date: 2003/06/01 22:04:27 $ + +

Contents

+Introduction
+Playing Your Part
+The Apache/Perl Modules
+Where Are The Modules Kept?
+Contacts
+More Info
+

+

Introduction

+The Apache/Perl module list is here for the same reason as the +main +Perl module list, to change duplication of effort into cooperation +and help to save the world! Apache/Perl modules are somewhat different +from the many others found on CPAN. Most Perl modules are +"building blocks", developers use them +to build applications or even more building blocks. +It just so happens +that Apache/Perl modules are encapsulted inside a namespace and .pm file. +However, this does not make them all building blocks, many are just like +apache modules written in C, you install, edit the server configuration +files and you're done. Before you start a new module, consider this: +Apache/Perl modules are useless outside of mod_perl and Apache. Do your best +to design such that your Apache::* module will make good use of the +building blocks found on CPAN, putting together new building blocks where +appropriate and simply glue them together with the Apache +API, keeping the Apache::* modules very small. +

+These modules will also serve as good examples, showing you where modules +can step in during a stage of a request with Perl*Handler callbacks. +You'll also see how and when to use the Apache API methods. + +

Playing Your Part

+Apache and Perl are world-wide collaborative efforts, naturally, the +Apache/Perl integration project is the same.
+You've started on the right foot simply by reading this document, thanks!
+Please be sure you've read the +main +Perl module list, all that is said there is relevant here! +

+If you have any additions or changes for the list, please send them to +the Apache/Perl mailing list +or to me. +

+If you wish to share you module(s) the Perl way, by putting them on CPAN, +send a request to me or +modules@perl.org to get set up with a +PAUSE user id and directory. +

+HINT: For a nice set of template files try this: +

+% h2xs -AX -n Apache::YourPackageName
+
+ +

The Apache/Perl modules

+
+Apache::
+
+* PerlHandler's
+AddrMunge	bdpf	Munge email addresses in webpages	MJD
+AutoIndex	Rdcf	Lists directory content			GOZER
+Archive		bdpf	Make linked contents pages of .tar(.gz) JPETERSON
+ASP		bdpO	Implement Active Server Pages		CHAMAS
+BBS		cdpO 	BBS like System for Apache		MKOSS
+CallHandler	cdpf	Map filenames to subroutine calls	GKNOPS
+Cachet		i	OutputChain with caching		MERLYN
+Compress	bdpO	Compress content on the fly		KWILLIAM
+Dir		i	OO (subclassable) mod_dir replacement 	DOUGM
+Dispatch        bmpf    Call PerlHandlers as CGI scripts        GEOFF
+Embperl		Rmcf	Embed Perl in HTML			GRICHTER
+EmbperlChain	bdpO	Feed handler output to Embperl		CHOLET
+ePerl		Rdpr  	Fast emulated Embedded Perl (ePerl)	RSE            
+Filter		RdpO	OutputChain like functionality		KWILLIAM
+Forward		bdpO	OutputChain like functionality		MPB
+FTP		i	Full-fledged FTP proxy			PMKANE
+Gateway		bdpf	A multiplexing gateway			CCWF
+GzipChain	bmpf	Compress files on the fly		ANDK
+iNcom		bdpf	An e-commerce framework			FRAJULAC
+Layer		bdpf	Layer content tree over one or more	SAM
+Magick		bdpf	Image conversion on-the-fly		MPB
+Mason		bdpO	Build sites w/ modular Perl/HTML blocks	JSWARTZ
+ModuleDoc	bdpf	Self documentation for Apache C modules	DOUGM
+NavBar		bdpO	Navigation bar generator		MPB
+NNTPGateway	adpf	A Web based NNTP (usenet) interface	BOUBAKER
+OutputChain     bmpO	Chain output of stacked handlers	JANPAZ
+OWA		bdpf	Runs Oracle PL/SQL Web Toolkit apps	SVINTO
+PageKit         ampO    Application framework w/ HTML::Template TJMATHER
+PassFile	bdpf	Send file via OutputChain		ANDK
+PerlRun		Smpf	Run unaltered CGI scripts		APML
+PrettyPerl      Rdpf    Syntax highlighting for Perl files	RA
+PrettyText	bdpf	Re-format .txt files for client display	CHTHORMAN
+RandomLocation	bdpf	Random image display 			RKOBES
+Registry	Smpf	Run unaltered CGI scripts 		APML
+RobotRules	cdpf	Enforce robot rules (robots.txt)	PARKER
+Sandwich	bmpf	Layered document (sandwich) maker	VKHERA
+ShowRequest	bdpf	Show phases and module participation	DOUGM
+SimpleReplace   ampf    Simple replacement template tool        GEOFF
+SSI		RmpO	Implement server-side includes in Perl	KWILLIAM
+SSIChain	bmpO	SSI on other modules output		JANPAZ
+Stage		Rdpf	Manage a document staging directory	ANDK
+TarGzip		c						ZENIN
+TimedRedirect	bdpf	Redirect urls for a given time period	PETERM 
+UploadSvr	bdpO	A lightweight publishing system		ANDK
+VhostSandwich  cdpf    Virtual host layered document maker     MARKC
+WDB		bdpf	Database query/edit tool using DBI	JROWE
+WebSQL		cdpO	Adaptation of Sybase's WebSQL		GUNTHER
+
+* PerlInitHandler's
+RequestNotes    ampf    Pass cookie & form data around pnotes   GEOFF
+
+* PerlHeaderParserHandler's
+AgentDeny	cdpf	Deny abusive User-Agents		ROBH
+
+* PerlAuthenHandler's
+AuthAny		bdpf	Authenticate with any username/password	MPB
+AuthenCache	bmpf	Cache authentication credentials	JBODNAR
+AuthCookie	RdpO	Authen + Authz via cookies		KWILLIAM
+AuthenDBI	bmpO	Authenticate via Perl's DBI		MERGL
+AuthenGSS	cdpf    Generic Security Service (RFC 2078)	DOUGM
+AuthenIMAP	bdpf	Authentication via an IMAP server	MICB
+AuthenPasswdSrv bdpf	External authentication server		JEFFH
+AuthenPasswd	bdpf	Authenticate against /etc/passwd	DEP
+AuthLDAP	bdpf	LDAP authentication module		CDONLEY
+AuthPerLDAP	bdpf	LDAP authentication module (PerLDAP)	HENRIK
+AuthenNIS	bdpf	NIS authentication			DEP
+AuthNISPlus	bdpF	NIS Plus authentication/authorization	VALERIE
+AuthenRaduis	bdpf	Authentication via a Radius server	DANIEL
+AuthenSmb	bdpf	Authenticate against NT server		PARKER
+AuthenURL	bdpf	Authenticate via another URL		JGROENVEL
+DBILogin	bdpf	Authenticate to backend database 	JGROENVEL
+DCELogin	bdpf	Obtain a DCE login context		DOUGM
+PHLogin		bdpf	Authenticate via a PH database		JGROENVEL
+TicketAccess	bdpO	Ticket based access/authentication	MPB
+
+* PerlAuthzHandler's
+AuthCookie	bdpf	Authen + Authz via cookies		EBARTLEY
+AuthzAge	bmpf	Authorize based on age			APML
+AuthzDCE	cdpf	DFS/DCE ACL based access control	DOUGM
+AuthzDBI	bmpO	Group authorization via Perl's DBI	MERGL
+AuthzGender	bdpf	Authorize based on gender		MPB
+AuthzNIS	bdpf	NIS authorization			DEP
+AuthzPasswd	bdpf	Authorize against /etc/passwd		DEP
+AuthzSSL	bdpf	Authorize based on client cert		MPB
+RoleAuthz	i	Role-based authorization		DOUGM
+
+* PerlAccessHandler's
+AccessLimitNum	bmpf	Limit user access by number of requests	APML
+BlockAgent	bdpf	Block access from certain agents	MPB
+DayLimit	bmpf	Limit access based on day of week	MPB
+IPThrottle	cdpf	Limit bandwith consumption by IP	MERLYN
+RobotLimit	cdpf	Limit access of robots			PARKER
+SpeedLimit	bdpf	Control client request rate		MPB
+
+* PerlTypeHandler's
+AcceptLanguage	cdpf	Send file type based on language pref	ROBH
+MIME		bdcf	Perl implementation of mod_mime		MPB
+MimeDBI		bdpf	Type mapping from a DBI database	MPB
+MimeXML		bdpf	mime encoding sniffer for XML files	MSERGEANT
+ 
+* PerlTransHandler's    (May also include a PerlHandler)
+AdBlocker	bdpf	Block advertisement images		MPB
+AddHostPath	adpf    Prepends parts of hostname to URI       RJENKS
+AnonProxy	bdpf	Anonymizing proxy			MPB
+Checksum	bdpf	Manage document checksum trees		MPB
+DynaRPC		i	Dynamically translate URIs into RPCs	DOUGM
+LowerCaseGETs	bdpf	Lowercase URI's when needed		PLISTER
+MsqlProxy	bmpf	Translate URI's into mSQL queries	APML
+ProxyPass	bdpf	Perl implementation of ProxyPass	MJS
+ProxyPassThru	bdpO	Skeleton for vanilla proxy		RMANGI
+ProxyCache	i	Caching proxy				DOUGM
+StripSession	bdpf	Strip session info from URI		MPB
+Throttle        bdpf    Speed-based content negotiation         DONS
+TransLDAP	bdpf	Translate URIs to LDAP queries		CDONLEY
+
+* PerlFixupHandler's
+HttpEquiv	bdpf	HTML HTTP-EQUIV tags to HTTP headers	ROBH
+RefererBlock	bdpf	Block based on MIME type + Referer	CHOLET
+Timeit		bmpf	Benchmark PerlHandlers			APML
+Usertrack	bdpf	Perl version of mod_usertrack		ABH
+
+* PerlLogHandler's
+DBILogConfig	bdpf	Custom format logging via DBI		JBODNAR
+DBILogger	bdpf	Logging via DBI				ABH
+DumpHeaders	bdpf	Watch HTTP transaction via headers	DOUGM
+LogMail		bdpf	Log certain requests via email		MPB 
+Traffic		bdpf	Logs bytes transferred, per-user basis 	MAURICE
+WatchDog	c	Look for problematic URIs		DOUGM
+
+* PerlChildInitHandler's
+Resource	Smpf	Limit resources used by httpd children	APML
+
+* Server Configuration
+ConfigLDAP	i	Config via LDAP and <Perl>		MARKK
+ConfigDBI	i	Config via DBI and <Perl>		MARKIM
+ModuleConfig	SmcO	Interface to configuration API		APML
+PerlSections	SmpO	Utilities for <Perl> sections		APML
+httpd_conf	bmpO	Methods to configure and run an httpd	APML
+src		SmpO	Finding and reading bits of source	APML
+
+* Database
+DBI		bmpO	Persistent DBI connection mgmt.		MERGL
+Sybase::DBlib   bmpO    Persistent DBlib connection mgmt.	BMILLET
+Sybase::CTlib	bapO	Persistent CTlib connection mgmt.	MDOWNING
+Mysql		bdpO	Persistent connection mgmt. for Mysql	NJENSEN
+
+* Interfaces and integration with Apache C structures and modules
+Apache		SmcO	Interface to request_rec struct + API	APML
+Backhand	bdcr	Bridge between mod_backhand + mod_perl	DLOWE
+CmdParms	SmcO	Interface to Apache cmd_parms struct	APML
+Command		bmcO	Interface to Apache command_rec struct	APML
+Connection	SmcO	Inteface to Apache conn_rec struct	APML
+Constants	Smcf	Constants defined in httpd.h		APML
+ExtUtils	SmpO	Utils for Apache:C/Perl glue		APML
+File		SmcO	Methods for working with files		APML 
+Handler		bmcO	Interface to Apache handler_rec struct	APML
+Log		SmcO	ap_log_error interface			APML
+LogFile		bmcO	Interface to Apache's piped logs, etc.	APML
+Module		bmcO	Interface to Apache module struct	APML
+Scoreboard      RdcO    Perl interface to Apache's scoreboard.h DOUGM
+Server		SmcO	Interface to Apache server_rec struct	APML
+SubProcess	cmcO	Interface to Apache subprocess API	APML
+Table		SmcO	Interface to Apache table struct + API 	APML
+URI		SmcO	URI component parsing and unparsing	APML
+Util		Smcf	Interface to Apache's util*.c functions	APML
+
+* HTTP Method handlers
+PATCH		bdpf	HTTP PATCH method handler		MPB
+PUT		cdpf	HTTP PUT method handler 		SORTIZ
+Roaming		bdpO	PUT/GET/MOVE/DELETE (Netscape Roaming)	JWEID
+
+* Watchdog and Monitoring tools
+SizeLimit         Smpf    Graceful exit for large children        APML
+GTopLimit	  Rdpn	  Child exit on small shared or large mem STAS
+Status            Smpf    Embedded interpreter runtime status     APML
+VMonitor          Rdpn    Visual System and Processes Monitor     STAS
+Watchdog::RunAway Rdpn    RunAway processes watchdog/terminator   STAS
+
+* Development and Debug tools
+DB		amcO	Hook Perl interactive DB into mod_perl	DOUGM
+Debug		Rmpf	mod_perl debugging utilities		APML
+DebugInfo       ampO    Per-request data logging                GEOFF
+DProf		bmcf	Hook Devel::DProf into mod_perl		DOUGM
+FakeRequest	ampO	Implement Apache methods off-line	APML
+Leak		bmcf	Memory leak tracking routines		APML
+Peek		amcf	Devel::Peek for mod_perl		APML
+SawAmpersand	bmpf	Make sure noone is using $&, $' or $`	APML
+SmallProf	bmpf	Hook Devel::SmallProf into mod_perl	DOUGM
+StatINC		Smpf	Reload require'd files when updated	APML
+Symbol		bmcO	Things for symbol things		APML
+Symdump		bmpf	Symbol table snapshots to disk		APML
+test		Smpf	Handy routines for 'make test' scripts	APML
+
+* Misc
+Byterun		i	Run Perl bytecode modules		DOUGM
+Cookie		amcO	C version of CGI::Cookie		APML
+Icon		bdcO	Access to AddIcon* configuration	DOUGM
+Include		Smpf	mod_include + Apache::Registry handler	APML
+Mmap		bdcf	Share data via Mmap module		FLETCH
+Motd            bmpf    Add Message of the Day functionality    CRAMIREZ
+ParseLog	bdpO	OO interface to Apache log files	AKIRA
+RegistryLoader	SmpO	Apache::Registry startup script loader 	APML
+Request		amcO    CGI.pm functionality using API methods	APML
+Safe		ampO	Adaptation of "safecgiperl"		APML
+Session		bmpO	Maintain client <-> httpd session/state	JBAKER
+Servlet		ampO	Interface to the Java Servlet engine	IKLUFT
+SIG		SmpO	Signal handlers for mod_perl		APML
+State		i	Powerful state engine			RSE
+TempFile	bdpf	Manage temporary files			TOMHUGHES
+Upload		amcO	File upload class			APML
+
+
+

Where Are The Modules Kept?

+Modules listed with the APML as is contact are part of the +mod_perl distribution package. Other modules can be found on CPAN +the +modules/by-module/Apache/ directory. If they have not made it +to CPAN yet, they might be found in the mod_perl +contrib +directory, which is also tar'd and distributed via CPAN in the + +modules/by-module/Apache/ directory. +Otherwise, feel free to ask the contact author or the list +how you can go about getting your hands on a copy. + +

Contacts

+
+ABH  	  Ask Bjørn Hansen <ask@netcetera.dk>
+AKIRA	  Akira Hangai <akira@discover-net.net>
+ANDK	  Andreas König <a.koenig@franz.ww.TU-Berlin.DE>
+APML	  The Apache/Perl Mailing List <modperl@perl.apache.org>
+BMILLETT  Brian Millett <bpm@techapp.com>
+BOUBAKER  Heddy Boubaker <boubaker@cena.fr>
+CCWF	  Charles C. Fu &lt;ccwf@bacchus.com&gt;
+CDONLEY   Clayton Donley <donley@wwa.com>
+CHAMAS	  Joshua Chamas <chamas@alumni.stanford.org>
+CHOLET	  Eric Cholet <cholet@logilune.com>
+CHTHORMAN Chris Thorman <chris@thorman.com>
+CRAMIREZ  Carlos Ramirez <carlos@quantumfx.com>
+DANIEL	  Daniel <daniel-authenradius@electricrain.com>
+DEP	  Demetrios E. Paneras <dep@media.mit.edu>
+DLOWE	  David Lowe <dlowe@pootpoot.com>
+DONS	  Don Schwarz <don@dons.xnet.com>
+DOUGB     Doug Bagley <doug@dejanews.com>
+DOUGM	  Doug MacEachern <dougm@pobox.com>
+EBARTLEY  Eric Bartley  <bartley@osd.cc.purdue.edu>
+FLETCH    Mike Fletcher <lemur1@mindspring.com>
+FRAJULAC  Francis J. Lacoste <frajulac@insu.com>
+GEOFF     Geoffrey Young <geoff@cpan.org>
+GKNOPS	  Gerd Knops <gerti@BITart.com>
+GOZER	  Philippe M. Chiasson <gozer@ectoplasm.dyndns.com>
+GRICHTER  Gerald Richter <richter@ecos.de>
+GUNTHER   Gunther Birznieks <gunther@nhgri.nih.gov>
+HENRIK	  Henrik Strom <henrik@computer.org>
+HMUELLER  Hanno Mueller <hmueller@mail.kabel.de>
+IKLUFT	  Ian Kluft <ikluft@cisco.com>
+JANPAZ	  Honza Pazdziora <adelton@informatics.muni.cz>
+JBAKER    Jeffrey Baker <jeff@godzilla.tamu.edu>
+JBODNAR	  Jason Bodnar <jbodnar@tivoli.com>
+JGROV	  John D Groenveld <jdg117@elvis.arl.psu.edu>
+JEFFH	  Jeffrey Hulten <jeffh@premier1.net>
+JROWE	  Jeff Rowe <beowulf@lava.net>
+JSWARTZ	  Jonathan Swartz <swartz@transbay.net>
+JWEID	  Jochen Wiedmann <joe@ispsoft.de>
+KWILLIAM  Ken Williams  <ken@forum.swarthmore.edu>
+LDS	  Lincoln D. Stein <lstein@genome.wi.mit.edu>
+MARKC	  Mark Constable <markc@goldcoast.org>
+MARKIM	  Mark A. Imbriaco <mark@itribe.net>
+MARKK	  Mark Kennedy <mtk@ny.ubs.com>
+MAURICE	  Maurice Aubrey <maurice@hevanet.com>
+MDARWIN	  Matthew Darwin <matthew@davin.ottawa.on.ca>
+MDORMAN	  Michael Alan Dorman  <mdorman@calder.med.miami.edu>
+MDOWNING  Mark Downing <mdowning@rdatasys.com>
+MERGL	  Edmund Mergl <E.Mergl@bawue.de>
+MERLYN	  Randal L. Schwartz <merlyn@stonehenge.com>
+MJD	  Mark-Jason Dominus <mjd-perl-pause2@plover.com>
+MJS       Michael Smith <mjs@iii.co.uk>
+MKOSS	  Max Kossatzmax <kossatz@thing.at>
+MICB  	  Malcolm Beattie <mbeattie@sable.ox.ac.uk>
+MPB	  mod_perl book (Doug and Lincoln) <book@modperl.com>
+MSERGEANT Matt Sergeant <matt@sergeant.org>
+RA        Roman Kosenko <ra@amk.lg.ua>
+NJENSEN	  Neil Jensen <njensen@habaneros.com>
+PARKER	  Michael Parker <parker@austx.tandem.com>
+PETERM	  Peter Marshall <peterm@pageactive.com>
+JPETERSON  Jonathan Peterson <jon@amxstudios.com>
+PLISTER   Peter Lister <p.lister@cranfield.ac.uk>
+PMKANE	  Patrick Michael Kane <modus@pr.es.to>
+PTI	  Peter Tillemans <pti@pandora.be>
+RJENKS	  Robert Jenks <rjenks@cvsroot.org>
+RKOBES	  Randy Kobes <randy@theory.uwinnipeg.ca>
+RMANGI    Rick Mangi <rmangi@tgix.com>
+ROBH	  Rob Hartill <robh@imdb.com>
+RSE       Ralf S. Engelschall <rse@engelschall.com>
+SAM	  Simon Matthews <sam@peritas.com>
+SKANE     Stephen E Kane <sek112@elvis.arl.psu.edu>
+SORTIZ	  Salvador Ortiz <sortiz@msg.com.mx>
+STAS      Stas Bekman <stas@stason.org>
+SVINTO	  Svante Sörmark <svinto@ita.chalmers.se>
+TJMATHER  T.J. Mather <tjmather@thoughtstore.com>
+TOMHUGHES Tom Hughes <tom@compton.demon.co.uk>
+VALERIE	  Valerie Delane <valerie@savina.com>
+VKHERA    Vivek Khera <vivek@khera.org>
+ZENIN	  Byron Brummer <zenin@archive.rhps.org>
+
+ +

More Info

+See the Apache/Perl homepage. + + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/Makefile.libdir ./usr.sbin/httpd/mod_perl/apaci/Makefile.libdir --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/Makefile.libdir Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/Makefile.libdir Sun Jun 1 18:04:27 2003 @@ -0,0 +1,4 @@ +This is a place-holder which indicates to Apache's src/Configure script that +it shouldn't provide the default targets when building the Makefile from +Makefile.tmpl in this directory. Instead it'll just prepend all the important +variable definitions, and copy the Makefile.tmpl onto the end. diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/Makefile.tmpl ./usr.sbin/httpd/mod_perl/apaci/Makefile.tmpl --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/Makefile.tmpl Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/Makefile.tmpl Sun Jun 1 18:04:27 2003 @@ -0,0 +1,111 @@ +## +## Makefile.tmpl -- Makefile template for mod_perl (Apache-side) +## Written by Ralf S. Engelschall +## +## This is a hybrid Makefile template: It can is used both +## inside the Apache source tree as the skeleton for the +## src/modules/perl/Makefile which is created by Apache's +## src/Configure script and out-side of the Apache source tree +## for building via APXS. Here it is the skeketon for the +## Makefile created by the local configure script. +## + +# Reassemble mod_perl parameters +# from Perl and Apache parameters +MP_CC=$(PERL_CC) +MP_CFLAGS=$(PERL_OPTIMIZE) -I$(PERL_INC) $(PERL_CCFLAGS) \ + $(PERL_DEFS) $(INCLUDES) $(AP_CFLAGS) $(CFLAGS) +MP_CFLAGS_SHLIB=$(PERL_CCCDLFLAGS) $(MP_CFLAGS) +MP_LD=$(PERL_LD) +MP_LDFLAGS_SHLIB=$(PERL_LDDLFLAGS) +MP_LIBS=$(PERL_LIBS) +MP_XSUBPP=$(PERL_XSUBPP) +MP_XSINIT=$(PERL_XSINIT) +MP_RM=rm -f +MP_AR=$(PERL_AR) +MP_RANLIB=$(PERL_RANLIB) +MP_STATIC_EXTS=$(PERL_STATIC_EXTS) +MP_STATIC_AR=$(PERL_STATIC_AR) +MP_STATIC_SRCS=$(PERL_STATIC_SRCS) +MP_STATIC_OBJS=$(PERL_STATIC_OBJS) +MP_STATIC_OBJS_PIC=$(PERL_STATIC_OBJS_PIC) +MP_LIBS=$(PERL_LIBS) +MP_DISTCLEAN_FILES=Makefile $(ADD_DISTCLEAN_FILES) + +## +## ____ DO NOT CHANGE ANYTHING BELOW THIS LINE ______________________ +## + +# the library to build +MP_LIB=libperl.$(LIBEXT) + +# the objects to use +MP_OBJS=\ + mod_perl.o perlxsi.o perl_config.o perl_util.o perlio.o mod_perl_opmask.o \ + $(MP_STATIC_OBJS) +MP_OBJS_PIC=\ + mod_perl.lo perlxsi.lo perl_config.lo perl_util.lo perlio.lo mod_perl_opmask.lo \ + $(MP_STATIC_OBJS_PIC) + +all: lib + +lib: $(MP_LIB) + +libperl.a: $(MP_OBJS) + $(MP_RM) $@ + $(MP_AR) crv $@ $(MP_OBJS) + $(MP_RANLIB) $@ + +libperl.so: $(MP_OBJS_PIC) + $(MP_RM) $@ + $(MP_LD) $(MP_LDFLAGS_SHLIB) -o $@ $(MP_OBJS_PIC) $(MP_LIBS) + +.SUFFIXES: .xs .c .o .lo + +.c.lo: + $(MP_CC) $(MP_CFLAGS_SHLIB) -c $< && mv $*.o $*.lo + +.c.o: + $(MP_CC) $(MP_CFLAGS) -c $< + +.xs.c: + $(MP_XSUBPP) $*.xs >$@ + +.xs.o: + $(MP_XSUBPP) $*.xs >$*.c + $(MP_CC) $(MP_CFLAGS) -c $*.c + +.xs.lo: + $(MP_XSUBPP) $*.xs >$*.c + $(MP_CC) $(MP_CFLAGS_SHLIB) -c $*.c && mv $*.o $*.lo + +perlxsi.c: + $(MP_XSINIT) -- -o perlxsi.c -std $(MP_STATIC_EXTS) + +clean: + $(MP_RM) $(MP_LIB) + $(MP_RM) $(MP_OBJS) + $(MP_RM) $(MP_OBJS_PIC) + $(MP_RM) $(MP_STATIC_SRCS) + $(MP_RM) perlxsi.c + +distclean: clean + $(MP_RM) $(MP_DISTCLEAN_FILES) + +# FOR STAND-ALONE BUILDING ONLY +install: + $(APXS) -i -a -n perl libperl.so + +depend: + cp Makefile.tmpl Makefile.tmpl.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ + && gcc -MM $(INCLUDES) $(AP_CFLAGS) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.tmpl \ + && rm Makefile.new + +# Dependencies +$(MP_OBJS) $(MP_OBJS_PIC): Makefile + +# DO NOT REMOVE diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/README ./usr.sbin/httpd/mod_perl/apaci/README --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/README Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/README Sun Jun 1 18:04:27 2003 @@ -0,0 +1,111 @@ + + Description + ----------- + + This is the Apache-side of mod_perl. It is a hybrid build environment which + can be both used to build mod_perl inside the Apache source tree via APACI + or plain Configure script and outside the Apache source tree via the DSO + tool APXS. + + Files + ----- + + README .............. this file + Makefile.tmpl ....... Makefile template for Apache 1.3 + Makefile.libdir ..... indicator file for Apache 1.3 to use Makefile.tmpl + configure ........... stand-alone configure script for APXS situation + libperl.module ...... sourced Configure inline-script for standard situation + mod_perl.config ..... the new mod_perl configuration file + mod_perl.config.sh .. the workhorse which parses the config files and + generates Makefile parameters out of it by + extending the given parameters with Perl information + + Usage + ----- + + [See file ../INSTALL.apaci for detailed description] + + o Build mod_perl statically with httpd + _inside_ the Apache source tree via APACI: + + 1. run perl Makefile.PL USE_APACI=1 + (this will: + - copy apaci/* and src/modules/perl/* to $APACHE_SRC/modules/perl + - generate $APACHE_SRC/modules/perl/mod_perl.config + ) + 2. Configure Apache while activating mod_perl + $ cd $APACHE_SRC + $ ./configure --activate-module=src/modules/perl/libperl.a + 3. Build and Install Apache with mod_perl + $ make + $ make install + + o Build mod_perl as a dynamic shared object (DSO) + _inside_ the Apache source tree via APACI: + + 1. Move these mod_perl sources to $APACHE_SRC/src/modules/perl/ + 2. Configure Apache while activating mod_perl + $ cd $APACHE_SRC + $ ./configure --activate-module=src/modules/perl/libperl.a \ + --enable-shared=perl + 3. Build and Install Apache with mod_perl + $ make + $ make install + + o Build mod_perl as a dynamic shared object (DSO) + _outside_ the Apache source tree via APXS: + + 1. Configure mod_perl via APXS + $ ./configure [--with-apxs=/path/to/installed/apache/sbin/apxs] + 2. Build mod_perl DSO and install it into Apache installation + $ make install + + Configuration + ------------- + + The configuration of mod_perl takes place via the file mod_perl.config. + Either edit this file, accept the defaults or override it via either + + $ MODPERL_CONFIG='PERL=/path/to/my/preferred/bin/perl, PERL_SSI=yes' + $ export MODPERL_CONFIG + $ ./configure ... + + at the APACI configuration step or via + + $ ./configure ... 'PERL=/path/to/my/preferred/bin/perl, PERL_SSI=yes' + + at the local configuration step when using the APXS variant. + + Implemenation + ------------- + + Here is a flow control of the configuration: + + APACI variant: APXS variant: + + $ MODPERL_CONFIG=... $ ./configure ... + $ cd $APACHE_SRC | + ./configure ... | + | mod_perl.config | + |exec | |exec + | |read | + V exec V | + libperl.module ------> mod_perl.config.sh <------------+ + | + | + V + (Makefile parameters) + | + + + Makefile.tmpl + | + | + V + Makefile + + Actually the merging of the Makefile parameters and the Makefile.tmpl is a + little bit more complex: When using APACI the parameters are first stored in + Apache's Makefile.config and then get merged with Makefile.tmpl by Apache's + Configure in a later step while when using the APXS variants they are + immediately stored in Makefile by our configure script together with + Makefile.tmpl. diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/apxs_cflags ./usr.sbin/httpd/mod_perl/apaci/apxs_cflags --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/apxs_cflags Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/apxs_cflags Sun Jun 1 18:04:27 2003 @@ -0,0 +1,7 @@ +#!/usr/bin/perl +use lib qw(./lib ../lib); +use Apache::src (); + +local $Apache::src::APXS = shift; + +print Apache::src::apxs_cflags(); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/apxs_cflags.PL ./usr.sbin/httpd/mod_perl/apaci/apxs_cflags.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/apxs_cflags.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/apxs_cflags.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,6 @@ +use lib qw(./lib ../lib); +use Apache::src (); + +local $Apache::src::APXS = shift; + +print Apache::src::apxs_cflags(); diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/configure ./usr.sbin/httpd/mod_perl/apaci/configure --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/configure Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/configure Sun Jun 1 18:04:27 2003 @@ -0,0 +1,117 @@ +#!/bin/sh +## +## configure -- mod_perl stand-alone configuration script +## Written by Ralf S. Engelschall +## +## This script is executed manually (usually by the end user +## or mod_perl's Makefile.PL) while building mod_perl +## off-source via APXS. +## + +DIFS=' +' + +# configuration +my_prefix=" +" +my_buildtype="DSO" +my_config="./mod_perl.config" +my_config_sh="./mod_perl.config.sh" +my_config_override="$*" +my_makefileconf="Makefile" +my_makefiletmpl="Makefile.tmpl" +my_sourcedir="../src/modules/perl" +my_sourcefiles="`./find_source`" +my_typemapdir="../Apache" + +# find APXS +my_apxs="" +OIFS=$IFS IFS=':' +for my_dir in $PATH; do + if test -f "$my_dir/apxs"; then + if test -x "$my_dir/apxs"; then + my_apxs="$my_dir/apxs" + break 2 + fi + fi +done +IFS="$OIFS" +my_apxs="`echo $my_apxs | sed -e 's://:/:'`" + +# +# parse argument line +# +prev='' +OIFS="$IFS" IFS="$DIFS" +for option +do + if [ ".$prev" != . ]; then + eval "$prev=\$option" + prev="" + continue + fi + case "$option" in + -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg='' ;; + esac + case "$option" in + --with-apxs=*) my_apxs="$optarg" ;; + --with-perl=*) my_config_override="$my_config_override, PERL=$optarg" ;; + * ) echo "$0:Error: invalid option '$option'" 1>&2; exit 1 ;; + esac +done +IFS="$OIFS" +if [ ".$prev" != . ]; then + echo "$0:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2 + exit 1 +fi + +# APXS information +if [ ".$my_apxs" = . ]; then + echo "$0:Error: no 'apxs' program found, please provide it's path via --with-apxs" 1>&2 + exit 1 +fi +my_apxs_sourcedir="`$my_apxs -q PREFIX`" +my_apxs_cflags="`./apxs_cflags $my_apxs`" +my_apxs_includes="-I`$my_apxs -q INCLUDEDIR`" +my_apxs_libexec="`$my_apxs -q LIBEXECDIR`" + +# friendly header +echo "Configuring mod_perl for building via APXS" 2>&1 + +# fetch the source files +echo "$my_prefix Creating a local mod_perl source tree" +for my_file in $my_sourcefiles; do + cp -f $my_sourcedir/$my_file . +done +cp -f $my_typemapdir/typemap . + +# begin generation of Makefile +echo "##" >$my_makefileconf +echo "## Makefile -- mod_perl stand-alone build environment Makefile" >>$my_makefileconf +echo "##" >>$my_makefileconf +echo "" >>$my_makefileconf +echo "# provide some stuff Apache usually provides" >>$my_makefileconf +echo "AP_CFLAGS=-DMOD_PERL $my_apxs_cflags" >>$my_makefileconf +echo "INCLUDES=$my_apxs_includes" >>$my_makefileconf +echo "RANLIB=ranlib" >>$my_makefileconf +echo "LIBEXT=so" >>$my_makefileconf +echo "APACHEEXT=$my_apxs_sourcedir/src" >>$my_makefileconf +echo "APACHELIBEXEC=$my_apxs_libexec" >>$my_makefileconf +echo "BASEEXT=mod_perl" >>$my_makefileconf +echo "APXS=$my_apxs" >>$my_makefileconf +echo "# own special stuff" >>$my_makefileconf +echo "ADD_DISTCLEAN_FILES=$my_sourcefiles typemap" >>$my_makefileconf + +# transform mod_perl config into Makefile parameters +echo "$my_prefix Setting up mod_perl build environment (Makefile)" +sh $my_config_sh --config-file=$my_config \ + --config-override="$my_config_override" \ + --build-type=$my_buildtype \ + --display-prefix="$my_prefix" >>$my_makefileconf + +# finish generation of Makefile +cat $my_makefiletmpl >>$my_makefileconf + +# friendly footer +echo "Now please type 'make' to build libperl.so" 2>&1 + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/find_source ./usr.sbin/httpd/mod_perl/apaci/find_source --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/find_source Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/find_source Sun Jun 1 18:04:27 2003 @@ -0,0 +1,12 @@ +#!/usr/bin/perl +chdir ".." unless -e 'MANIFEST'; +local(*MANI); +open MANI, "MANIFEST" or die "open MANIFEST $!"; + +while() { + next unless s,^src/modules/perl/,,; chomp; + next unless m,.+\.(xs|c|h)$,; + print "$_ "; +} +close MANI; + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/find_source.PL ./usr.sbin/httpd/mod_perl/apaci/find_source.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/find_source.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/find_source.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,11 @@ +chdir ".." unless -e 'MANIFEST'; +local(*MANI); +open MANI, "MANIFEST" or die "open MANIFEST $!"; + +while() { + next unless s,^src/modules/perl/,,; chomp; + next unless m,.+\.(xs|c|h)$,; + print "$_ "; +} +close MANI; + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/libperl.module ./usr.sbin/httpd/mod_perl/apaci/libperl.module --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/libperl.module Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/libperl.module Sun Jun 1 18:04:27 2003 @@ -0,0 +1,76 @@ +## +## libperl.module -- mod_perl Apache source tree stub +## Written by Ralf S. Engelschall +## +## This script is _sourced_ by Apache's src/Configure script +## while configuring the module subdirectories. We can use +## two variables here to find ourself: $modfile, $modbase. +## Additionally because we run inside src/Configure's namespace +## we can directly adjust CFLAGS, LIBS, etc. +## + +Name: perl_module +ConfigStart + + # paths + my_dir="`echo ${modfile} | sed -e 's:/[^/]*$::'`" + my_config="${my_dir}/mod_perl.config" + my_config_sh="${my_dir}/mod_perl.config.sh" + my_outfile="Makefile.config" + my_prefix=" +" + + # determine requested build-type + case $modfile in + *.so ) + my_buildtype="DSO" + ;; + *.a ) + my_buildtype="OBJ" + ;; + esac + echo "$my_prefix mod_perl build type: $my_buildtype" + + # import MODPERL_CONFIG environment variable + my_config_override='' + if [ ".$MODPERL_CONFIG" != . ]; then + my_config_override="$MODPERL_CONFIG" + fi + + # transform mod_perl config into Makefile config + echo "$my_prefix setting up mod_perl build environment" + sh $my_config_sh --config-file=$my_config \ + --config-override="$my_config_override" \ + --build-type=$my_buildtype \ + --display-prefix="$my_prefix" >>$my_outfile + + # additionally adjust the Apache build environment + echo "$my_prefix adjusting Apache build environment" + CFLAGS="$CFLAGS -DMOD_PERL" + if [ ".$my_buildtype" = .OBJ ]; then + my_perl_libs="`egrep '^PERL_LIBS=' $my_outfile | tail -1 | cut -d= -f2-`" + LIBS="$LIBS $my_perl_libs" + fi + + # Perl support for SSI (mod_include) + if [ ".`egrep '^PERL_SSI[ ]*=[ ]*yes' $my_outfile`" != . ]; then + if [ ".$my_buildtype" = .DSO ]; then + echo "" + echo "** Error: Cannot build mod_include with Perl support (USE_PERL_SSI) **" + echo "** when mod_perl is compiled as DSO because of cross-module calls. **" + echo "** Ignoring PERL_SSI flag now. **" + echo "" + else + echo "$my_prefix enabling Perl support for SSI (mod_include)" + my_perl_ccflags="`egrep '^PERL_CCFLAGS=' $my_outfile | tail -1 | cut -d= -f2-`" + CFLAGS="$CFLAGS -DUSE_PERL_SSI $my_perl_ccflags" + my_perl_inc="`egrep '^PERL_INC=' $my_outfile | tail -1 | cut -d= -f2-`" + INCLUDES="$INCLUDES -I\$(SRCDIR) -I$my_perl_inc" + if [ ".`egrep '^PERL_THREADS[ ]*=[ ]*yes' $my_config`" != . ]; then + echo "$my_prefix enabling Perl Thread support" + CFLAGS="$CFLAGS -DPERL_THREADS" + fi + fi + fi + +ConfigEnd + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/load_modules.pl ./usr.sbin/httpd/mod_perl/apaci/load_modules.pl --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/load_modules.pl Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/load_modules.pl Sun Jun 1 18:04:27 2003 @@ -0,0 +1,58 @@ +#!/usr/bin/perl +#! /usr/local/bin/perl +use File::Find; +use strict; +my $APACHE_SRC = shift; + +my $LoadModule_conf = "t/conf/LoadModule.conf"; +my $tmp = "t/conf/httpd.conf.new"; +my $orig = "t/conf/httpd.conf"; + +local *ORIG; +open ORIG, $orig or die "can't open $orig $!"; +while() { + if(/^LoadModule/) { + exit 0; #already cat-ed + } +} +unless (-d "t") { + chdir ".."; +} +#phooey, this mess should have been cleaned up before 1.3.0 +my $name_map = { + log_config => "config_log", + include => "includes", + actions => "action", + auth_anon => "anon_auth", + auth_dbm => "dbm_auth", + log_agent => "agent_log", + log_referer => "referer_log" +}; + +my @sh_mods = (); +finddepth(sub { + return unless /(mod_|lib)(.*)\.s[ol]$/; + my $name = $name_map->{$2} || $2; + my $full = "$File::Find::dir/$_"; + if($full !~ m,^/,) { + if($full =~ m,^\.\./,) { + $full = "../$full"; + } + } + return if $name =~ /(auth|autoindex|digest)/; #a few that screw make test + push @sh_mods, "LoadModule ${name}_module $full"; +}, $APACHE_SRC) if $APACHE_SRC and -d $APACHE_SRC; + +my($perl_mod) = grep /perl/, @sh_mods; +unshift @sh_mods, $perl_mod; #must come before mod_include/USE_PERL_SSI + +my %seen; + +local *FH; +open FH, ">$LoadModule_conf" or + die "can't open $LoadModule_conf $!"; +print FH join "\n", (grep { !$seen{$_}++ } @sh_mods), ""; +close FH; + +system "cat $LoadModule_conf $orig > $tmp && mv $tmp $orig"; + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/load_modules.pl.PL ./usr.sbin/httpd/mod_perl/apaci/load_modules.pl.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/load_modules.pl.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/load_modules.pl.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,57 @@ +#! /usr/local/bin/perl +use File::Find; +use strict; +my $APACHE_SRC = shift; + +my $LoadModule_conf = "t/conf/LoadModule.conf"; +my $tmp = "t/conf/httpd.conf.new"; +my $orig = "t/conf/httpd.conf"; + +local *ORIG; +open ORIG, $orig or die "can't open $orig $!"; +while() { + if(/^LoadModule/) { + exit 0; #already cat-ed + } +} +unless (-d "t") { + chdir ".."; +} +#phooey, this mess should have been cleaned up before 1.3.0 +my $name_map = { + log_config => "config_log", + include => "includes", + actions => "action", + auth_anon => "anon_auth", + auth_dbm => "dbm_auth", + log_agent => "agent_log", + log_referer => "referer_log" +}; + +my @sh_mods = (); +finddepth(sub { + return unless /(mod_|lib)(.*)\.s[ol]$/; + my $name = $name_map->{$2} || $2; + my $full = "$File::Find::dir/$_"; + if($full !~ m,^/,) { + if($full =~ m,^\.\./,) { + $full = "../$full"; + } + } + return if $name =~ /(auth|autoindex|digest)/; #a few that screw make test + push @sh_mods, "LoadModule ${name}_module $full"; +}, $APACHE_SRC) if $APACHE_SRC and -d $APACHE_SRC; + +my($perl_mod) = grep /perl/, @sh_mods; +unshift @sh_mods, $perl_mod; #must come before mod_include/USE_PERL_SSI + +my %seen; + +local *FH; +open FH, ">$LoadModule_conf" or + die "can't open $LoadModule_conf $!"; +print FH join "\n", (grep { !$seen{$_}++ } @sh_mods), ""; +close FH; + +system "cat $LoadModule_conf $orig > $tmp && mv $tmp $orig"; + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/mod_perl.config.sh ./usr.sbin/httpd/mod_perl/apaci/mod_perl.config.sh --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/mod_perl.config.sh Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/mod_perl.config.sh Sun Jun 1 18:04:27 2003 @@ -0,0 +1,245 @@ +## +## mod_perl.config.sh -- mod_perl configuration transformation script +## Written by Ralf S. Engelschall +## + +DIFS=' +' + +# defaults +config_file='mod_perl.config' +build_type='OBJ' +display_prefix='' +tmpfile1=".tmp.$$.1" +tmpfile2=".tmp.$$.2" + +# +# parse argument line +# +prev='' +OIFS="$IFS" IFS="$DIFS" +for option +do + if [ ".$prev" != . ]; then + eval "$prev=\$option" + prev="" + continue + fi + case "$option" in + -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg='' ;; + esac + case "$option" in + --config-file=*) config_file="$optarg" ;; + --config-override=*) config_override="$optarg" ;; + --build-type=*) build_type="$optarg" ;; + --display-prefix=*) display_prefix="$optarg" ;; + * ) echo "$0:Error: invalid option '$option'" 1>&2; exit 1 ;; + esac +done +IFS="$OIFS" +if [ ".$prev" != . ]; then + echo "$0:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2 + exit 1 +fi + + +# +# import parameters from config file into +# own namespace to avoid conflicts with src/Configure +# +(cat $config_file; echo "$config_override" | sed -e 's:,[ ]*:,:' | tr "," "\n") >$tmpfile1 +vars="`egrep '^[A-Z0-9_]*[ ]*=' $tmpfile1 | sed -e 's:^\([A-Z0-9_]*\).*:\1:'`" +OIFS="$IFS" IFS="$DIFS" +for var in $vars; do + egrep "^${var}[ ]*=" $tmpfile1 | tail -1 >$tmpfile2 + val="`sed -e 's:^[A-Z0-9_]*[ ]*=[ ]*::' <$tmpfile2`" + eval "param_${var}=\"${val}\"" +done +IFS="$OIFS" + +# +# verbose message +# +echo "$display_prefix id: mod_perl/$param_MOD_PERL_VERSION" 1>&2 + +# +# determine Perl interpreter and version +# +libperl="$param_LIBPERL" +if [ ".$libperl" = .DEFAULT ]; then + perl_libperl="" +else + perl_libperl=" -- $libperl" +fi +perl_interp="$param_PERL" +if [ ".$perl_interp" = .DEFAULT ]; then + if [ ".$PERL" != . ]; then + perl_interp="$PERL" + else + perl_interp="" + fi +fi +if [ ".$perl_interp" = . ]; then + OIFS=$IFS IFS=':' + for my_dir in $PATH; do + for my_exe in perl5 perl; do + if test -f "$my_dir/$my_exe"; then + if test -x "$my_dir/$my_exe"; then + perl_interp="$my_dir/$my_exe" + break 2 + fi + fi + done + done + IFS="$OIFS" + perl_interp="`echo $perl_interp | sed -e 's://:/:'`" +fi +perl_version="`$perl_interp -e '$^V ? printf("v%vd", $^V) : print($]);'`" +os_version="`$perl_interp -e 'print $^O;'`" + +# +# verbose message +# +echo "$display_prefix id: Perl/$perl_version ($os_version) [$perl_interp]" 1>&2 + +# +# determine build tools and flags +# + +if test -f './modules/perl/perl_config'; then + perl_config='./modules/perl/perl_config' +else + perl_config='./perl_config' +fi + +perl_cc="`$perl_config 'cc'`" +perl_ccflags="`$perl_config 'ccflags'`" +perl_optimize="`$perl_config 'optimize'`" +perl_cccdlflags="`$perl_config 'cccdlflags'`" +perl_ld="`$perl_config 'ld'`" +perl_ldflags="`$perl_config 'ldflags'`" +perl_lddlflags="`$perl_config 'lddlflags'`" + +case "$os_version" in + aix*) + case "$perl_cc" in + *gcc*) + XLINKER="-Xlinker " + ;; + esac + perl_lddlflags="$perl_lddlflags $XLINKER-bI:\$(APACHELIBEXEC)/httpd.exp" + ;; + * ) ;; +esac + +cat >$tmpfile2 <<'EOT' +use Config; +#my $embed_pm = '-MApache::ExtUtils=ldopts'; +my $embed_pm = '-MExtUtils::Embed'; +my $ldopts = `$^X $embed_pm -e ldopts -- -std @ARGV`; +# can't pass ccdlflags to ld, which is what happens in this context. however +# we still need the libraries themselves. I think this should be correct for +# other systems, but it bites us on BSD/OS 4.x +$ldopts =~ s@$Config{ccdlflags}@@ if ($^O eq 'bsdos'); +$ldopts =~ s,(-bE:)(perl\.exp),$1$Config{archlibexp}/CORE/$2, if($^O eq "aix"); + +#replace -Wl args meant for cc with args for ld +if ($ARGV[0] eq "DSO" and $^O eq "hpux" and $Config{ld} =~ /ld$/) { + while ($ldopts =~ s/-Wl,(\S+)/$1/) { + my $cp = $1; + (my $repl = $cp) =~ s/,/ /g; + $ldopts =~ s/\Q$cp/$repl/; + } +} + +print $ldopts; +EOT +perl_libs="`$perl_interp $tmpfile2 $build_type`" +if test $build_type = OBJ +then + case "$os_version" in + aix*) perl_libs="$perl_libs $XLINKER-bE:\$(SRCDIR)/modules/perl/mod_perl.exp" ;; + * ) ;; + esac +fi +perl_inc="`$perl_interp -MConfig -e 'print "$Config{archlibexp}/CORE"'`" +perl_privlibexp="`$perl_interp -MConfig -e 'print $Config{privlibexp}'`" +perl_archlibexp="`$perl_interp -MConfig -e 'print $Config{archlibexp}'`" +perl_xsinit="$perl_interp -MExtUtils::Embed -e xsinit" +perl_xsubpp="$perl_interp ${perl_privlibexp}/ExtUtils/xsubpp -nolinenumbers -typemap ${perl_privlibexp}/ExtUtils/typemap" +perl_ar="`$perl_interp -MConfig -e 'print $Config{ar}'`" +perl_ranlib=`$perl_interp -MConfig -e 'print $Config{ranlib}'` + +# +# determine static objects +# +perl_static_exts="$param_PERL_STATIC_EXTS" +perl_static_ar="$param_PERL_STATIC_AR" +perl_static_srcs="$param_PERL_STATIC_SRCS" +perl_static_objs="`echo $param_PERL_STATIC_SRCS | sed -e 's:\.c:.o:g'`" +perl_static_objs_pic="`echo $param_PERL_STATIC_SRCS | sed -e 's:\.c:.lo:g'`" + +# +# determine defines +# +perl_defs='' +perl_defs="$perl_defs -DMOD_PERL_VERSION=\\\"$param_MOD_PERL_VERSION\\\"" +perl_defs="$perl_defs -DMOD_PERL_STRING_VERSION=\\\"mod_perl/$param_MOD_PERL_VERSION\\\"" + +if [ ".$param_MOD_PERL_PREFIX" != . ]; then + perl_defs="$perl_defs -DMOD_PERL_PREFIX=\\\"$param_MOD_PERL_PREFIX\\\"" +fi + +perl_defs="$perl_defs" +OIFS="$IFS" IFS="$DIFS" +for hook in \ + DISPATCH CHILD_INIT CHILD_EXIT POST_READ_REQUEST TRANS HEADER_PARSER \ + ACCESS AUTHEN AUTHZ TYPE FIXUP HANDLER LOG INIT CLEANUP STACKED_HANDLERS \ + METHOD_HANDLERS DIRECTIVE_HANDLERS SECTIONS RESTART SSI TRACE THREADS; do + eval "val=\$param_PERL_${hook}" + case $hook in + TRACE|THREADS ) + if [ ".$val" = .yes ]; then + perl_defs="$perl_defs -DPERL_${hook}=1" + fi + ;; + * ) + if [ ".$val" = .no ]; then + perl_defs="$perl_defs -DNO_PERL_${hook}=1" + fi + ;; + esac +done +IFS="$OIFS" + +# +# output information as Makefile parameters +# +echo "PERL=$perl_interp" +echo "PERL_CC=$perl_cc" +echo "PERL_OPTIMIZE=$perl_optimize" +echo "PERL_CCFLAGS=$perl_ccflags" +echo "PERL_CCCDLFLAGS=$perl_cccdlflags" +echo "PERL_DEFS=$perl_defs" +echo "PERL_INC=$perl_inc" +echo "PERL_LD=$perl_ld" +echo "PERL_LDFLAGS=$perl_ldflags" +echo "PERL_LDDLFLAGS=$perl_lddlflags" +echo "PERL_LIBS=$perl_libs $perl_static_ar" +echo "PERL_XSINIT=$perl_xsinit" +echo "PERL_XSUBPP=$perl_xsubpp" +echo "PERL_AR=$perl_ar" +echo "PERL_RANLIB=$perl_ranlib" +echo "PERL_STATIC_EXTS=$perl_static_exts" +echo "PERL_STATIC_AR=$perl_static_ar" +echo "PERL_STATIC_SRCS=$perl_static_srcs" +echo "PERL_STATIC_OBJS=$perl_static_objs" +echo "PERL_STATIC_OBJS_PIC=$perl_static_objs_pic" +echo "PERL_SSI=$param_PERL_SSI" + +# +# cleanup +# +rm -f $tmpfile1 $tmpfile2 + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/mod_perl.exp ./usr.sbin/httpd/mod_perl/apaci/mod_perl.exp --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/mod_perl.exp Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/mod_perl.exp Sun Jun 1 18:04:27 2003 @@ -0,0 +1,17 @@ +#! +perl_module +mod_perl_sent_header +sv2request_rec +perl_request_rec +mod_perl_tie_table +perl_cmd_perl_FLAG +perl_cmd_perl_TAKE2 +perl_cmd_perl_TAKE1 +perl_cmd_perl_TAKE123 +perl_perl_cmd_cleanup +hvrv2table +perl_call_handler +perl_clear_symtab +perl_get_startup_pool +perl_perl_merge_dir_config +array_header2avrv diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/perl_config ./usr.sbin/httpd/mod_perl/apaci/perl_config --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/perl_config Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/perl_config Sun Jun 1 18:04:27 2003 @@ -0,0 +1,11 @@ +#!/usr/bin/perl +use lib qw(/usr/obj/usr.sbin/httpd/mod_perl/lib); +#we generate this script simply to set @INC +#so Apache::ExtUtils can be found + +use Apache::ExtUtils qw(%Config); +use strict; + +my $key = shift; + +print $Config{$key}; diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/perl_config.PL ./usr.sbin/httpd/mod_perl/apaci/perl_config.PL --- ../src.danvfs/usr.sbin/httpd/mod_perl/apaci/perl_config.PL Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/apaci/perl_config.PL Sun Jun 1 18:04:27 2003 @@ -0,0 +1,9 @@ +#we generate this script simply to set @INC +#so Apache::ExtUtils can be found + +use Apache::ExtUtils qw(%Config); +use strict; + +my $key = shift; + +print $Config{$key}; diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/benchmark/lwp-simple.pod ./usr.sbin/httpd/mod_perl/benchmark/lwp-simple.pod --- ../src.danvfs/usr.sbin/httpd/mod_perl/benchmark/lwp-simple.pod Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/benchmark/lwp-simple.pod Sun Jun 1 18:04:27 2003 @@ -0,0 +1,46 @@ +=head1 NAME + +lwp-simple - using LWP::Simple and Benchmark.pm to benchmark mod_perl + +=head1 DESCRIPTION + +Here's what I generally use to benchmark, a Benchmark.pm/LWP::Simple +combo. With the script below, you should be able to +'make start_httpd' in the mod_perl-x.xx/ build directory +you might need to change the #! line in t/net/perl/cgi.pl +the configuration is already set up for /perl/ and /cgi-bin/ + +cgi.pl is very small, just load CGI.pm and prints a little bit, here's +the difference I see (on hpux-10.10): + +Benchmark: timing 50 iterations of cgi, perl... + cgi: 18 secs ( 0.96 usr 0.10 sys = 1.06 cpu) + perl: 3 secs ( 0.76 usr 0.07 sys = 0.83 cpu) + +=head1 THE SCRIPT + +=cut + + #!/opt/perl/bin/perl + + use Benchmark; + use LWP::Simple; + + $base = "http://localhost:8529"; + $script = "cgi.pl?PARAM=2"; + + for (qw(cgi-bin perl)) { + $$_ = join "/", $base, $_, $script; + } + + timethese(50, { + "cgi" => "(\$s = get('${'cgi-bin'}')) or die \$s", + "perl" => "(\$s = get('$perl')) or die \$s", + }); + +=pod + +=head1 AUTHOR + +Doug MacEachern + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/benchmark/stopwatch.pod ./usr.sbin/httpd/mod_perl/benchmark/stopwatch.pod --- ../src.danvfs/usr.sbin/httpd/mod_perl/benchmark/stopwatch.pod Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/benchmark/stopwatch.pod Sun Jun 1 18:04:27 2003 @@ -0,0 +1,66 @@ +=head1 NAME + +stopwatch - benchmark mod_perl vs. CGI with File::CounterFile + +=head1 DESCRIPTION + +I have a stopwatch here. It consists of a CGI program that must be +installed so that it can be accessed both as Apache::Registry routine +and as CGI program. The program assumes that the environment variable +SCRIPT_FILENAME is set and writes different counterfiles for the two +access methods. On the client side I use LWP. Here's the CGI program: + + #!/usr/bin/perl + + use CGI::Switch; + use File::CounterFile; # part of LWP + my $q = new CGI::Switch; + $q->print( + $q->header, + $q->start_html(), + $q->start_form(), + $q->textfield(-name => "textfield"), + $q->submit(), + $q->end_form, + "

textfield = ", $q->param("textfield"), + ); + + my $cfile = + $ENV{SCRIPT_FILENAME} =~ m{/perl/} ? "C-apache" : "C-cgi"; + + my $c = File::CounterFile->new($cfile,"00000000"); + my $id = $c->inc; + + $q->print( + "

", scalar(localtime()),"

\n", + sprintf("Accessed %d times (%d)\n",$id,$$), + $q->end_html, + ); + + +And here is how I access it: + + perl -MLWP::UserAgent -MURI::URL -e ' + $ua = new LWP::UserAgent; + $curl = url("http:"); + $curl->query_form(textfield => 12345); + $req = new HTTP::Request "POST", "http://localhost/perl/forbench"; + # ^^^^^^^^^^^^^ + # change that + $req->content_type("application/x-www-form-urlencoded"); + $req->content($curl->equery); + printf "%s\n", $1 + while $ua->request($req)->as_string =~ /(Ac.*)/m; + ' + +I have this program run in one window for /perl/forbench and in +another window for /cgi-bin/forbench. While I'm typing this, the two +counters have reached the numbers 5215 and 141. A speed advantage of +37:1 on my Linux box. When I try this on my Indy I get a relation of +20:1. The advantage seems to be system dependent. + +=head1 AUTHOR + +Andreas J. Koenig + + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/cgi_to_mod_perl.pod ./usr.sbin/httpd/mod_perl/cgi_to_mod_perl.pod --- ../src.danvfs/usr.sbin/httpd/mod_perl/cgi_to_mod_perl.pod Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/cgi_to_mod_perl.pod Sun Jun 1 18:04:27 2003 @@ -0,0 +1,120 @@ +=head1 NAME + +cgi_to_mod_perl - First steps needed to use mod_perl as a CGI replacement + +=head1 DESCRIPTION + +As the README and other mod_perl documents explain, mod_perl as +a CGI replacement is only a small piece of what the package offers. +However, it is the most popular use of mod_perl, this document is here +so you can cut to the chase. + +=head1 INSTALLATION + +Read the INSTALL document, in most cases, nothing more is required +than: + + perl Makefile.PL && make && make install + +=head1 CONFIGURATION + +For using mod_perl as a CGI replacement, the recommended configuration +is as follows: + + Alias /perl/ /real/path/to/perl-scripts/ + + + SetHandler perl-script + PerlHandler Apache::Registry + Options +ExecCGI + + +`Location' refers to the uri, not a directory, think of the above as + + + +Any files under that location (which live on your filesystem under +/real/path/to/perl-scripts/), will be handled by the Apache::Registry +module, which emulates the CGI environment. The file must exist and +be executable, in addition, 'Options ExecCGI' must be turned on. + +If you wish to have mod_perl execute scripts in any location based on +file extension, use a configuration like so: + + + SetHandler perl-script + PerlHandler Apache::Registry + Options ExecCGI + + +Note that `ScriptAlias' does _not_ work for mod_perl. + +=head1 PORTING CGI SCRIPTS + +=over 4 + +=item I/O + +If you are using Perl 5.004 most CGI scripts can run under mod_perl +untouched. If you're using 5.003, Perl's built-in C and +C functions do not work as they do under CGI. If you're +using CGI.pm, use C<$query-Eprint> instead of plain 'ol C. + +=item HEADERS + +By default, mod_perl does not send any headers by itself, however, you +may wish to change this: + + PerlSendHeader On + +Now the response line and common headers will be sent as they are by +mod_cgi. And, just as with mod_cgi, PerlSendHeader will not send a +terminating newline, your script must send that itself, e.g.: + + print "Content-type: text/html\n\n"; + +If you're using CGI.pm and 'print $q-Eheader' you do +_not_ need C. + +=item NPH SCRIPTS + +To run a CGI `nph' script under mod_perl, simply add to your code: + + local $| = 1; + +If you normally set B, add this to your httpd.conf: + + + PerlSendHeader Off + + +=item PROGRAMMING PRACTICE + +CGI lets you get away with sloppy programming, mod_perl does not. +Why? CGI scripts have the lifetime of a single HTTP request as a +separate process. When the request is over, the process goes away and +everything is cleaned up for you, e.g. globals variables, open files, +etc. Scripts running under mod_perl have a longer lifetime, over +several request, different scripts may be in the same process. This +means you must clean up after yourself. You've heard: + + always 'use strict' and C<-w>!!! + +It's more important under mod_perl Perl than anywhere else, while it's +not required, it B recommended, it will save you more time +in the long run. And, of course, clean scripts will still run under +CGI! + +=item TRAPS + +See L. + +=back + +=head1 REPORTING PROBLEMS + +Read the L file. + +=head1 SEE ALSO + +Apache::PerlRun(3) diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/eg/README ./usr.sbin/httpd/mod_perl/eg/README --- ../src.danvfs/usr.sbin/httpd/mod_perl/eg/README Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/eg/README Sun Jun 1 18:04:27 2003 @@ -0,0 +1,21 @@ + +To get started please check out: + +The mod_perl guide, + http://perl.apache.org/ + +Writing Apache Modules with Perl and C + http://www.modperl.com/ + +the mod_perl developer's cookbook: + http://www.modperlcookbook.org/ + +The Apache:: modules on CPAN: + http://search.cpan.org/search?mode=module&query=Apache + +... and of course the mod_perl mailinglist: + mail modperl-subscribe@perl.apache.org < /dev/null + + + + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/eg/makepl_args.mod_perl ./usr.sbin/httpd/mod_perl/eg/makepl_args.mod_perl --- ../src.danvfs/usr.sbin/httpd/mod_perl/eg/makepl_args.mod_perl Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/eg/makepl_args.mod_perl Sun Jun 1 18:04:27 2003 @@ -0,0 +1,67 @@ +#example makepl_args.mod_perl files +#copy this file to $ENV{HOME}/.makepl_args.mod_perl and edit to taste + +#mod_perl's Makefile.PL will also look for this file in ./ ../ relative +#to the mod_perl-x.xx source tree + +#EVERYTHING=1 will enable: +#ALL_HOOKS=1 PERL_SSI=1 PERL_SECTIONS=1 PERL_STACKED_HANDLERS=1 +#PERL_METHOD_HANDLERS=1 PERL_TABLE_API=1 PERL_DIRECTIVE_HANDLERS=1 +#PERL_LOG_API=1 PERL_URI_API=1 PERL_UTIL_API=1 PERL_FILE_API=1 + +EVERYTHING=1 + +#build against the first apache_x.xx source tree found, without prompts +# DO_HTTPD=1 + +#tell Makefile.PL exactly where the Apache source tree is +# APACHE_SRC=/tmp/apache_x.xx/src + +#this would configure in mod_proxy, mod_unique_id, mod_info and mod_status +# ADD_MODULE=proxy,usertrack,unique_id,info,status + +#if you wish to use a Configuration file other than what's in the +#apache_x.xx/src directory +# CONFIG=Configuration.custom + +#depending on your os and site_perl modules, see mod_perl's INSTALL +# PERL_STATIC_EXTS=... + +#apache header files are installed by default, stop that if you wish +# APACHE_HEADER_INSTALL=0 + +#Apache and Apache::Constants modules will be built as shared libraries +# DYNAMIC=1 + +#turn on mod_perl tracing +# PERL_TRACE=1 + +#for perl.c's perl_destruct() which in run by mod_perl during child_exit +#comment from perl.c: /* 0=none, 1=full, 2=full with checks */ +#default level is 0 +# PERL_DESTRUCT_LEVEL=2 + + +#-add `-g' to EXTRA_CFLAGS +#-turn on PERL_TRACE +#-set PERL_DESTRUCT_LEVEL=2 +#-link against libperld if -e $Config{archlibexp}/CORE/libperld$Config{lib_ext} +# PERL_DEBUG=1 + +######################################################################### +#experimental features, use at own risk +#but please report success or failure if you try + +#try to stop "Use of uninitialized value." with no line/filename info +# PERL_MARK_WHERE=1 + +#have mod_perl handle internal redirects (doesn't seem to work w/ sfio) +#can also enable via $Apache::DoInternalRedirect = 1; +# DO_INTERNAL_REDIRECT=1 + +#enable the PerlRestartHandler which will be called during restart +#this happens just before PerlFreshRestart does it's thang +#PERL_RESTART_HANDLER=1 + +__END__ + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/faq/Makefile ./usr.sbin/httpd/mod_perl/faq/Makefile --- ../src.danvfs/usr.sbin/httpd/mod_perl/faq/Makefile Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/faq/Makefile Sun Jun 1 18:04:27 2003 @@ -0,0 +1,22 @@ +HTMLROOT = . +POD2HTML = pod2html --htmlroot=$(HTMLROOT) --podpath=. \ + --libpods=mod_perl_cgi:mod_perl_api + +POD = mod_perl_faq.pod mod_perl_cgi.pod mod_perl_api.pod +HTML = mod_perl_faq.html mod_perl_cgi.html mod_perl_api.html + +.SUFFIXES: .pod .html + +.pod.html: + rm -f $*.html + $(POD2HTML) --infile=$*.pod --outfile=$*.tmp + sed 's/ manpage<\/A>/ FAQ<\/A>/' $*.tmp >$*.html + rm $*.tmp + +html: $(HTML) + +tar: $(POD) + tar cf - $(POD) mjtg-news.txt Makefile | gzip -9 >mod_perl_faq.tar.gz + +clean: + rm -f $(HTML) pod2html-*cache diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/faq/mjtg-news.txt ./usr.sbin/httpd/mod_perl/faq/mjtg-news.txt --- ../src.danvfs/usr.sbin/httpd/mod_perl/faq/mjtg-news.txt Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/faq/mjtg-news.txt Sun Jun 1 18:04:27 2003 @@ -0,0 +1,106 @@ +From: mjtg@cus.cam.ac.uk (M.J.T. Guy) +Newsgroups: comp.lang.perl.misc +Subject: Re: Lexical scope and embedded subroutines. +Date: 6 Jan 1998 18:22:39 GMT +Organization: University of Cambridge, England +Lines: 95 +Message-ID: <68tspf$9f0$1@lyra.csx.cam.ac.uk> +References: <34B11E43.167E@gcg.com> <68sc4k$3p2$1@brokaw.wa.com> +NNTP-Posting-Host: taurus.cus.cam.ac.uk + +In article <68sc4k$3p2$1@brokaw.wa.com>, Aaron Harsh wrote: +> +>Before I read this thread (and perlsub to get the details) I would have +>assumed the original code was fine. +> +>This behavior brings up the following questions: +> o Is Perl's behavior some sort of speed optimization? + +No, but see below. + +> o Did the Perl gods just decide that scheme-like behavior was less +>important than the pseduo-static variables described in perlsub? + +This subject has been kicked about at some length on perl5-porters. +The current behaviour was chosen as the best of a bad job. +In the context of Perl, it's not obvious what "scheme-like behavior" +means. So it isn't an option. See below for details. + +> o Does anyone else find Perl's behavior counter-intuitive? + +*Everyone* finds it counterintuitive. The fact that it only generates +a warning rather than a hard error is part of the Perl Gods policy +of hurling thunderbolts at those so irreverent as not to use -w. + +> o Did programming in scheme destroy my ability to judge a decent language +>feature? + +You're still interested in Perl, so it can't have rotted your brain +completely. + +> o Have I misremembered how scheme handles these situations? + +Probably not. + +> o Do Perl programmers really care how much Perl acts like scheme? + +Some do. + +> o Should I have stopped this message two or three questions ago? + +Yes. + + + +The problem to be solved can be stated as + +"When a subroutine refers to a variable which is instantiated more than + once (i.e. the variable is declared in a for loop, or in a subroutine), + which instance of that variable should be used?" + +The basic problem is that Perl isn't Scheme (or Pascal or any of the +other comparators that have been used). + +In almost all lexically scoped languages (i.e. those in the Algol60 +tradition), named subroutines are also lexically scoped. So the scope +of the subroutine is necessarily contained in the scope of any external +variable referred to inside the subroutine. So there's an obvious +answer to the "which instance?" problem. + +But in Perl, named subroutines are globally scoped. (But in some +future Perl, you'll be able to write + + my sub lex { ... } + +to get lexical scoping.) So the solution adopted by other languages +can't be used. + +The next suggestion most people come up with is "Why not use the most +recently instantiated variable?". This Does The Right Thing in many +cases, but fails when recursion or other complications are involved. + +Consider + +sub outer { + + inner(); + outer(); + my $trouble; + inner(); + sub inner { $trouble }; + outer(); + inner(); +} + +Which instance of $trouble is to be used for each call of inner()? +And why? + +The consensus was that an incomplete solution was unacceptable, so +the simple rule "Use the first instance" was adopted instead. + +And it is more efficient than possible alternative rules. But that's not +why it was done. + + +Mike Guy + diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/faq/mod_perl_api.pod ./usr.sbin/httpd/mod_perl/faq/mod_perl_api.pod --- ../src.danvfs/usr.sbin/httpd/mod_perl/faq/mod_perl_api.pod Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/faq/mod_perl_api.pod Sun Jun 1 18:04:27 2003 @@ -0,0 +1,171 @@ +=head1 NAME + +Mod_perl_api - accessing the Apache API via mod_perl ($Date: 2003/06/01 22:04:27 $) + +=head1 DESCRIPTION + +This part of the mod_perl FAQ deals with the Apache Application +Programmer's Interface and how to access it from perl via mod_perl. + +=head1 Why can't the server find the handler I wrote? + +=head2 Did you enable the required hook? + +As described in the mod_perl/INSTALL document, the only callback hook +enabled by default is PerlHandler. If you want to intervene at a +different stage of request processing you must enable the relevant +hook. So to add a special authentication handler, for instance, you +would start the installation process with: + + perl Makefile.PL PERL_AUTHEN=1 + +=head2 Is the handler correctly referenced in the configuration? + +Apache must be told to load your handler, either as a module with the +C directive or as a script with C. The +handler subroutine will then be available, but you must also specify +which requests it should process. This is done by naming it in one of +the Perl*Handler directives (PerlInitHandler, PerlTransHandler, etc.). +If this directive is put in access.conf outside of any restrictive +context, your handler will be called during the given phase of each +request processed by the server. You can make it more selective by +restricting it to a directory (-hierarchy) in a +section of access.conf or by putting it in a .htaccess file. + +Here is an example of the directives needed to call a handler during +Apache's URI to filename translation phase: + + PerlRequire /full/path/to/script/Trans.pl + PerlTransHandler Trans::handler + +Trans.pl would start with the statement C and define a +subroutine called C. + +=head1 Where can I find examples to get me started? + +Check out the Apache-Perl-contrib tarfile at +http://perl.apache.org/src/ + +Here is an example from Vivek Khera. It allows you to filter files +through a perl script based on their location. Rather than having to +invoke a CGI script, the user just references the file with a normal +URL and it is automagically processed by this code... + + #! /usr/local/bin/perl + use strict; + + # filter a file before returning it to the web client + # tell Apache to use the PerlHandler FileFilter on file which need + # filtering in the htaccess file: + # + # + # SetHandler perl-script + # PerlHandler FileFilter + # + + package FileFilter; + + use Apache::Constants ':common'; + + # find out the file name, then write it out with our header attached + sub handler { + my $r = shift; + + my $fileName = $r->filename; + + open(F,$fileName) or return NOT_FOUND; # file not found + + $r->content_type('text/html'); + $r->no_cache(1); # don't be caching my dynamic documents! + + $r->send_http_header; + + $r->print("This is my personal header!"); + + # Now copy the file to the client. If you do not need to make any + # changes you can copy it verbatim with the single statement + # $r->send_fd(\*F); + # Otherwise, loop over each line... + while() { + # mangle the contents here if you want + $r->print ($_); + } + close(F); + + $r->print("
Document created: ", scalar localtime time); + $r->print(""); + + OK; + } + + 1; + +=head1 How can I check if mod_perl is available during configuration? + +Ralf Engelschall writes: + +When you compiled one httpd with and the other without mod_perl, then +you can simply use ... to surround the +stuff for the httpd compiled with mod_perl. The other then ignores +these lines. Example: + + + ...stuff for httpd w/ mod_perl... + + + ...stuff for httpd w/o mod_perl... + + +=head1 How can I terminate a chain of handlers? + +During each phase of request processing, apache calls handlers which +have registered an interest in looking at and possibly handling the +request. In some phases it makes sense to let all of the handlers +have a chance to look at the request. In other phases the first +handler to return "OK" terminates that phase (see the Apache +documentation, /manual/misc/API.html). + +If you define more than one PerlHandler for a phase, they are placed +on a stack and all of the handlers on the stack are called +sequentially by mod_perl, as long as they return "DECLINED" or "OK". +Apache sees the return code from the final handler and reacts to it. +If a handler wants to terminate the chain and ensure that no other +handler is called after it, it should set the corresponding stack to +undef. For instance, when a TransHandler has set $r->filename, it +should terminate with + + $r->set_handlers(PerlTransHandler => undef); + return OK; + +=head1 Why can't my handler see an environment variable that I set in httpd.conf? + +The configuration directives SetEnv and PassEnv are handled by +apache's mod_env during the fixup stage, so mod_perl handlers that run +prior to the fixup-stage don't see variables set with them. You can +use PerlSetEnv/PerlPassEnv instead - they are processed as soon as +possible during a request. + +=head1 Why does the server hang when I try to read a FORM? + +The C<$r-Econtent> method reads C +data directly from the client and it does not keep a copy, so if you +(or another handler) call it again, the server will hang. One way of +avoiding this, if you do not have full control of all the handlers +involved, is to convert the request from POST to GET in the first +handler that reads the content: + + use Apache::Constants qw(M_GET); + + sub My::Test::handler { + my $r = shift; + + if ($r->method eq 'POST') { + my $content = $r->content; + # ... + #make sure nobody else tries to read POST data now that we have + $r->method('GET'); + $r->method_number(M_GET); + $r->headers_in->unset('Content-length'); + } + # ... + } diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/faq/mod_perl_cgi.pod ./usr.sbin/httpd/mod_perl/faq/mod_perl_cgi.pod --- ../src.danvfs/usr.sbin/httpd/mod_perl/faq/mod_perl_cgi.pod Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/faq/mod_perl_cgi.pod Sun Jun 1 18:04:27 2003 @@ -0,0 +1,246 @@ +=head1 NAME + +Mod_perl_cgi - running CGI scripts under mod_perl ($Date: 2003/06/01 22:04:27 $) + +=head1 DESCRIPTION + +This part of the mod_perl FAQ deals with questions surrounding CGI +scripts. + +=head1 Why doesn't my CGI script work at all under mod_perl? + +What are the symptoms? Here are some possibilities. + +=head2 File not found + +Have you made the correct entries in Apache's configuration files? You +need to add the C and CLocation /perlE...> +directives to access.conf as described in mod_perl.pod. And of course the +script must be in the directory specified by the Alias directive and it +must be readable and executable by the user that the web server runs as. + +=head2 Forbidden + +You don't have permission to access /perl/foo on this server. + + chmod 755 /path/to/my/mod_perl/scripts + chmod 755 /path/to/my/mod_perl/scripts/foo + +=head2 Internal Server Error + +The script died with an execution error. There should be an error message +in the server's error.log saying why. Provided you are using CGI.pm, you +can also see what happens by running the script at a shell prompt. + +If the error.log claims there are syntax errors in your script, +but + + perl -c /path/to/my/mod_perl/scripts/foo + +says it is OK, you have probably used __END__ or __DATA__. Sorry. +Mod_perl's Apache::Registry can't deal with that. + +=head1 The script runs but the headers are mangled + +You have a script that works fine under mod_cgi but the browser +displays "Content-Type: text/html" or similar headers at the top of +the page when it is run under mod_perl. There are two possible +causes. + +Something, either your script or mod_perl or CGI.pm (if you are using +it) has to trigger Apache to send the response header. This happens +when you call the CGI.pm $q->header method or mod_perl's +$r->send_http_header. But if your script just prints out one or more +header lines followed by a blank line and the page content, you need +to set "PerlSendHeader On" in the configuration for the location of +the script. This tells mod_perl to parse the stuff that the script +prints and call $r->send_http_header for you when it sees the blank +line. + +This parsing only happens if PerlSendHeader is on and the header has +not been sent yet. Even so, it is costly and mod_perl makes the +assumption that individual headers are not split across print +statements, to simplify the parser and avoid having to retain +fragments of headers between calls to print(). So the following does +not work: + + print "Content-type: text/html\n"; + print "Set-Cookie: iscookietext\; "; + print "expires=Wednesday, 09-Nov-1999 00:00:00 GMT\; "; + print "path=\/\; domain=\.mmyserver.com\; \n\n"; + print "hello"; + +because the Set-Cookie header is split across multiple print's. + +You need to print each header (or group of headers) in one go, +possibly after building it up in a temporary variable. + + print "Content-type: text/html\n"; + my $cookie = "Set-Cookie: iscookietext; "; + $cookie .= "expires=Wednesday, 09-Nov-1999 00:00:00 GMT; "; + $cookie .= "path=/; domain=.mmyserver.com; \n\n"; + print $cookie; + print "hello"; + +=head1 My CGI script behaves strangely under mod_perl. Why? + +Remember that a conventional CGI script always starts up a fresh perl +interpreter, whereas a mod_perl script is reused in the same process +context many times. This means that certain categories of variables can +survive from one invocation of the script to the next. You can make that +work to your advantage, but you can also be caught out by it. + +When diagnosing a problem that might be caused by variable lifetimes, +always start the web server in single process mode. Apache normally +spawns a number of child processes to handle queries, and they get used in +round-robin fashion, which makes test results unpredictable. + +The command + + # ./httpd -X + +will start a single-process server with its default configuration. +You can specify a different configuration with the C<-f> flag (and +thus use a different port number for testing, for instance). + +Now try executing your script from a browser. A non-graphical browser +is often much better for diagnosing low-level problems. Install lynx +(http://lynx.browser.org/) if you haven't already got it and use + + lynx -mime_header http://localhost/perl/myscript + +to see the response that the web server produces when it GETs your +script, and + + lynx -head -dump http://localhost/perl/myscript + +to see the response to a HEAD request. The GET and HEAD commands that +come with libwww-perl are similar but slower. + +Here are some of the effects that you might see. + +=head2 The server terminates after processing the first request + +Your script is calling the CORE perl C function. That is not +a problem in a conventional CGI script, provided that query processing +is complete. But you almost certainly don't want to exit in a +mod_perl script. It kills the server process that handled the +request, meaning that the advantage of using mod_perl to avoid startup +overhead is lost. + +The best way to avoid calling C is to restructure the script so +that all execution paths return to a common point at the end of the +script. If this seems impractical you can force the same effect by +placing a label after the last executable statement and replacing calls to +C with C + +See also what mod_perl_traps says about C and the way +that Apache::Registry causes it to terminate the script but not the +httpd child. + +There may be exceptional circumstances in which you explicitly want to +terminate the httpd child at the end of the current request. In this +case Cexit(-2)> should be used. + +=head2 Variables retain their value from one request to the next + +The so-called sticky query effect happens when the CGI query object, or +another request-specific variable, has a lifetime longer than a single +execution of your script and does not get reinitialised each time the +script is invoked. + +This does not matter in a conventional CGI script, because the script +starts with a clean slate for each new request. But a mod_perl script +gets compiled into a subroutine by the Apache::Registry handler and then +processes an arbitrary number of requests. To make sure that both you and +the perl interpreter have the same idea about the meaning of your script, +make sure it starts like this: + + #!/usr/bin/perl -w + use strict; + +It is good for you! It will make perl point out all variables that you +have not explicitly declared. You can then think about whether they need +to be global or if they can be lexical. Try to declare things lexically, +with my(). These variables disappear when the block they are declared in +ends, so they don't occupy memory when they are not in use and they also +do not need a run-time symbol table entry. + +Beware, though, of referring to a lexical variable indirectly from within a +subroutine. To quote L, the +variable "... now becomes unreachable by the outside world, but retains +its value between calls to ..." the subroutine. You will see classic +"sticky query" symptoms if your code looks like this: + + #!/usr/bin/perl -w + use strict; + use CGI; + my $q = CGI->new(); + doit(); + + sub doit { + print($q->header(), $q->start_html()); + print('Value is ', $q->param('val')) if $q->param; + $q->print('

', $q->startform, 'Value? ', + $q->textfield(-name=>'val', -size=>20), ' ', + $q->submit('enter'), $q->endform); + print($q->end_html()); + } + +Because you remembered to put the C<-w> switch on the first line, the +error log will tell you that "Variable $q will not stay shared" +(provided you are using perl5.004 or higher). + +You must either pass the variable to the subroutine as a parameter, + + doit($q) + + sub doit { + my($q) = @_; + .... + +or declare this variable to be global, + + use vars qw($q); + $q = CGI->new(); + +The reason why Perl works this way is explained in a news posting by +Mike Guy that is included with this FAQ (mjtg-news.txt). + +=for html + mjtg-news.txt + +=head2 Variables B retain their value from one request to the next + +CGI.pm must pull some extra tricks when it is being used via +Apache::Registry. Versions of CGI.pm before 2.35 did not know this, +and Apache::Registry will complain if you try to use an earlier +version. + +CGI.pm detects that it is running under Apache::Registry by looking +for an environment variable. This test can fail if C is +evaluated too early, before the environment has been set up. That can +happen if you have C in a script and pull the script in with +a C directive in httpd.conf. Replacing C with +C will fix it. + +=head2 Do I have to rewrite my legacy code for mod_perl? + +If you have CGI code that seems to be fundamentally at odds with +mod_perl's "compile once, run many" environment, you may find that +it will work if run under the module C. See the +documentation of that module, which is included with recent versions +of mod_perl. + +=head1 How can my script continue running after sending the response? + +If the client submits a form that will take some time to process, you +may want to say "Thanks for submitting the form" and close the +connection, before processing it. + +You can achieve this by registering the subroutine that processes the +form as a cleanup handler: + + if($ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/) { + Apache->request->register_cleanup(sub { doProcess($query) }); + } diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/faq/mod_perl_faq.pod ./usr.sbin/httpd/mod_perl/faq/mod_perl_faq.pod --- ../src.danvfs/usr.sbin/httpd/mod_perl/faq/mod_perl_faq.pod Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/faq/mod_perl_faq.pod Sun Jun 1 18:04:27 2003 @@ -0,0 +1,432 @@ +=head1 NAME + +Mod_perl_faq - frequently asked questions about mod_perl ($Date: 2003/06/01 22:04:27 $) + +=head1 DESCRIPTION + +Mod_perl allows an Apache Web Server to directly execute perl code. This +document is designed to answer questions that arise when designing new +applications, and converting existing applications, to run in the mod_perl +environment. + +=head1 QUESTIONS & ANSWERS + +=head2 What is mod_perl? + +The Apache/Perl integration project brings together the full power of the +Perl programming language and the Apache HTTP server. This is achieved by +linking the Perl runtime library into the server and providing an +object-oriented Perl interface to the server's C language API. + +Mod_perl is a bundle of software. One part of the bundle is designed to +be compiled and linked together with Apache and Perl. The remainder is +perl code that provides the object-oriented interface to the "perl-enabled" +web server. + +The primary advantages of mod_perl are power and speed. You have full +access to the inner-workings of the web server and can intervene at any +stage of request-processing. This allows for customized processing of (to +name just a few of the phases) URI->filename translation, authentication, +response generation and logging. There is very little run-time overhead. +In particular, it is not necessary to start a separate process, as is +often done with web-server extensions. The most wide-spread such +extension mechanism, the Common Gateway Interface (CGI), can be replaced +entirely with perl-code that handles the response generation phase of +request processing. Mod_perl includes a general purpose module for this +purpose (Apache::Registry) that can transparently run existing perl CGI +scripts. + +=head2 Where can I get mod_perl? + +Mod_perl can be found at +http://www.perl.com/CPAN/modules/by-module/Apache/ + +=head2 What else do I need? + +=over 4 + +=item Perl + +http://www.perl.com/CPAN/src/latest.tar.gz + +Win32 users note: mod_perl compiles cleanly and works with ActivePerl +(build 626, June 2001). In +http://www.mail-archive.com/modperl@apache.org/msg11513.html Randy +Kobes wrote: + + A ppd for mod_perl, suitable for use with ActivePerls + based on Perl-5.6.0, is now available. Installation is as ppm + install + + http://theoryx5.uwinnipeg.ca/ppmpackages/mod_perl.ppd + + or in ftp://theoryx5.uwinnipeg.ca/pub/ppmpackages/. + A post-install script will subsequently be run which + will download and install the required ApacheModulePerl.dll; + this should be placed in your Apache modules directory. + If for some reason the script fails, this dll can be + obtained from http://theoryx5.uwinnipeg.ca/ppmpackages/. + Also available in this directory is a sample Apache + httpd.conf suitable to test mod_perl on Win32. + +=item Apache + +http://www.apache.org/dist/ + +=back + +=head2 How do I install it? + +Configuring and installing apache with mod_perl is a complex process, +so it is really not a good idea to attempt to do it manually. If you +are used to configuring third-party modules into Apache using the +apache configuration process, please realize that running mod_perl's +Makefile.PL with the right parameters does this for you. + +Read the INSTALL* files in the top-level mod_perl distribution +directory and then choose one of the INSTALL.simple* recipes that is +close to your requirements, as a starting point. When you succeed in +compiling and linking an httpd, a quick way to check that everything +is configured according to plan is to run it with the C<-l> (list +compiled-in modules) and C<-V> (show paths) flags. + +=head2 What documentation should I read? + +The mod_perl documentation in mod_perl.pod. After you have installed +mod_perl you can read it with the command: C. + +The complete list of available documentation can be found at the end +of mod_perl's README file. + +If you are using mod_perl to extend the server functionality, you will +need to read C and the Apache API notes, which can be +found in apache_x.x.x/htdocs/manual/misc/API.html. + +Existing (perl-) CGI scripts should run as-is under mod_perl. There are a +number of reasons why they may need to be adjusted, and these are +discussed later in this FAQ. If you are developing a new CGI script it is +probably best to use CGI.pm. It is part of the standard perl distribution +and its documentation can be read with the command: C. + +=head2 How do I run CGI scripts under mod_perl? + +Refer to L for tips on writing and converting CGI +scripts for mod_perl. + +=head2 How do I access the Apache API from mod_perl? + +Interfacing with Apache is discussed in L. + +=head2 How secure are mod_perl scripts? + +Because mod_perl runs within an httpd child process, it runs with the +user-id and group-id specified in the httpd.conf file. This user/group +should have the lowest possible privileges. It should only have access +to world readable files. Even so, careless scripts can give away +information. You would not want your /etc/passwd file to be readable over +the net, for instance. + +Different mod_perl scripts run successively using the same Perl +interpreter instance. So, in addition to classical CGI mischiefs, a +malicious mod_perl script can redefine any Perl object and change the +behavior of other mod_perl scripts. + +If you turn on tainting checks, perl can help you to avoid the pitfalls of +using data received from the net. Setting the C<-T> switch on the first line +of the script is not sufficient to enable tainting checks under mod_perl. +You have to include the directive C in the httpd.conf +file. + +=head2 What if my script needs higher privileges? + +You will have to start a new process that runs under a suitable user-id +(or group-id). If all requests handled by the script will need the higher +privileges, you might as well write it as a suid CGI script. Read the +documentation about suEXEC in the Apache documentation. + +Alternatively, pre-process the request with mod_perl and fork a suid +helper process to handle the privileged part of the task. + +=head2 Why is httpd using so much memory? + +Read the section on "Memory Consumption" in the mod_perl.pod. + +Make sure that your scripts are not leaking memory. Global variables +stay around indefinitely, lexical variables (declared with my()) are +destroyed when they go out of scope, provided there are no references +to them from outside of that scope. The Apache::Leak module can warn +about some types of memory leak. + +To get information about the modules that have been loaded and their +symbol-tables, use the Apache::Status module. It is enabled by adding +these lines to the httpd configuration file. + + + SetHandler perl-script + PerlHandler Apache::Status + + +Then look at the URL http://www.your.host/perl-status + +Joel Wagner reports that calling an undefined subroutine in a module +can cause a tight loop that consumes all memory. Here is a way to +catch such errors. Define an autoload subroutine + + sub UNIVERSAL::AUTOLOAD { + my $class = shift; + warn "$class can't `$UNIVERSAL::AUTOLOAD'!\n"; + } + +It will produce a nice error in error_log, giving the line number of +the call and the name of the undefined subroutine. + +=head2 Do I have to restart the server when I change my Perl code? + +Apache::Registry checks the timestamp of scripts that it has loaded +and reloads them if they change. Other handlers and library modules +are not automatically reloaded by mod_perl, but you can use the +Apache::StatINC module to do this for you. + +=head2 So how do I use mod_perl in conjunction with ErrorDocument? + +Andreas Koenig writes: + +=over 4 + +=item * + +Set up your testing engine: + +LWP comes with debugging capabilities that are sometimes better than +your browser, sometimes your browser is the better testing +device. Make sure you can call lwp-request from the command line and +have your browser ready before you start. I find the C<-x> switch +(extended debugging) and the C<-d> switch (do not display content) most +useful. + +=item * + +Test your server with + + lwp-request -xd http://your.server/test/file.not_there + +Carefully examine if the status is 404 and if the headers look good. + +If you try 'lwp-request -es', the HTML output will not be the one you +are sending, instead lwp-request will send its own cooked HTML text +(as of version libwww-perl-5.09). Check the real text either with the +C<-x> switch or with telnet or your browser. + +=item * + +Set up your Errordocument configuration in the testing area. I have +this in my .htaccess file: + + ErrorDocument 404 /perl/errors/err404-01 + +The /perl/ directory is configured to + + + SetHandler perl-script + PerlHandler Apache::Registry::handler + Options ExecCGI + + +I have no PerlSendHeader and no PerlNewSendHeader directive in any +configuration file. + +=item * + +Repeat step 2 (Test your server) + +=item * + +Write your error handler in mod_perl. You have to be prepared that you +have to tell both apache *and* the browser the right thing. Basically +you have to tell the browser what the error is, but you have to +pretend to apache that everything was OK. If you tell apache the error +condition, it will handle the situation on its own and add some +unwanted stuff to the output that goes to the browser. + +The following works fine for me: + + my $r = Apache->request; + $r->content_type('text/html; charset=ISO-8859-1'); + $r->send_http_header; + $r->status(200); + ...send other HTML stuff... + +At the time of the send_http_header we have an error condition of type +404--this is what gets sent to the browser. After that I set status to +200 to silence the apache engine. + +I was not successful in trying to do the same with CGI.pm, but I +didn't try very hard. + +=item * + +Repeat step 2 (Test your server) + +=item * + +The above is tested with mod_perl/0.98 and 0.99 + +=item * + +Open questions I could not find documentation for (except RTFS): what +exactly is PerlSendHeaders and PerlNewSendHeaders. What is the default +setting for those? How do these cooperate with CGI.pm, Apache.pm, +Apache::Registry? + +=back + +=head2 How can I reference private library modules? + +If you put your modules into one of the directories on perl's search +path (the @INC array), they will be found automatically. +Traditionally, site-specific modules go in /usr/lib/perl5/site_perl/. +Newer versions of mod_perl add the directory $ServerRoot/lib/perl to +@INC on startup so that is a good place for modules that are only used +by mod_perl scripts. + +If you need to load files from other non-standard locations, you can +add directories to the @INC array with a 'use lib' statement in a +startup script. See L for an example. + +=head2 How can I pass arguments to a SSI script? + +Following the documentation, I have put the following in the html +file: + + + +I want to send an argument to the ssi.pl script. How? + +It won't work with Apache::Include. Instead of a script, define a +subroutine that's pulled in with PerlRequire or PerlModule, like so: + + sub My::ssi { + my($r, $one, $two, $three) = @_; + ... + } + +In the html file: + + + +=head2 Why is image-file loading so slow when testing with httpd C<-X> ? + +If you use Netscape while your server is running in single-process +mode, the "KeepAlive" feature gets in the way. Netscape tries to open +multiple connections and keep them open. Because there is only one +server process listening, each connection has to time-out before the +next succeeds. Turn off KeepAlive in httpd.conf to avoid this effect. + +=head2 What can cause a subroutine or variable to be sporadically undefined? + +If you sometimes see error messages like this: + + [Thu Sep 11 11:03:06 1997] Undefined subroutine + &Apache::ROOT::perl::script1::sub_foo called at + /some/path/perl/script2 line 42. + +despite the fact that script2 normally works just fine, it looks like +you have a namespace problem in a library file. If sub_foo is located +in a file that is pulled in by 'require' and both script1 and script2 +require it, you need to be sure that the file containing sub_foo sets +a package name. Otherwise, sub_foo gets defined in the namespace that +is active the first time it is required, and the next require is a +no-op because that file is already in %INC. The same problem can +happen with global variables. + +The solution is simple, set up your require'd file something along +these lines: + + package SomeName; + + sub sub_foo {...} + +Now, have scripts call SomeName::sub_foo() instead of sub_foo(). + +=head2 Is there a bug that causes httpd processes to crash? + +You may see httpd child processes crashing with segmentation fault +when you restart the server with a HUP or USR1 signal. This is not a +bug in mod_perl. If you have 'PerlFreshRestart On' in the +configuration, the main httpd daemon reloads all the perl modules that +it has preloaded when it gets a HUP or USR1 signal. Unfortunately, +not all perl modules are robust enough to survive this, for them, +unusual situation. + +=head2 What could be causing sporadic errors "in cleanup"? + +Some people have seen error messages such as this: + + [Fri Sep 26 10:50:08 1997] (in cleanup) no dbproc key in hash + at /usr/lib/perl5/site_perl/Apache/Registry.pm line 119. + +Doug writes: + +"I have yet to figure out why, but there have been a few arbitrary +cases where Perl (in mod_perl) _insists_ on finding and/or calling a +DESTROY method for an object. Defining an empty sub DESTROY has been +the bandaid for these few cases." + +If the specific error message gives you a hint about which object is +causing difficulty, put the C in the module that +defines that object class. + +=head2 How can I test that my script is running under mod_perl? + +There are 2 environment variables you can test. + + exists $ENV{"MOD_PERL"} # if running under mod_perl + + $ENV{"GATEWAY_INTERFACE"} eq "CGI-Perl/1.1" + +The MOD_PERL variable gets set immediately when the perl interpreter +starts up, whereas GATEWAY_INTERFACE may not be set yet when BEGIN +blocks are being processed. + +=head2 Why don't "format" and "write" work under mod_perl? + +The Perl tie'd filehandle interface is not complete, format/write is +one of the missing pieces. If you configure Perl with sfio, write() +should work just fine. + +=head2 Where can I get help that I did not find in here? + +There is a mailing-list dedicated to mod_perl. It is archived at +http://outside.organic.com/mail-archives/modperl/ and at +http://forum.swarthmore.edu/epigone/modperl (which has a search +engine) and also at +http://www.progressive-comp.com/Lists/?l=apache-modperl&r=1#apache-modperl +(threaded and indexed). + +You can subscribe to the list by sending a mail to +C and responding to the confirmation +message that you will receive. To unsubscribe, send mail to +C B and reply to the confirmation message. Look at the +full headers of mails that you receive from the list to see the +address that they were sent to. The address is embedded in the +C header (you will probably have to activate a "show full +headers" function in your mail reader to see it). To find the +address, delete C from the front of the return path +and C<@perl.apache.org> from the back, then replace the C<=> with C<@>. + +Remember: the mailing list is for questions about and discussion of +mod_perl. Quetions about perl programming in general should be asked +in the newsgroup comp.lang.perl.misc, after consulting the fine perl +faqs. There is a whole set of newsgroups dedicated to web authoring, +web servers etc.: comp.infosystems.www.* + +The mod_perl homepage http://perl.apache.org/ has links to other +mod_perl resources. + +The pod source of this FAQ is available at +http://www.ping.de/~fdc/mod_perl/mod_perl_faq.tar.gz + +=head2 Where do I send suggestions and corrections concerning this FAQ? + +mailto:fdc@cliwe.ping.de diff -ruN --exclude=CVS -I \$OpenBSD: -I \$Id: ../src.danvfs/usr.sbin/httpd/mod_perl/htdocs/manual/mod/mod_perl.html ./usr.sbin/httpd/mod_perl/htdocs/manual/mod/mod_perl.html --- ../src.danvfs/usr.sbin/httpd/mod_perl/htdocs/manual/mod/mod_perl.html Wed Dec 31 19:00:00 1969 +++ ./usr.sbin/httpd/mod_perl/htdocs/manual/mod/mod_perl.html Sun Jun 1 18:04:27 2003 @@ -0,0 +1,662 @@ + +Apache module mod_perl + + + +

+ [APACHE DOCUMENTATION] +

Apache HTTP Server Version 1.3b5

+
+

Module mod_perl

+

This module is contained in the mod_perl.c file.

+