1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-26 09:46:09 +00:00

[NEW PORTS] www/webobjects(+) Apple WebObjects ports bundle

This is a bundle of several ports covering many typical requirements
for building an Apple WebObjects deployment environment. Each port
is or has a dependancy with some other port in the bundle, and have
therefore been lodged collectively.

	www/woadaptor

	WOAdaptor is a collection of WebObjects WebServer Adaptors.
	These include an Apache Module, CGI and FastCGI adaptors

	This is a subproject of Project Wonder and is an effort to
	pool enhancements and bug fixes for Apple's open source
	codebase.

	WWW: http://wonder.sourceforge.net/WOAdaptor.html

PR:		ports/117299
Submitted by:	Quinton Dolan <q@onthenet.com.au>
This commit is contained in:
Edwin Groothuis 2008-06-13 06:29:46 +00:00
parent e17fabfd29
commit e6b6e3491e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=214755
24 changed files with 862 additions and 0 deletions

View File

@ -1406,6 +1406,7 @@
SUBDIR += winhelpcgi
SUBDIR += wml
SUBDIR += wnews
SUBDIR += woadaptor
SUBDIR += wordpress
SUBDIR += wordpress-mu
SUBDIR += wsdlpull

224
www/woadaptor/Makefile Normal file
View File

@ -0,0 +1,224 @@
# New ports collection makefile for: woadaptor
# Date created: Thu Apr 12 04:43:26 EST 2007
# Whom: Quinton Dolan <q@onthenet.com.au>
#
# $FreeBSD$
#
PORTNAME?= woadaptor
PORTVERSION= ${WONDERVERSION}
CATEGORIES= www
MASTER_SITES= #
DISTNAME= woadaptor-${PORTVERSION}
MAINTAINER?= q@onthenet.com.au
COMMENT?= WebObjects WebServer Adaptor (Apache Module and CGI)
IGNOREFILES= ${DISTFILES}
USE_BZIP2= yes
USE_GMAKE= yes
WWWUSER?= ${WWWOWN}
WWWGROUP?= ${WWWGRP}
SUB_FILES+= pkg-install pkg-deinstall pkg-message \
mod-message cgi-message fastcgi-message webobjects.conf-dist \
FastCGI-apache.conf FastCGI-nginx.conf FastCGI-lighttpd.conf \
woadaptor.sh
SUB_LIST= USER=${WWWUSER} GROUP=${WWWGROUP} WODOCROOT=${WODOCROOT_REL}
PKGINSTALL= ${WRKDIR}/pkg-install
PKGMESSAGE= ${WRKDIR}/pkg-message
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
CONFLICTS?= woadaptor-cgi-[0-9]* mod_webobjects-[0-9]*
WONDERREL= 4.0.0
TODAY!= date "+%Y%m%d"
SNAPDATE= 20071014
WONDERREV= ${SNAPDATE}
.if defined(WITH_WONDERNIGHTLY) || defined(WITH_WONDERCVS)
SNAPDATE= ${TODAY}
MD5_FILE= ""
.endif
WONDERVERSION= ${WONDERREL}.${WONDERREV}
SNAPVERSION= ${WONDERREL}.${SNAPDATE}
XDISTNAME= woadaptor-${WONDERVERSION}
XDISTFILE= ${DISTDIR}/${XDISTNAME}.tar.bz2
CFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
WODOCROOT?= ${PREFIX}/www/webobjects
WODOCROOT_REL= ${WODOCROOT:S,^${PREFIX}/,,}
.if !defined(PKGNAMEPREFIX) && !defined(PKGNAMESUFFIX)
OPTIONS= CGI "Build CGI version" on \
APACHE "Build Apache module" off \
FASTCGI "Enable fastcgi support (CGI only)" on
.endif
.include <bsd.port.pre.mk>
.if defined(WITH_APACHE)
CONFLICTS?= mod_webobjects-[0-9]*
.endif
MAKE_ARGS= OS=FreeBSD ADAPTORS="${ADAPTORS}" LOCALBASE=${LOCALBASE}
.if !defined(WITHOUT_SSL)
MAKE_ARGS+= USE_SSL="yes"
.endif
.if !defined(WITHOUT_CGI)
CGI_BIN?= www/cgi-bin
PLIST_SUB+= CGI_BIN=${CGI_BIN}
SUB_LIST+= CGI_BIN=${CGI_BIN}
.if !defined(WITHOUT_FASTCGI)
USE_RC_SUBR+= woadaptor.sh
LIB_DEPENDS+= fcgi:${PORTSDIR}/www/fcgi
ADAPTORS+= FastCGI
PLIST_SUB+= FASTCGI=""
PLIST_SUB+= CGI="@comment "
SUB_LIST+= CGIEXT="-fcgi"
.else
ADAPTORS+= CGI
PLIST_SUB+= CGI=""
PLIST_SUB+= FASTCGI="@comment "
SUB_LIST+= CGIEXT=""
.endif
.else
PLIST_SUB+= FASTCGI="@comment "
PLIST_SUB+= CGI="@comment "
.endif
.if defined(WITH_APACHE)
USE_APACHE?= 1.3+
.include "${PORTSDIR}/Mk/bsd.apache.mk"
MAKE_ARGS+= APXS=${APXS} APACHEINCLUDE_DIR=${APACHEINCLUDEDIR}
APACHECONFDIR= ${APACHEETCDIR}
PLIST_SUB+= APACHEETCDIR=${APACHEETCDIR} APACHEMODDIR=${APACHEMODDIR}
SUB_LIST+= APACHEETCDIR=${APACHEETCDIR} APACHE="" \
APACHECONFDIR=${APACHECONFDIR} WWWDATA=${WWWDATA}
.if ${APACHE_VERSION} >= 20
APACHECONFDIR= ${APACHEETCDIR}/Includes
.if ${APACHE_VERSION} >= 22
ADAPTORS+= Apache2.2
APACHE_VER= 2.2
.else
ADAPTORS+= Apache2
APACHE_VER= 2
.endif
# Apache2.2
.else
# Must be Apache 1.3
.if exists(${APXS})
WITH_MODSSL:=`${APXS} -q CFLAGS 2>/dev/null \
| ${GREP} DMOD_SSL >/dev/null \
&& ${ECHO} yes`
.endif
MAKE_ARGS+= WITH_MODSSL=${WITH_MODSSL}
ADAPTORS+= Apache
APACHE_VER=
.endif
PLIST_SUB+= APACHE=""
.else
PLIST_SUB+= APACHE="@comment "
.endif
# WITH_APACHE
.if !defined(WITHOUT_DEBUG)
# this doesn't do anything
MAKE_ARGS+= DEBUG="yes"
.endif
.if !defined(UID)
UID!= ${ID} -u
.endif
pre-fetch:
.if defined(WITHOUT_CGI) && !defined(WITH_APACHE)
@${ECHO_MSG} You must select at least one build target
@${FALSE}
.endif
.if !exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX})
do-fetch: build-distfile
.endif
build-distfile:
@${MKDIR} ${WRKDIR}
@${MKDIR} ${DISTDIR}
@${RM} -rf ${WRKDIR}/${XDISTNAME}
@${ECHO_MSG} ">> Building distfile from CVS..."
cd ${WRKDIR}; \
cvs -q -d:pserver:anonymous@wonder.cvs.sourceforge.net:/cvsroot/wonder co \
-D ${SNAPDATE} -d ${XDISTNAME} Wonder/Adaptors
@${FIND} ${WRKDIR}/${XDISTNAME} -name CVS | ${XARGS} ${RM} -rf
@(cd ${WRKDIR} && ${TAR} cfy ${XDISTFILE} ${XDISTNAME})
@${RM} -rf ${WRKDIR}/${XDISTNAME}
@${RMDIR} ${WRKDIR} 2>/dev/null || true
@${ECHO_MSG} ">> Done. "
do-install:
.if defined(WITH_APACHE)
.if ${APACHE_VERSION} > 21
@${APXS} -i -a -n WebObjects ${WRKSRC}/Apache${APACHE_VER}/mod_WebObjects.la
.else
@${APXS} -i -a -n WebObjects ${WRKSRC}/Apache${APACHE_VER}/mod_WebObjects.so
.endif
@${INSTALL_DATA} ${WRKDIR}/webobjects.conf-dist \
${PREFIX}/${APACHEETCDIR}
@if [ ! -e ${PREFIX}/${APACHECONFDIR}/webobjects.conf ]; then \
${CP} ${WRKDIR}/webobjects.conf-dist \
${PREFIX}/${APACHECONFDIR}/webobjects.conf; \
fi
.endif
.if defined(WITH_CGI)
.if !defined(WITHOUT_FASTCGI)
@${INSTALL_PROGRAM} ${WRKSRC}/FastCGI/WebObjects \
${PREFIX}/libexec/WebObjects-fcgi
.else
@${MKDIR} ${DATADIR}
@${INSTALL_PROGRAM} ${WRKSRC}/CGI/WebObjects ${PREFIX}/libexec/WebObjects
.endif
.endif
post-install:
.if !defined(WITHOUT_FASTCGI)
@${MKDIR} ${DATADIR}
@${INSTALL_DATA} ${WRKDIR}/FastCGI-apache.conf ${DATADIR}/apache.conf
@${INSTALL_DATA} ${WRKDIR}/FastCGI-nginx.conf ${DATADIR}/nginx.conf
@${INSTALL_DATA} ${WRKDIR}/FastCGI-lighttpd.conf ${DATADIR}/lighttpd.conf
.endif
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.if defined(WITH_CGI)
.if !defined(WITHOUT_FASTCGI)
@${INSTALL_DATA} ${WRKSRC}/FastCGI/README ${DOCSDIR}/README-fcgi
.else
@${INSTALL_DATA} ${WRKSRC}/CGI/Installation.html ${DOCSDIR}
.endif
.endif
@${INSTALL_DATA} ${WRKSRC}/example.xml ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/woadaptor.xml ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/woadaptor.dtd ${DOCSDIR}
.endif
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.if defined(WITH_APACHE)
@${CAT} ${WRKDIR}/mod-message >> ${PKGMESSAGE}
.endif
.if defined(WITH_CGI)
.if !defined(WITHOUT_FASTCGI)
@${CAT} ${WRKDIR}/fastcgi-message >> ${PKGMESSAGE}
.else
@${CAT} ${WRKDIR}/cgi-message >> ${PKGMESSAGE}
.endif
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

2
www/woadaptor/distinfo Normal file
View File

@ -0,0 +1,2 @@
MD5 (woadaptor-4.0.0.20071014.tar.bz2) = IGNORE
SHA256 (woadaptor-4.0.0.20071014.tar.bz2) = IGNORE

View File

@ -0,0 +1,16 @@
#
# This is a sample snippet from Apache's httpd.conf that is needed to
# run WebObjects FastCGI adaptor
#
# (Make sure the Alias line below appears before any alias for "/cgi-bin/"
#
Alias /cgi-bin/WebObjects %%PREFIX%%/libexec/WebObjects-fcgi
<IfModule mod_fastcgi.c>
FastCgiIpcDir /var/run/webobjects
FastCgiServer %%PREFIX%%/libexec/WebObjects-fcgi -processes 10 \
-initial-env WO_CONFIG_URL=http://localhost:1085 \
-initial-env WO_ADAPTOR_INFO_USERNAME=userhere \
-initial-env WO_ADAPTOR_INFO_PASSWORD=passhere
</IfModule>

View File

@ -0,0 +1,20 @@
#
# This is a sample snippet from Lighttpd's config file that is needed to
# run WebObjects FastCGI adaptor
#
fastcgi.server = ( "/cgi-bin/WebObjects" =>
( "WebObjects" => (
"socket" => "/tmp/woadaptor.sock",
"check-local" => "disable",
"bin-path" => "%%PREFIX%%/libexec/WebObjects-fcgi",
"bin-environment" => (
"WO_CONFIG_URL" => "http://localhost:1085",
"WO_ADAPTOR_INFO_USERNAME" => "userhere",
"WO_ADAPTOR_INFO_PASSWORD" => "passhere",
)
))
)
alias.url = ( "/WebObjects/" => "%%PREFIX%%/%%WODOCROOT%%/" )
$HTTP["url"] =~ "^/WebObjects($|/)" { dir-listing.activate = "disable" }

View File

@ -0,0 +1,31 @@
#
# This is a sample snippet from Nginx's config file that is needed to
# run WebObjects FastCGI adaptor
#
# You will need to use a standalone FastCGI server to run the adaptor.
# This can be done by setting woadaptor_enable="YES" in /etc/rc.conf
# and running %%PREFIX%%/etc/rc.d/woadaptor start
#
# Note: You must ensure that the web server user has permission to use
# the socket.
server {
listen 80
# WebObjects Adaptor config
location /cgi-bin/WebObjects {
set $path_info "";
set $script_name /cgi-bin/WebObjects;
if ($fastcgi_script_name ~ "^/cgi-bin/WebObjects(/.+)$") {
set $path_info $1;
}
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_NAME $script_name;
fastcgi_pass unix:/tmp/woadaptor.sock;
include fastcgi_params;
}
location /WebObjects {
root %%PREFIX%%/%%WODOCROOT%%;
}
}

View File

@ -0,0 +1,9 @@
*****************************************************************************
The CGI version of WOAdaptor has been installed into
%%PREFIX%%/libexec/WebObjects
You will need to either configure your chosen web server to reference this
directly, or copy it into the appropriate cgi-bin location.
Some example configuration files have been provided in %%DATADIR%%
*****************************************************************************

View File

@ -0,0 +1,16 @@
*****************************************************************************
The FastCGI version of WOAdaptor has been installed into
%%PREFIX%%/libexec/WebObjects%%CGIEXT%%
You will need to either configure your chosen web server to reference this
directly, or copy it into the appropriate cgi-bin location.
Some example configuration files have been provided in %%DATADIR%%
to demonstrate how to use the FastCGI binary.
If you wish to use an external FastCGI server to spawn the WOAdaptor
process add woadaptor_enable="YES" to rc.conf and run
%%PREFIX%%/etc/rc.d/woadaptor start
Examine the above script for the configuration options
*****************************************************************************

View File

@ -0,0 +1,12 @@
*****************************************************************************
Make sure mod_WebObjects.so is enabled in %%PREFIX%%/%%APACHEETCDIR%%/httpd.conf
You will need to create %%PREFIX%%/%%APACHECONFDIR%%/webobjects.conf
if one does not already exist and ensure it is included with a Include
statement. When using Apache2 this is done automatically.
You will also need to either comment out any existing ScriptAlias for
/cgi-bin/ or change the WebObjectsAlias to use a different prefix.
See %%PREFIX%%/%%APACHEETCDIR%%/webobjects.conf-dist for an example config.
*****************************************************************************

View File

@ -0,0 +1,33 @@
--- Apache/Makefile.orig Wed Sep 18 12:57:24 2002
+++ Apache/Makefile Wed May 30 01:17:28 2007
@@ -88,5 +88,30 @@
${CC} -c ${CFLAGS} mod_WebObjects.c ${COMMON_OBJFILES}
endif
+ifeq "FreeBSD" "$(OS)"
+OPENSSLINCLUDEFLAGS =
+OPENSSLLIBFLAGS =
+
+ifdef USE_SSL
+ifdef WITH_MODSSL
+ OPENSSLINCLUDEFLAGS = -I/usr/local/include/openssl
+ OPENSSLLIBFLAGS = -L/usr/lib -lcrypto -lssl
+else
+ APXSAPACHESSLFLAG =
+endif
+endif
+
+CFLAGS += -O2 -Wall -I../Adaptor $(DEBUG_FLAG) -DSINGLE_THREADED_ADAPTOR -DFORKING_WEBSERVER -DAPACHE -fPIC `${APXS} -q CFLAGS`
+APXSFLAGS = -c -I../Adaptor ${OPENSSLLIBFLAGS} -D SINGLE_THREADED_ADAPTOR ${APXSAPACHESSLFLAG} "-I`${APXS} -q INCLUDEDIR`" -S CC=$(CC)
+
+all: mod_WebObjects.so
+
+mod_WebObjects.so : mod_WebObjects.c ${COMMON_OBJFILES}
+ ${APXS} ${APXSFLAGS} mod_WebObjects.c ${COMMON_OBJFILES}
+
+clean:
+ rm -f mod_WebObjects.so *.o
+endif
+
#################################
include ../Adaptor/make.postamble

View File

@ -0,0 +1,43 @@
--- Apache2/Makefile.orig Mon Jun 12 06:27:54 2006
+++ Apache2/Makefile Sat Apr 14 15:33:13 2007
@@ -84,6 +84,22 @@
+ifeq "FreeBSD" "${OS}"
+ifdef USE_SSL
+# Flags for use when enabling mod_ssl support (on by default)
+ENABLE_SSL_SUPPORT = -DAPACHE_SECURITY_ENABLED
+# These should be set to point at the ssl include and lib directories, respectively.
+OPENSSL_INCL_FLAGS = -I/usr/include/openssl
+OPENSSL_LIB_FLAGS = -L/usr/lib -lcrypto -lssl
+endif
+
+INCLUDES += ${OPENSSL_INCL_FLAGS}
+LDFLAGS += ${OPENSSL_LIB_FLAGS} -lm -module
+APXSFLAGS += "-I`${APXS} -q INCLUDEDIR`"
+
+endif
+# End FreeBSD Config
+
# Build steps
# Get the list of source files from the ../Adaptor directory and change their extension to .o
@@ -138,6 +154,17 @@
mod_WebObjects.o : mod_WebObjects.c ${COMMON_OBJFILES}
${CC} -c ${CFLAGS} mod_WebObjects.c ${COMMON_OBJFILES}
endif
+
+# FreeBSD Build
+ifeq "FreeBSD" "$(OS)"
+
+mod_WebObjects.so : mod_WebObjects.c ${COMMON_SRCFILES}
+ ${APXS} ${APXSFLAGS} mod_WebObjects.c ${COMMON_SRCFILES}
+ cp $(@:.so=.slo) $@
+
+endif
+#end FreeBSD
+
# The install target does what you'd think it would: install the module; By default, this is not called.
install: mod_WebObjects.la

View File

@ -0,0 +1,43 @@
*** Apache2.2/Makefile.orig Tue Jul 4 13:02:19 2006
--- Apache2.2/Makefile Mon Apr 16 09:17:08 2007
***************
*** 82,87 ****
--- 82,100 ----
endif
# End HPUX config
+ ifeq "FreeBSD" "$(OS)"
+ ifdef USE_SSL
+ # Flags for use when enabling mod_ssl support (on by default)
+ ENABLE_SSL_SUPPORT = -DAPACHE_SECURITY_ENABLED
+ # These should be set to point at the ssl include and lib directories, respectively.
+ OPENSSL_INCL_FLAGS = -I/usr/include/openssl
+ OPENSSL_LIB_FLAGS = -L/usr/lib -lcrypto -lssl
+ endif
+
+ INCLUDES += ${OPENSSL_INCL_FLAGS}
+ LDFLAGS += ${OPENSSL_LIB_FLAGS} -lm -module
+ APXSFLAGS += "-I`${APXS} -q INCLUDEDIR`"
+ endif
***************
*** 138,143 ****
--- 151,166 ----
mod_WebObjects.o : mod_WebObjects.c ${COMMON_OBJFILES}
${CC} -c ${CFLAGS} mod_WebObjects.c ${COMMON_OBJFILES}
endif
+
+ # FreeBSD Build
+ ifeq "FreeBSD" "$(OS)"
+
+ mod_WebObjects.so : mod_WebObjects.c ${COMMON_SRCFILES}
+ ${APXS} ${APXSFLAGS} mod_WebObjects.c ${COMMON_SRCFILES}
+
+ endif
+ #end FreeBSD
+
# The install target does what you'd think it would: install the module; By default, this is not called.
install: mod_WebObjects.la

View File

@ -0,0 +1,42 @@
--- CGI/WebObjects.c.orig Sun May 13 01:12:59 2007
+++ CGI/WebObjects.c Sun May 13 01:23:31 2007
@@ -254,19 +254,7 @@
* extract WebObjects application name from URI
*/
- qs = getenv("QUERY_STRING");
- if (qs) {
- qs_len = strlen(qs);
- } else {
- qs_len = 0;
- }
-
- if (qs_len > 0) {
- /* Make room for query string and "?" */
- url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1 + qs_len + 2);
- } else {
- url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1);
- }
+ url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1);
strcpy(url, script_name);
strcat(url, path_info);
WOLog(WO_INFO,"<CGI> new request: %s",url);
@@ -371,11 +359,14 @@
}
/* Always get the query string */
- /* Don't add ? if the query string is empty. */
+ qs = getenv("QUERY_STRING");
+ if (qs) {
+ qs_len = strlen(qs);
+ } else {
+ qs_len = 0;
+ }
+
if (qs_len > 0) {
- /* Add the query string to the full URL - useful for debugging */
- strcat(url, "?");
- strcat(url, qs);
wc.queryString.start = qs;
wc.queryString.length = qs_len;
WOLog(WO_INFO,"<CGI> new request with Query String: %s", qs);

View File

@ -0,0 +1,21 @@
--- FastCGI/Makefile.orig Tue Oct 22 20:23:39 2002
+++ FastCGI/Makefile Sun Apr 15 05:18:58 2007
@@ -3,7 +3,8 @@
include ../Adaptor/make.preamble
#CFLAGS = -O2 -Wall -I../Adaptor $(DEBUG_FLAG) -DSINGLE_THREADED_ADAPTOR -D$(OS) -DCGI
-CFLAGS = -O2 -Wall -I../Adaptor $(DEBUG_FLAG) -DSINGLE_THREADED_ADAPTOR -D$(OS) -DCGI
+CFLAGS += -O2 -Wall -I../Adaptor $(DEBUG_FLAG) -DSINGLE_THREADED_ADAPTOR -D$(OS) -DCGI
+LOCALBASE ?= /usr/local
ifeq "HPUX" "$(OS)"
#CFLAGS += -nopdolib
@@ -22,7 +23,7 @@
all: WebObjects${EXESUFFIX}
WebObjects${EXESUFFIX}: WebObjects.o ${COMMON_OBJFILES}
- ${CC} ${CFLAGS} ${LDFLAGS} -o WebObjects${EXESUFFIX} WebObjects.o ${COMMON_OBJFILES} /usr/local/lib/libfcgi.a
+ ${CC} ${CFLAGS} ${LDFLAGS} -o WebObjects${EXESUFFIX} WebObjects.o ${COMMON_OBJFILES} ${LOCALBASE}/lib/libfcgi.a
clean:
rm -f WebObjects${EXESUFFIX} *.o

View File

@ -0,0 +1,90 @@
--- FastCGI/WebObjects.c.orig Wed Mar 26 21:13:09 2003
+++ FastCGI/WebObjects.c Sun May 13 07:08:27 2007
@@ -212,7 +212,7 @@
WOLog(WO_INFO,"<FastCGI> Signal %s caught", strsignal(signum));
break;
case SIGPIPE : WOLog(WO_WARN,"<FastCGI> Signal %s caught", strsignal(signum));
- exit(-1);
+ break;
case SIGTERM : WOLog(WO_ERR,"<FastCGI> Signal %s caught", strsignal(signum));
exit(-1);
default: WOLog( WO_INFO,"<FastCGI> Signal %s caught", strsignal(signum));
@@ -327,19 +327,7 @@
/*
* extract WebObjects application name from URI
*/
- qs = FCGX_GetParam("QUERY_STRING", hdrp);
- if (qs) {
- qs_len = strlen(qs);
- } else {
- qs_len = 0;
- }
-
- if (qs_len > 0) {
- /* Make room for query string and "?" */
- url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1 + qs_len + 2);
- } else {
- url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1);
- }
+ url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1);
strcpy(url, script_name);
strcat(url, path_info);
WOLog(WO_INFO,"<FastCGI> new request: %s",url);
@@ -459,25 +447,28 @@
*/
}
}
-
- WOLog ( WO_INFO, "Content length: %d",req->content_length );
- WOLog ( WO_INFO, "--------Content: %s---",req->content );
- if ( req->content ) {
- content_buffer = (char *)malloc (req->content_length+1);
- strncpy (content_buffer,req->content,req->content_length);
- content_buffer[req->content_length] = '\0';
- WOLog ( WO_INFO, "---content buffer: %s",content_buffer );
- strncpy (req->content,content_buffer,req->content_length+1);
- free (content_buffer);
- }
- //WOLog ( WO_INFO, "Content_length: %d, real: %d", req->content_length,strlen (req->content) );
+
+ WOLog(WO_INFO, "Content length: %d",req->content_length);
+ WOLog(WO_INFO, "--------Content: %s---",req->content);
+ if (req->content) {
+ content_buffer = (char *)WOMALLOC(req->content_length+1);
+ strncpy(content_buffer,req->content,req->content_length);
+ content_buffer[req->content_length] = '\0';
+ WOLog(WO_INFO, "---content buffer: %s",content_buffer);
+ strncpy(req->content,content_buffer,req->content_length+1);
+ WOFREE(content_buffer);
+ }
+ //WOLog ( WO_INFO, "Content_length: %d, real: %d", req->content_length,strlen (req->content) );
/* Always get the query string */
- /* Don't add ? if the query string is empty. */
+ qs = FCGX_GetParam("QUERY_STRING", hdrp);
+ if (qs) {
+ qs_len = strlen(qs);
+ } else {
+ qs_len = 0;
+ }
+
if (qs_len > 0) {
- /* Add the query string to the full URL - useful for debugging */
- strcat(url, "?");
- strcat(url, qs);
wc.queryString.start = qs;
wc.queryString.length = qs_len;
WOLog(WO_INFO,"<FastCGI> new request with Query String: %s", qs);
@@ -493,10 +484,10 @@
resp_free(resp); /* dump the response */
}
-#if defined(FINDLEAKS)
- WOFREE(url); /* just for neatness */
+ WOFREE(url);
req_free(req);
+#if defined(FINDLEAKS)
showleaks();
#endif
}

View File

@ -0,0 +1,38 @@
--- Makefile.orig Tue Jul 4 13:02:19 2006
+++ Makefile Thu Apr 12 13:34:51 2007
@@ -21,7 +21,7 @@
touch ${COMMON_TARGETS}
for adaptor in $(ADAPTORS) Adaptor ; do \
echo Cleaning $$adaptor ; \
- ( cd $${adaptor} ; make clean ) ; \
+ ( cd $${adaptor} ; $(MAKE) $(MFLAGS) clean ) ; \
done
OS_NOT_DEFINED:
@@ -29,22 +29,9 @@
exit 1
${COMMON_TARGETS}: Adaptor
- cd Adaptor ; make
+ cd Adaptor ; $(MAKE) $(MFLAGS)
-CGI::
- cd CGI ; make
+$(ADAPTORS) :
+ $(MAKE) -C $@ $(MFLAGS)
-Apache::
- cd Apache ; make
-
-Apache2::
- cd Apache2 ; make
-
-Apache2.2::
- cd Apache2.2 ; make
-
-IIS::
- cd IIS ; make
-
-NSAPI::
- cd NSAPI ; make
+.PHONY: all clean $(ADAPTORS)

View File

@ -0,0 +1,18 @@
*** make.config.orig Tue Jul 4 13:02:19 2006
--- make.config Thu Apr 12 16:20:41 2007
***************
*** 78,83 ****
--- 78,90 ----
endif
#end Linux
+ # FreeBSD
+ ifeq "FreeBSD" "$(OS)"
+ ADAPTORS ?= CGI Apache
+ APXS ?= /usr/local/sbin/apxs
+ endif
+ #end FreeBSD
+
# If you are building NSAPI uncomment this and specify where Netscape is installed.
# This is typically /opt/netscape/suitespot
# NS_ROOT =

View File

@ -0,0 +1,22 @@
#!/bin/sh
#
# $FreeBSD$
#
PATH=/bin:/usr/bin:/usr/sbin
APACHE=%%APACHE%%
APACHECONFDIR=${PKG_PREFIX}/%%APACHECONFDIR%%
APACHEETCDIR=${PKG_PREFIX}/%%APACHEETCDIR%%
case $2 in
DEINSTALL)
if [ "x${APACHE}" = "x" ]; then
cd ${APACHECONFDIR} || exit 1
for f in webobjects.conf; do
cmp -s -z ${f} "${APACHEETCDIR}/${f}-dist" && rm ${f}
done
fi
;;
POST-DEINSTALL)
;;
esac
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
#
# $FreeBSD$
#
PATH=/bin:/usr/bin:/usr/sbin
APACHE=%%APACHE%%
APACHECONFDIR=${PKG_PREFIX}/%%APACHECONFDIR%%
APACHEETCDIR=${PKG_PREFIX}/%%APACHEETCDIR%%
CP=/bin/cp
case $2 in
PRE-INSTALL)
;;
POST-INSTALL)
if [ "x${APACHE}" = "x" ]; then
if [ ! -e ${APACHECONFDIR}/webobjects.conf ]; then
${CP} ${APACHEETCDIR}/webobjects.conf-dist \
${APACHECONFDIR}/webobjects.conf
fi
fi
;;
esac
exit 0

View File

@ -0,0 +1,2 @@

View File

@ -0,0 +1,70 @@
<IfModule mod_WebObjects.c>
# Path to the Document Root of your Webserver,
# it should contain a directory named WebObjects
WebObjectsDocumentRoot %%PREFIX%%/%%WODOCROOT%%
# You can change the 'cgi-bin' part of WebObjectsAlias to whatever you
# prefer (such as Apps), but the 'WebObjects' part is required.
WebObjectsAlias /cgi-bin/WebObjects
# We set a specific allow rule to prevent default restrictions from denying
# access to the module
<Location /cgi-bin/WebObjects>
Allow from All
</Location>
# Point /WebObjects requests to the installed document root
Alias /WebObjects %%PREFIX%%/%%WODOCROOT%%/WebObjects
<Location /WebObjects>
Options -Indexes
Allow from All
</Location>
# Here are the 3 possible configuration modes.
# The apache module uses one of them to get information
# about your deployed applications.
# 1085 is the reserved port on which wotaskd processes listen to by default.
# Host List Configuration
# wotaskd is started automatically on supported platforms,
# so this is the default mode.
# The apache module gets its configuration from the wotaskds
# listed on the configuration line
# For multiple hosts:
# WebObjectsConfig http://<name-of-a-host>:<port-on-a-host>,http://<name-of-another-host>:<port-on-a-host> <interval>
# For localhost:
WebObjectsConfig http://localhost:1085 10
# Multicast Configuration
# The apache module gets its configuration from all wotaskds
# that respond to the multicast call on the subnet
# WebObjectsConfig webobjects://239.128.14.2:1085 10
# File Configuration
# The apache module gets its configuration from one file
# WebObjectsConfig file://<path-to-a-xml-config-file> 10
# To enable public access to the WOAdaptorInfo page, uncomment the following line
# WebObjectsAdminUsername public
# To enable the WOAdaptorInfo page with restricted access,
# uncomment the next two lines and set the user and password
# To access the WOAdaptorInfo page with restricted access, use
# a URL like: http://webserver/cgi-bin/WebObjects/WOAdaptorInfo?user+password.
# WebObjectsAdminUsername user
# WebObjectsAdminPassword password
# To change the logging options, read the following comments:
# The option name is "WebObjectsLog" and the first value indicates the path
# of the log file.
# The second value indicates the log level. There are five, in decreasing
# informational order:
# "Debug", "Info", "Warn", "Error", "User"
#
# Note: To enable logging, touch '/tmp/logWebObjects'
# as the administrative user (usually root).
#
# The following line is the default:
# WebObjectsLog /tmp/WebObjects.log Debug
</IfModule>

View File

@ -0,0 +1,62 @@
#!/bin/sh
# $FreeBSD$
# PROVIDE: woadaptor
# REQUIRE: DEAMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Define these woadaptor_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
name="woadaptor"
woadaptor_enable="${woadaptor_enable:-NO}"
woadaptor_user="${woadaptor_user:-%%USER%%}"
woadaptor_socket="${woadaptor_socket:-/tmp/woadaptor.sock}"
woadaptor_processes="${woadaptor_processes:-10}"
woadaptor_configurl="${woadaptor_configurl:-http://localhost:1085}"
woadaptor_username="${woadaptor_username:-disabled}"
woadaptor_password="${woadaptor_password:-disabled}"
. /etc/rc.subr
rcvar=`set_rcvar`
load_rc_config $name
runuser="${woadaptor_user}"
username="${woadaptor_username}"
password="${woadaptor_password}"
procname="%%PREFIX%%/libexec/WebObjects-fcgi"
fcgi_command="%%PREFIX%%/bin/cgi-fcgi"
fcgi_args="-start -connect ${woadaptor_socket} ${procname} ${woadaptor_processes}"
command="/usr/sbin/daemon"
command_args="${fcgi_command} ${fcgi_args}"
start_precmd="start_precmd"
start_precmd()
{
if [ "x${runuser}" = "xroot" ]; then
err 1 "You have to set ${name}_user to a non-root user for security reasons"
fi
if [ "x${username}" != "x" -a "x${username}" != "disabled" ]; then
WO_ADAPTOR_INFO_USERNAME=${username}
if [ "${username}" != "public" ]; then
WO_ADAPTOR_INFO_PASSWORD=${password}
fi
else
unset WO_ADAPTOR_INFO_USERNAME
unset WO_ADAPTOR_INFO_PASSWORD
fi
export WO_CONFIG_URL=${woadaptor_configurl}
export WO_ADAPTOR_INFO_USERNAME WO_ADAPTOR_INFO_PASSWORD
rm -f /tmp/WOAdaptorState
}
run_rc_command "$1"

7
www/woadaptor/pkg-descr Normal file
View File

@ -0,0 +1,7 @@
WOAdaptor is a collection of WebObjects WebServer Adaptors.
These include an Apache Module, CGI and FastCGI adaptors
This is a subproject of Project Wonder and is an effort to pool enhancements
and bug fixes for Apple's open source codebase.
WWW: http://wonder.sourceforge.net/WOAdaptor.html

16
www/woadaptor/pkg-plist Normal file
View File

@ -0,0 +1,16 @@
%%APACHE%%%%APACHEETCDIR%%/webobjects.conf-dist
%%APACHE%%%%APACHEMODDIR%%/mod_WebObjects.so
%%APACHE%%@exec %D/sbin/apxs -e -a -n WebObjects %f || true
%%APACHE%%@unexec %D/sbin/apxs -e -A -n WebObjects %f || true
%%CGI%%libexec/WebObjects
%%FASTCGI%%libexec/WebObjects-fcgi
%%FASTCGI%%%%DATADIR%%/apache.conf
%%FASTCGI%%%%DATADIR%%/nginx.conf
%%FASTCGI%%%%DATADIR%%/lighttpd.conf
%%PORTDOCS%%%%CGI%%%%DOCSDIR%%/Installation.html
%%PORTDOCS%%%%FASTCGI%%%%DOCSDIR%%/README-fcgi
%%PORTDOCS%%%%DOCSDIR%%/example.xml
%%PORTDOCS%%%%DOCSDIR%%/woadaptor.dtd
%%PORTDOCS%%%%DOCSDIR%%/woadaptor.xml
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrmtry %%DATADIR%%