aboutsummaryrefslogtreecommitdiffstats
path: root/www/apache20
diff options
context:
space:
mode:
authorclement <clement@FreeBSD.org>2004-06-05 19:14:18 +0800
committerclement <clement@FreeBSD.org>2004-06-05 19:14:18 +0800
commit8736be1c4d7f55f629bb3701d0b62617c301d62e (patch)
treed69c6b82fa2d634cfd393e31c9fb0737497e8e14 /www/apache20
parent71446ae446e22cae58a3c115830d7f35f224bb1d (diff)
downloadfreebsd-ports-gnome-8736be1c4d7f55f629bb3701d0b62617c301d62e.tar.gz
freebsd-ports-gnome-8736be1c4d7f55f629bb3701d0b62617c301d62e.tar.zst
freebsd-ports-gnome-8736be1c4d7f55f629bb3701d0b62617c301d62e.zip
-1- make show-options readable from a vt100 ;-)
-2- add WITH_DEBUG knob (supports DEBUG_FLAGS) -3- convert start script to RCng [1] - add possibility to run limits(1) before apache starts - apache2.sh reload = apachectl graceful -4- Add threadpool MPM -5- Adapt COMMENT to fit MPM. -6- Bump PORTREVISION PR: ports/66955 [1] Submitted by: nork [1] (partially) Requested by: ume [1]
Diffstat (limited to 'www/apache20')
-rw-r--r--www/apache20/Makefile21
-rw-r--r--www/apache20/Makefile.doc47
-rw-r--r--www/apache20/Makefile.modules13
-rw-r--r--www/apache20/files/apache.sh66
-rw-r--r--www/apache20/pkg-message19
-rw-r--r--www/apache20/pkg-plist1
6 files changed, 124 insertions, 43 deletions
diff --git a/www/apache20/Makefile b/www/apache20/Makefile
index 2436be2cb027..844c2dd78400 100644
--- a/www/apache20/Makefile
+++ b/www/apache20/Makefile
@@ -9,7 +9,7 @@
PORTNAME= apache
PORTVERSION= 2.0.49
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www ipv6
MASTER_SITES= ${MASTER_SITE_APACHE_HTTPD} \
http://sheepkiller.nerim.net/ports/${PORTNAME}/:powerlogo
@@ -19,7 +19,7 @@ DIST_SUBDIR= apache2
EXTRACT_ONLY= ${DISTNAME}.tar.gz
MAINTAINER?= clement@FreeBSD.org
-COMMENT?= Version 2 of the extremely popular Apache http server
+COMMENT?= Version 2 of Apache web server with ${WITH_MPM:L} MPM.
LIB_DEPENDS= expat.5:${PORTSDIR}/textproc/expat2
@@ -47,6 +47,7 @@ SCRIPTS_ENV+= LIBTOOL=${LIBTOOL} LIBTOOLIZE=${LIBTOOLIZE} \
USE_AUTOCONF_VER= 257
USE_LIBTOOL_VER= 15
USE_PERL5= yes
+USE_RC_SUBR= yes
USE_REINPLACE= yes
LIBTOOLFILES= configure
@@ -64,7 +65,8 @@ CONFIGURE_ENV= CC="${CC}" CPPFLAGS="${CPPFLAGS}" \
LOCALBASE="${LOCALBASE}"
PREFIX_RELDEST= ${PREFIX:S,^${DESTDIR},,}
-RC_SUB= -e 's,@@PREFIX@@,${PREFIX_RELDEST},g'
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} WWWOWN=${WWWOWN}
+
MAKE_ENV+= DESTDIR=${DESTDIR} EXPR_COMPAT=yes
WITH_MPM?= prefork # or worker, perchild
@@ -87,6 +89,13 @@ CONFIGURE_ARGS+= --enable-static-support
CFLAGS+= -DSSL_EXPERIMENTAL_ENGINE
.endif
+# debug overrides CFLAGS
+.if defined(WITH_DEBUG) || defined (DEBUG_FLAGS)
+DEBUG_FLAGS?= -O0 -g -ggdb3
+CFLAGS= ${DEBUG_FLAGS}
+CONFIGURE_ARGS+= --enable-maintainer-mode
+.endif
+
# for slave ports
.if !defined(MASTERDIR)
APACHEDIR= ${.CURDIR}
@@ -167,8 +176,9 @@ post-patch:
ALT="[Powered by FreeBSD]"><IMG SRC="apache_pb2_ani,g' $$f \
); done
@${RM} -f ${WRKSRC}/docs/docroot/*.bak
- @${SED} ${RC_SUB} ${FILESDIR}/apache.sh >${WRKDIR}/apache2.sh
- @${SED} ${RC_SUB} ${FILESDIR}/config.layout >>${WRKSRC}/config.layout
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/apache.sh > ${WRKDIR}/apache2.sh
+ @${CAT} ${FILESDIR}/config.layout >>${WRKSRC}/config.layout
@${RM} -f ${WRKSRC}/docs/manual/index.html.ko.euc-kr
@${REINPLACE_CMD} -e 's," PLATFORM ",FreeBSD,' \
${WRKSRC}/server/core.c
@@ -181,5 +191,6 @@ post-install:
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache2.sh startup file."; \
${INSTALL_SCRIPT} -m 751 ${WRKDIR}/apache2.sh ${PREFIX}/etc/rc.d/apache2.sh; \
fi
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/www/apache20/Makefile.doc b/www/apache20/Makefile.doc
index 22e3c49f4fbb..d96eecfb7e27 100644
--- a/www/apache20/Makefile.doc
+++ b/www/apache20/Makefile.doc
@@ -14,7 +14,8 @@
## Apache-related
## WITH_MPM: prefork (default)
## worker
-## perchild
+## perchild (deprecated)
+## threadpool (testing purpose only)
## WITH_HTTP_PORT: default: 80
## WITH_LDAP: Enable LDAP support (mod_auth_ldap)
## WITHOUT_PROXY: Disable proxy support
@@ -22,20 +23,28 @@
## WITHOUT_AUTH: Disable auth modules
## WITH_CUSTOM_AUTH: Let you choose which auth modules you wish
## WITHOUT_DAV: Disable DAV support
-## WITH_IPV6_V6ONLY: Don't allow IPv6 sockets to handle IPv4 connections
+## WITH_IPV6_V6ONLY: Don't allow IPv6 sockets to handle IPv4
+## connections
## WITHOUT_SSL: Disable SSL support
## WITH_THREADS: Enable threads support !! USE IT WITH CARE !!
## WITH_CUSTOM_THREADS: Let you choose which threaded modules you want
-## WITH_DBM: Choose your DBM: bdb (Berkeley DB), gdbm or ndbm (default)
-## WITH_BERKELEYDB: Choose your BerkeleyDB version: db2, db3, db4, db41, db42 or FreeBSD (1.85)(default)
+## WITH_DBM: Choose your DBM: bdb (Berkeley DB), gdbm or
+## ndbm (default)
+## WITH_BERKELEYDB: Choose your BerkeleyDB version: db2, db3,
+## db4, db41, db42 or FreeBSD (1.85)(default)
## WITH_STATIC_SUPPORT: Build statically linked support binaries
-## WITH_STATIC_APACHE: Build a static version of httpd (implies WITH_STATIC_MODULES)
+## WITH_STATIC_APACHE: Build a static version of httpd (implies
+## WITH_STATIC_MODULES)
## WITH_ALL_STATIC_MODULES: All modules will be statically linked.
-## WITH_STATIC_MODULES: List of modules to build modules statics (usefull for slave ports)
-## (They must be already enabled (i.e. WITH_MODULES or with default configuration
-## use 'make show-modules', to check if they are enabled)
+## WITH_STATIC_MODULES: List of modules to build modules statics
+## (usefull for slave ports)
+## (They must be already enabled (i.e.
+## WITH_MODULES or with default configuration
+## use 'make show-modules', to check if they are
+## enabled)
## WITH_EXPERIMENTAL: Build and install experimental modules
-## WITH_EXTRA_MODULES: Use this to support additional modules (plist entry is NOT currently supported)
+## WITH_EXTRA_MODULES: Use this to support additional modules (plist
+## entry is NOT yet supported)
## WITH_MODULES: List of your own modules
## WITHOUT_MODULES: Disable listed modules
## WITH_SUEXEC: Enable suExec support
@@ -44,20 +53,28 @@
## SUEXEC_SAFEPATH: Set the safepath
## SUEXEC_UIDMIN: Minimal allowed UID (default 1000)
## SUEXEC_GIDMIN: Minimal allowed GID (default 1000)
-## SUEXEC_CALLER: User allowed to call SuExec (default ${WWWOWN} (www))
+## SUEXEC_CALLER: User allowed to call SuExec (default
+## ${WWWOWN} (www))
+## WITH_DEBUG: Build a debug versoin of apache (set CFLAGS
+## to "-O0 -g -ggdb3" too)
##
## Port-related:
-## WITHOUT_WWW: Implies NO_CGI, NO_WWWDATA, NO_ICONS and NO_ERROR
-## WITH_CUSTOM_WWW: Let you choose your ${LOCALBASE}/www components: [cgi|errordocs|icons|wwwdata]
-## WITH_APR_FROM_PORTS: Utilise apr and apr-utils from ${PORTSDIR}/devel/apr
+## WITHOUT_WWW: Implies NO_CGI, NO_WWWDATA, NO_ICONS and
+## NO_ERROR
+## WITH_CUSTOM_WWW: Let you choose your ${LOCALBASE}/www components
+## [cgi|errordocs|icons|wwwdata]
+## WITH_APR_FROM_PORTS: Utilise apr and apr-utils from
+## ${PORTSDIR}/devel/apr
##
## Available make targets:
## show-options: prints this message
## show-modules: prints list of available modules
##
## Examples:
-## make WITHOUT_SSL=yes WITH_EXTRA_MODULES="bucketeer case_filter case_filter_in" WITHOUT_PROXY=yes
-## make WITH_STATIC_MODULES="ssl rewrite include" WITH_EXPERIMENTAL=yes WITH_CUSTOM_AUTH="auth auth_dbm"
+## make WITHOUT_SSL=yes WITH_EXTRA_MODULES="bucketeer case_filter \
+## case_filter_in" WITHOUT_PROXY=yes
+## make WITH_STATIC_MODULES="ssl rewrite include" WITH_EXPERIMENTAL=yes \
+## WITH_CUSTOM_AUTH="auth auth_dbm"
## make WITH_EXPERIMENTAL=yes WITHOUT_MODULES="access speling status"
## make WITH_MODULES="include rewrite auth"
##
diff --git a/www/apache20/Makefile.modules b/www/apache20/Makefile.modules
index f6c357f42d96..95926bc2b2b9 100644
--- a/www/apache20/Makefile.modules
+++ b/www/apache20/Makefile.modules
@@ -26,17 +26,19 @@ PKGNAMESUFFIX= -${SLAVE_PORT_MPM}
PKGNAMESUFFIX= -${WITH_MPM:L}
WITH_THREADS= yes
. if ${WITH_MPM:L} == "worker"
-PLIST_SUB+= PREFORK="@comment " WORKER=""
+PLIST_SUB+= PREFORK="@comment " WORKER="" THREADPOOL="@comment "
. elif ${WITH_MPM:L} == "perchild"
-PLIST_SUB+= PREFORK="@comment " WORKER="@comment "
+PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL="@comment "
+. elif ${WITH_MPM:L} == "threadpool"
+PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL=""
. else
IGNORE= "Unknown MPM: ${WITH_MPM}"
. endif
. else
-PLIST_SUB+= PREFORK="@comment " WORKER="@comment "
+PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL="@comment "
. endif
.else
-PLIST_SUB+= PREFORK="@comment " WORKER="@comment "
+PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL="@comment "
.endif
# xDBM section
@@ -187,9 +189,6 @@ _APACHE_MODULES+= ${WITH_CUSTOM_THREADS}
.if !defined(WITHOUT_SSL)
_APACHE_MODULES+= ${SSL_MODULE}
CONFIGURE_ARGS+= --with-ssl=${OPENSSLBASE}
-RC_SUB+= -e 's,@@SSL@@,ssl,g'
-.else
-RC_SUB+= -e 's,@@SSL@@,,g'
.endif
.if defined(WITH_SUEXEC)
diff --git a/www/apache20/files/apache.sh b/www/apache20/files/apache.sh
index ab1a71895d0c..0ed476f53974 100644
--- a/www/apache20/files/apache.sh
+++ b/www/apache20/files/apache.sh
@@ -1,17 +1,51 @@
#!/bin/sh
-PREFIX=@@PREFIX@@
-
-case "$1" in
-start)
- [ "@@SSL@@" = "ssl" -a -f "$PREFIX/etc/apache2/ssl.crt/server.crt" ] && SSL=ssl
- [ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start${SSL} > /dev/null && echo -n ' apache2'
- ;;
-stop)
- [ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > /dev/null && echo -n ' apache2'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
+#
+# $FreeBSD$
+#
+
+# PROVIDE: apache2
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable apache2:
+# apache2_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable apache2
+# apache2ssl_enable (bool): Set to "NO" by default.
+# Set it to "YES" to start apache with SSL
+# (if <IfDefined SSL> exists in httpd.conf)
+# apache2limits_enable (bool):Set to "NO" by default.
+# Set it to yes to run `limits $limits_args`
+# just before apache starts.
+# apache2_flags (str): Set to "" by default.
+# Extra flags passed to start command
+# apache2limits_args (str): Default to "-e -U %%WWWOWN%%"
+# Arguments of pre-start limits run.
+#
+. %%RC_SUBR%%
+
+name="apache2"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/httpd"
+pidfile="/var/run/httpd.pid"
+required_files=%%PREFIX%%/etc/apache2/httpd.conf
+
+[ -z "$apache2_enable" ] && apache2_enable="NO"
+[ -z "$apache2ssl_enable" ] && apache2ssl_enable="NO"
+[ -z "$apache2_flags" ] && apache2_flags=""
+[ -z "$apache2limits_enable" ] && apache2limits_enable="NO"
+[ -z "$apache2limits_args" ] && apache2limits_args="-e -U %%WWWOWN%%"
+
+load_rc_config $name
+
+checkyesno apache2ssl_enable && \
+ apache2_flags="-DSSL $apache2_flags"
+
+checkyesno apache2limits_enable && \
+ start_precmd="`/usr/bin/limits ${apache2limits_args}`"
+
+sig_reload=SIGUSR1
+
+run_rc_command "$1"
diff --git a/www/apache20/pkg-message b/www/apache20/pkg-message
new file mode 100644
index 000000000000..8af905c6c066
--- /dev/null
+++ b/www/apache20/pkg-message
@@ -0,0 +1,19 @@
+ ***********************************
+ * !!!!!!!!!!! WARNING !!!!!!!!!!! *
+ ***********************************
+Since 2.0.49_2, apache startup script is now enabled/disabled via
+rc.subr.
+Available variables:
+- apache2_enable (bool): Set to "NO" by default.
+ Set it to "YES" to enable apache2
+- apache2ssl_enable (bool): Set to "NO" by default.
+ Set it to "YES" to start apache with SSL
+ (if <IfDefined SSL> exists in httpd.conf)
+- apache2limits_enable (bool):Set to "NO" by default.
+ Set it to yes to run `limits $limits_args`
+ just before apache starts.
+- apache2_flags (str): Set to "" by default.
+ Extra flags passed to start command
+- apache2limits_args (str): Default to "-e -U %%WWWOWN%%"
+ Arguments of pre-start limits run.
+
diff --git a/www/apache20/pkg-plist b/www/apache20/pkg-plist
index 3f1aad3ebb27..732c868ecbbb 100644
--- a/www/apache20/pkg-plist
+++ b/www/apache20/pkg-plist
@@ -88,6 +88,7 @@ include/apache2/ap_release.h
%%PORTS_APR%%include/apache2/apu_version.h
%%PORTS_APR%%include/apache2/apu_want.h
%%WORKER%%include/apache2/fdqueue.h
+%%THREADPOOL%%include/apache2/pod.h
include/apache2/http_config.h
include/apache2/http_connection.h
include/apache2/http_core.h