Commit d319d97c authored by Natanael Copa's avatar Natanael Copa

testing/apache2: add default config

ship a default config based on fedora's

build optimization, dont build modules for the mpms.

remove the gentoo specific parts from /etc/conf.d/apache2
parent bc5d0bea
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apache2
pkgver=2.2.16
pkgrel=0
pkgrel=1
pkgdesc="A high performance Unix-based HTTP server"
url="http://httpd.apache.org/"
license="APACHE"
......@@ -24,16 +24,12 @@ source="http://archive.apache.org/dist/httpd/httpd-$pkgver.tar.bz2
apache2.confd
apache2.logrotate
apache2.initd
httpd.conf
alpine.layout"
prepare() {
cd "$srcdir"/httpd-$pkgver
sed -e 's#User daemon#User apache#' \
-e 's#Group daemon#Group apache#' \
-i docs/conf/httpd.conf.in || return 1
cat "$srcdir/alpine.layout" >> config.layout
cd "$srcdir"
cat "$srcdir/alpine.layout" >> httpd-$pkgver/config.layout
# create symlinks to soruces for prefork and worker
ln -s httpd-$pkgver prefork
......@@ -59,45 +55,55 @@ prepare() {
autoconf || return 1
}
_buildmpm() {
local mpm=$1
shift
mkdir "$srcdir"/build-${mpm}
cd "$srcdir"/build-${mpm}
"$srcdir"/$mpm/configure --prefix=/usr \
--enable-layout=Alpine \
--enable-so \
--enable-suexec \
--with-suexec-caller=http \
--with-suexec-docroot=/var/www/localhost/htdocs \
--with-suexec-logfile=/var/log/httpd/suexec.log \
--with-suexec-bin=/usr/sbin/suexec \
--with-suexec-uidmin=99 \
--with-suexec-gidmin=99 \
--with-apr=/usr/bin/apr-1-config \
--with-apr-util=/usr/bin/apu-1-config \
--with-pcre=/usr \
--with-mpm=${mpm} \
|| return 1
make || return 1
}
build () {
local mpm
for mpm in prefork worker itk; do
mkdir "$srcdir"/build-${mpm}
cd "$srcdir"/build-${mpm}
"$srcdir"/$mpm/configure --prefix=/usr \
--enable-layout=Alpine \
--enable-modules=all \
--enable-mods-shared=all \
--enable-so \
--enable-suexec \
--with-suexec-caller=http \
--with-suexec-docroot=/var/www/localhost/htdocs \
--with-suexec-logfile=/var/log/httpd/suexec.log \
--with-suexec-bin=/usr/sbin/suexec \
--with-suexec-uidmin=99 \
--with-suexec-gidmin=99 \
--enable-ldap \
--enable-authnz-ldap \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
--enable-file-cache \
--enable-ssl \
--with-ssl \
--enable-deflate \
--enable-cgid \
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-http \
--enable-proxy-ftp \
--enable-dbd \
--with-apr=/usr/bin/apr-1-config \
--with-apr-util=/usr/bin/apu-1-config \
--with-pcre=/usr \
--with-mpm=${mpm} \
|| return 1
make || return 1
# build prefork with everything
_buildmpm prefork \
--enable-mods-shared=all \
--enable-ssl --with-ssl --enable-distcache \
--enable-proxy \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
--enable-file-cache \
--enable-ldap --enable-authnz-ldap \
--enable-cgid \
--enable-authn-anon --enable-authn-alias \
--disable-imagemap \
--enable-proxy-connect \
--enable-proxy-http \
--enable-proxy-ftp \
--enable-deflate \
--enable-dbd \
|| return 1
#build the alternative mpms, but without modules
for mpm in worker itk; do
_buildmpm $mpm --enable-modules=none
done
}
......@@ -108,7 +114,14 @@ package() {
install -m755 "$srcdir"/build-$mpm/httpd \
"$pkgdir/usr/sbin/httpd.${mpm}" || return 1
done
# config
rm -r "$pkgdir"/etc/apache2/httpd.conf \
"$pkgdir"/etc/apache2/extra
install -D -m644 "$srcdir"/httpd.conf "$pkgdir"/etc/apache2/httpd.conf
install -d "$pkgdir"/etc/apache2/conf.d
# init scripts and logrotate
install -D -m755 "$srcdir/apache2.initd" \
"$pkgdir/etc/init.d/apache2" || return 1
install -D -m644 "$srcdir/apache2.logrotate" \
......@@ -119,15 +132,7 @@ package() {
install -d "$pkgdir"/var/www
ln -fs /var/log/httpd "$pkgdir/var/www/logs"
ln -fs /var/run/httpd "$pkgdir/var/www/run"
ln -fs /usr/lib/httpd/modules "$pkgdir/var/www/modules"
sed -e 's#/usr/lib/httpd/modules/#modules/#' \
-e 's|#\(Include conf/extra/httpd-multilang-errordoc.conf\)|\1|'\
-e 's|#\(Include conf/extra/httpd-autoindex.conf\)|\1|' \
-e 's|#\(Include conf/extra/httpd-languages.conf\)|\1|' \
-e 's|#\(Include conf/extra/httpd-userdir.conf\)|\1|' \
-e 's|#\(Include conf/extra/httpd-default.conf\)|\1|' \
-e 's|/srv/http|/var/www/localhost|g' \
-i "$pkgdir/etc/apache2/httpd.conf" || return 1
ln -fs /usr/lib/apache2 "$pkgdir/var/www/modules"
}
utils() {
......@@ -148,7 +153,8 @@ d33e39350e987721d50e6fb8e164ab6b 07-base-functionality.patch
9f7a8935f9cabc7b46d0052906634cef 08-max-clients-per-vhost.patch
1b28e3363e1b0d05b738a21e7ddd264f 09-capabilities.patch
d9667fcd2ffecc63e446edd4d6666731 10-nice.patch
f3e4f5eed88d97d1bbadd0597562bc28 apache2.confd
d91a9a7196b10ef0bc4ab5b98ea9ccd9 apache2.logrotate
e322b5211e49511cac6e40c86af1b1da apache2.confd
75fe4138b98fcffd01b8c8c077b944f3 apache2.logrotate
0261136ff734c3ae8dcf878a46ed5830 apache2.initd
ea8669bd3b913c4d30f16b5a11c82564 httpd.conf
af943bf52cec8088974084639661ba34 alpine.layout"
......@@ -9,39 +9,11 @@
HTTPD="/usr/sbin/httpd"
# When you install a module it is easy to activate or deactivate the modules
# and other features of apache using the HTTPD_OPTS line. Every module should
# install a configuration in /etc/apache2/modules.d. In that file will have an
# <IfDefine NNN> directive where NNN is the option to enable that module.
#
# Here are the options available in the default configuration:
# To pass additional options (for instance, -D definitions) to the
# httpd binary at startup, set HTTPD_OPTS here.
#
# AUTH_DIGEST Enables mod_auth_digest
# AUTHNZ_LDAP Enables authentication through mod_ldap
# CACHE Enables mod_cache
# DAV Enables mod_dav
# ERRORDOCS Enables default error documents for many languages.
# INFO Enables mod_info, a useful module for debugging
# LANGUAGE Enables content-negotiation based on language and charset.
# LDAP Enables mod_ldap
# MANUAL Enables /manual/ to be the apache manual (needs apache-doc)
# MEM_CACHE Enables default configuration mod_mem_cache
# PROXY Enables mod_proxy
# SSL Enables SSL
# SUEXEC Enables running CGI scripts (in USERDIR) through suexec.
# USERDIR Enables /~username mapping to /home/username/public_html
#
#
# The following two options provide the default virtual host for the HTTP and
# HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache
# will not listen for incomming connections on the approriate port.
#
# DEFAULT_VHOST Enables name-based virtual hosts, with the default
# virtual host being in /var/www/localhost/htdocs
# SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable this
# when you enable SSL)
#
HTTPD_OPTS="-D DEFAULT_VHOST -D LANGUAGE -D INFO"
HTTPD_OPTS=
# Extended options for advanced uses of Apache ONLY
# You don't need to edit these unless you are doing crazy Apache stuff
......
/var/log/apache2/*log {
postrotate
if /etc/init.d/apache2 status; then
/etc/init.d/apache2 reload --quiet || true
fi
endscript
missingok
notifempty
sharedscripts
delaycompress
postrotate
/sbin/rc-service --quiet apache2 reload > /dev/null 2>/dev/null || true
endscript
}
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment