aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-08-03 12:55:09 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-08-03 12:57:46 +0000
commit067aef21abcefcef888a7c72ccf4d1ee4e787a78 (patch)
tree61db84986f00304b9f6a10ffde0f2e253c0973ff
parentee389ee87635e6b433dbaaab6a3b4e17ec98b0bc (diff)
downloadalpine_aports-067aef21abcefcef888a7c72ccf4d1ee4e787a78.tar.bz2
alpine_aports-067aef21abcefcef888a7c72ccf4d1ee4e787a78.tar.xz
alpine_aports-067aef21abcefcef888a7c72ccf4d1ee4e787a78.zip
testing/apache: new aport
A high performance Unix-based HTTP server http://httpd.apache.org/
-rw-r--r--testing/apache/APKBUILD153
-rw-r--r--testing/apache/alpine.layout22
-rw-r--r--testing/apache/apache2.confd82
-rwxr-xr-xtesting/apache/apache2.initd154
-rw-r--r--testing/apache/apache2.logrotate7
5 files changed, 418 insertions, 0 deletions
diff --git a/testing/apache/APKBUILD b/testing/apache/APKBUILD
new file mode 100644
index 0000000000..512e860099
--- /dev/null
+++ b/testing/apache/APKBUILD
@@ -0,0 +1,153 @@
1# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2pkgname=apache
3pkgver=2.2.16
4pkgrel=0
5pkgdesc="A high performance Unix-based HTTP server"
6url="http://httpd.apache.org/"
7license="APACHE"
8depends=""
9pkgusers="apache"
10pkggroups="apache"
11makedepends="openssl-dev zlib-dev apr-util-dev apr-dev pcre-dev"
12subpackages="$pkgname-dev $pkgname-doc $pkgname-utils"
13source="http://archive.apache.org/dist/httpd/httpd-$pkgver.tar.bz2
14 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/02-rename-prefork-to-itk.patch
15 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/03-add-mpm-to-build-system.patch
16 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/04-correct-output-makefile-location.patch
17 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/05-add-copyright.patch
18 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/06-hook-just-after-merging-perdir-config.patch
19 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/07-base-functionality.patch
20 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/08-max-clients-per-vhost.patch
21 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/09-capabilities.patch
22 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/10-nice.patch
23 apache2.confd
24 apache2.logrotate
25 apache2.initd
26 alpine.layout"
27
28prepare() {
29 cd "$srcdir"/httpd-$pkgver
30 sed -e 's#User daemon#User apache#' \
31 -e 's#Group daemon#Group apache#' \
32 -i docs/conf/httpd.conf.in || return 1
33 cat "$srcdir/alpine.layout" >> config.layout
34
35 cd "$srcdir"
36
37 # create symlinks to soruces for prefork and worker
38 ln -s httpd-$pkgver prefork
39 ln -s httpd-$pkgver worker
40
41 # make a patched clone of itk sources
42 cp -ra httpd-$pkgver itk
43 cd itk
44 mkdir -p server/mpm/experimental/itk
45 cp -r server/mpm/prefork/* \
46 server/mpm/experimental/itk/ || return 1
47 mv server/mpm/experimental/itk/prefork.c \
48 server/mpm/experimental/itk/itk.c || return 1
49 patch -Np1 -i "$srcdir/02-rename-prefork-to-itk.patch" || return 1
50 patch -Np1 -i "$srcdir/03-add-mpm-to-build-system.patch" || return 1
51 patch -Np1 -i "$srcdir/04-correct-output-makefile-location.patch" || return 1
52 patch -Np1 -i "$srcdir/05-add-copyright.patch" || return 1
53 patch -Np1 -i "$srcdir/06-hook-just-after-merging-perdir-config.patch" || return 1
54 patch -Np1 -i "$srcdir/07-base-functionality.patch" || return 1
55 patch -Np1 -i "$srcdir/08-max-clients-per-vhost.patch" || return 1
56 patch -Np1 -i "$srcdir/09-capabilities.patch" || return 1
57 patch -Np1 -i "$srcdir/10-nice.patch" || return 1
58 autoconf || return 1
59}
60
61build () {
62 local mpm
63 for mpm in prefork worker itk; do
64 mkdir "$srcdir"/build-${mpm}
65 cd "$srcdir"/build-${mpm}
66
67 "$srcdir"/$mpm/configure --prefix=/usr \
68 --enable-layout=Alpine \
69 --enable-modules=all \
70 --enable-mods-shared=all \
71 --enable-so \
72 --enable-suexec \
73 --with-suexec-caller=http \
74 --with-suexec-docroot=/var/www/localhost/htdocs \
75 --with-suexec-logfile=/var/log/httpd/suexec.log \
76 --with-suexec-bin=/usr/sbin/suexec \
77 --with-suexec-uidmin=99 \
78 --with-suexec-gidmin=99 \
79 --enable-ldap \
80 --enable-authnz-ldap \
81 --enable-cache \
82 --enable-disk-cache \
83 --enable-mem-cache \
84 --enable-file-cache \
85 --enable-ssl \
86 --with-ssl \
87 --enable-deflate \
88 --enable-cgid \
89 --enable-proxy \
90 --enable-proxy-connect \
91 --enable-proxy-http \
92 --enable-proxy-ftp \
93 --enable-dbd \
94 --with-apr=/usr/bin/apr-1-config \
95 --with-apr-util=/usr/bin/apu-1-config \
96 --with-pcre=/usr \
97 --with-mpm=${mpm} \
98 || return 1
99 make || return 1
100 done
101}
102
103package() {
104 cd "$srcdir"/build-prefork
105 make -j1 DESTDIR="$pkgdir" install || return 1
106 for mpm in worker itk; do
107 install -m755 "$srcdir"/build-$mpm/httpd \
108 "$pkgdir/usr/sbin/httpd.${mpm}" || return 1
109 done
110
111 install -D -m755 "$srcdir/apache2.initd" \
112 "$pkgdir/etc/init.d/apache2" || return 1
113 install -D -m644 "$srcdir/apache2.logrotate" \
114 "$pkgdir/etc/logrotate.d/apache2" || return 1
115 install -D -m644 "$srcdir/apache2.confd" \
116 "$pkgdir/etc/conf.d/apache2" || return 1
117
118 install -d "$pkgdir"/var/www
119 ln -fs /var/log/httpd "$pkgdir/var/www/logs"
120 ln -fs /var/run/httpd "$pkgdir/var/www/run"
121 ln -fs /usr/lib/httpd/modules "$pkgdir/var/www/modules"
122 sed -e 's#/usr/lib/httpd/modules/#modules/#' \
123 -e 's|#\(Include conf/extra/httpd-multilang-errordoc.conf\)|\1|'\
124 -e 's|#\(Include conf/extra/httpd-autoindex.conf\)|\1|' \
125 -e 's|#\(Include conf/extra/httpd-languages.conf\)|\1|' \
126 -e 's|#\(Include conf/extra/httpd-userdir.conf\)|\1|' \
127 -e 's|#\(Include conf/extra/httpd-default.conf\)|\1|' \
128 -e 's|/srv/http|/var/www/localhost|g' \
129 -i "$pkgdir/etc/apache2/httpd.conf" || return 1
130}
131
132utils() {
133 pkgdesc="Apache utility programs for webservers"
134 install -d "$subpkgdir"/usr/bin "$subpkgdir"/usr/sbin
135 cd "$pkgdir"/usr/sbin
136 mv ab dbmmanage htdbm htdigest htpasswd logresolve "$subpkgdir"/usr/bin
137 mv checkgid htcacheclean rotatelogs "$subpkgdir"/usr/sbin
138}
139
140md5sums="c8ff2a07c884300bc7766a2e7f662d33 httpd-2.2.16.tar.bz2
141db42cfcc18ae1c32aaaff2347e35b79d 02-rename-prefork-to-itk.patch
142131408ad4dc7b18547b4e062e7e495ab 03-add-mpm-to-build-system.patch
143ee488f391054d528547c3a372faa2aa7 04-correct-output-makefile-location.patch
144b202944761b2f0516196488b12504236 05-add-copyright.patch
14578fa15f8ca3a284b7d71f942e24e47fb 06-hook-just-after-merging-perdir-config.patch
146d33e39350e987721d50e6fb8e164ab6b 07-base-functionality.patch
1479f7a8935f9cabc7b46d0052906634cef 08-max-clients-per-vhost.patch
1481b28e3363e1b0d05b738a21e7ddd264f 09-capabilities.patch
149d9667fcd2ffecc63e446edd4d6666731 10-nice.patch
150f3e4f5eed88d97d1bbadd0597562bc28 apache2.confd
151d91a9a7196b10ef0bc4ab5b98ea9ccd9 apache2.logrotate
1520261136ff734c3ae8dcf878a46ed5830 apache2.initd
153af943bf52cec8088974084639661ba34 alpine.layout"
diff --git a/testing/apache/alpine.layout b/testing/apache/alpine.layout
new file mode 100644
index 0000000000..7146971d2a
--- /dev/null
+++ b/testing/apache/alpine.layout
@@ -0,0 +1,22 @@
1<Layout Alpine>
2 prefix: /usr
3 exec_prefix: ${prefix}
4 bindir: ${prefix}/bin
5 sbindir: ${prefix}/sbin
6 libdir: ${prefix}/lib
7 libexecdir: ${prefix}/lib+
8 mandir: ${prefix}/share/man
9 sysconfdir: /etc+
10 datadir: ${usr}/share+
11 installbuilddir: ${datadir}/build
12 errordir: ${datadir}/error
13 iconsdir: ${datadir}/icons
14 htdocsdir: /var/www/localhost/htdocs
15 manualdir: /usr/share/doc/apache2/manual
16 cgidir: /var/www/cgi-bin
17 includedir: /usr/include+
18 localstatedir: /var
19 runtimedir: ${localstatedir}/run+
20 logfiledir: ${localstatedir}/log+
21 proxycachedir: ${localstatedir}/cache+
22</Layout>
diff --git a/testing/apache/apache2.confd b/testing/apache/apache2.confd
new file mode 100644
index 0000000000..0297b57906
--- /dev/null
+++ b/testing/apache/apache2.confd
@@ -0,0 +1,82 @@
1# /etc/conf.d/apache2: config file for /etc/init.d/apache2
2
3#
4# The default processing model (MPM) is the process-based
5# 'prefork' model. A thread-based model, 'worker', is also
6# available, but does not work with some modules (such as PHP).
7#
8#HTTPD=/usr/sbin/httpd.worker
9
10HTTPD="/usr/sbin/httpd"
11
12# When you install a module it is easy to activate or deactivate the modules
13# and other features of apache using the HTTPD_OPTS line. Every module should
14# install a configuration in /etc/apache2/modules.d. In that file will have an
15# <IfDefine NNN> directive where NNN is the option to enable that module.
16#
17# Here are the options available in the default configuration:
18#
19# AUTH_DIGEST Enables mod_auth_digest
20# AUTHNZ_LDAP Enables authentication through mod_ldap
21# CACHE Enables mod_cache
22# DAV Enables mod_dav
23# ERRORDOCS Enables default error documents for many languages.
24# INFO Enables mod_info, a useful module for debugging
25# LANGUAGE Enables content-negotiation based on language and charset.
26# LDAP Enables mod_ldap
27# MANUAL Enables /manual/ to be the apache manual (needs apache-doc)
28# MEM_CACHE Enables default configuration mod_mem_cache
29# PROXY Enables mod_proxy
30# SSL Enables SSL
31# SUEXEC Enables running CGI scripts (in USERDIR) through suexec.
32# USERDIR Enables /~username mapping to /home/username/public_html
33#
34#
35# The following two options provide the default virtual host for the HTTP and
36# HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache
37# will not listen for incomming connections on the approriate port.
38#
39# DEFAULT_VHOST Enables name-based virtual hosts, with the default
40# virtual host being in /var/www/localhost/htdocs
41# SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable this
42# when you enable SSL)
43#
44HTTPD_OPTS="-D DEFAULT_VHOST -D LANGUAGE -D INFO"
45
46# Extended options for advanced uses of Apache ONLY
47# You don't need to edit these unless you are doing crazy Apache stuff
48# As not having them set correctly, or feeding in an incorrect configuration
49# via them will result in Apache failing to start
50# YOU HAVE BEEN WARNED.
51
52# PID file
53#PIDFILE=/var/run/apache2/httpd.pid
54
55# timeout for startup/shutdown checks
56#TIMEOUT=10
57
58# ServerRoot setting
59#SERVERROOT=/var/www
60
61# Configuration file location
62# - If this does NOT start with a '/', then it is treated relative to
63# $SERVERROOT by Apache
64#CONFIGFILE=/etc/apache2/httpd.conf
65
66# Location to log startup errors to
67# They are normally dumped to your terminal.
68#STARTUPERRORLOG="/var/log/apache2/startuperror.log"
69
70# A command that outputs a formatted text version of the HTML at the URL
71# of the command line. Designed for lynx, however other programs may work.
72#LYNX="lynx -dump"
73
74# The URL to your server's mod_status status page.
75# Required for status and fullstatus
76#STATUSURL="http://localhost/server-status"
77
78# Method to use when reloading the server
79# Valid options are 'restart' and 'graceful'
80# See http://httpd.apache.org/docs/2.2/stopping.html for information on
81# what they do and how they differ.
82#RELOAD_TYPE="graceful"
diff --git a/testing/apache/apache2.initd b/testing/apache/apache2.initd
new file mode 100755
index 0000000000..03a6d03032
--- /dev/null
+++ b/testing/apache/apache2.initd
@@ -0,0 +1,154 @@
1#!/sbin/runscript
2# Copyright 1999-2007 Gentoo Foundation
3# Distributed under the terms of the GNU General Public License v2
4
5opts="configdump configtest fullstatus graceful gracefulstop modules reload virtualhosts"
6
7depend() {
8 need net
9 use mysql dns logger netmount postgresql
10 after sshd
11}
12
13configtest() {
14 ebegin "Checking ${SVCNAME} configuration"
15 checkconfig
16 eend $?
17}
18
19checkconfd() {
20 PIDFILE="${PIDFILE:-/var/run/apache2/httpd.pid}"
21 TIMEOUT=${TIMEOUT:-10}
22
23 SERVERROOT="${SERVERROOT:-/var/www}"
24 if [ ! -d ${SERVERROOT} ]; then
25 eerror "SERVERROOT does not exist: ${SERVERROOT}"
26 return 1
27 fi
28
29 CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}"
30 [ "${CONFIGFILE#/}" = "${CONFIGFILE}" ] && CONFIGFILE="${SERVERROOT}/${CONFIGFILE}"
31 if [ ! -r "${CONFIGFILE}" ]; then
32 eerror "Unable to read configuration file: ${CONFIGFILE}"
33 return 1
34 fi
35
36 HTTPD_OPTS="${HTTPD_OPTS} -d ${SERVERROOT}"
37 HTTPD_OPTS="${HTTPD_OPTS} -f ${CONFIGFILE}"
38 [ -n "${STARTUPERRORLOG}" ] && HTTPD_OPTS="${HTTPD_OPTS} -E ${STARTUPERRORLOG}"
39 return 0
40
41}
42
43checkconfig() {
44 checkconfd || return 1
45
46 ${HTTPD} ${HTTPD_OPTS} -t 1>/dev/null 2>&1
47 ret=$?
48 if [ $ret -ne 0 ]; then
49 eerror "${SVCNAME} has detected an error in your setup:"
50 ${HTTPD} ${HTTPD_OPTS} -t
51 fi
52
53 return $ret
54}
55
56start() {
57 checkconfig || return 1
58
59 [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
60
61 ebegin "Starting ${SVCNAME}"
62 start-stop-daemon --start \
63 --pidfile ${PIDFILE} \
64 --exec ${HTTPD} \
65 -- ${HTTPD_OPTS} -k start
66 eend $?
67}
68
69stop() {
70 checkconfd || return 1
71
72 ebegin "Stopping ${SVCNAME}"
73 start-stop-daemon --stop --pidfile ${PIDFILE} --exec ${HTTPD} \
74 --retry ${TIMEOUT}
75 eend $?
76}
77
78reload() {
79 RELOAD_TYPE="${RELOAD_TYPE:-graceful}"
80
81 checkconfig || return 1
82 service_started "${SVCNAME}" || return
83
84 if [ "${RELOAD_TYPE}" = "restart" ]; then
85 ebegin "Restarting ${SVCNAME}"
86 ${HTTPD} ${HTTPD_OPTS} -k restart
87 eend $?
88 elif [ "${RELOAD_TYPE}" = "graceful" ]; then
89 ebegin "Gracefully restarting ${SVCNAME}"
90 ${HTTPD} ${HTTPD_OPTS} -k graceful
91 eend $?
92 else
93 eerror "${RELOAD_TYPE} is not a valid RELOAD_TYPE. Please edit /etc/conf.d/${SVCNAME}"
94 fi
95}
96
97graceful() {
98 checkconfig || return 1
99 service_started "${SVCNAME}" || return
100 ebegin "Gracefully restarting ${SVCNAME}"
101 ${HTTPD} ${HTTPD_OPTS} -k graceful
102 eend $?
103}
104
105gracefulstop() {
106 checkconfig || return 1
107 ebegin "Gracefully stopping ${SVCNAME}"
108 start-stop-daemon --stop --pidfile ${PIDFILE} --exec ${HTTPD} \
109 --retry SIGWINCH/${TIMEOUT}
110 eend $?
111}
112
113modules() {
114 checkconfig || return 1
115
116 ${HTTPD} ${HTTPD_OPTS} -M 2>&1
117}
118
119fullstatus() {
120 LYNX="${LYNX:-lynx -dump}"
121 STATUSURL="${STATUSURL:-http://localhost/server-status}"
122
123 if ! service_started "${SVCNAME}"; then
124 eerror "${SVCNAME} not started"
125 elif ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
126 eerror "lynx not found! you need to emerge www-client/lynx"
127 else
128 ${LYNX} ${STATUSURL}
129 fi
130}
131
132virtualhosts() {
133 checkconfd || return 1
134 ${HTTPD} ${HTTPD_OPTS} -S
135}
136
137configdump() {
138 LYNX="${LYNX:-lynx -dump}"
139 INFOURL="${INFOURL:-http://localhost/server-info}"
140
141 checkconfd || return 1
142
143 if ! service_started "${SVCNAME}"; then
144 eerror "${SVCNAME} not started"
145 elif ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
146 eerror "lynx not found! you need to emerge www-client/lynx"
147 else
148 echo "${HTTPD} started with '${HTTPD_OPTS}'"
149 for i in config server list; do
150 ${LYNX} "${INFOURL}/?${i}" | sed '/Apache Server Information/d;/^[[:space:]]\+[_]\+$/Q'
151 done
152 fi
153}
154
diff --git a/testing/apache/apache2.logrotate b/testing/apache/apache2.logrotate
new file mode 100644
index 0000000000..1264341468
--- /dev/null
+++ b/testing/apache/apache2.logrotate
@@ -0,0 +1,7 @@
1/var/log/apache2/*log {
2 postrotate
3 if /etc/init.d/apache2 status; then
4 /etc/init.d/apache2 reload --quiet || true
5 fi
6 endscript
7}