aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-08-10 09:48:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-08-10 09:48:55 +0000
commitc0367e7f1e95ef668455892afc61ebbbc53a35d9 (patch)
treec93e79cc90f1147a5555882961458e5622a772c1
parent4f935d99aa754ff7b8b21b489be6caf9529f9a54 (diff)
downloadalpine_aports-c0367e7f1e95ef668455892afc61ebbbc53a35d9.tar.bz2
alpine_aports-c0367e7f1e95ef668455892afc61ebbbc53a35d9.tar.xz
alpine_aports-c0367e7f1e95ef668455892afc61ebbbc53a35d9.zip
testing/apache2: various fixes
* fix datadir to /usr/share instead of /share * move apxs and build dir to -dev package * separate subpackage for ldap modules * separate subpackage for ssl support with post-install that creates cert ref #392
-rw-r--r--testing/apache2/APKBUILD47
-rw-r--r--testing/apache2/alpine.layout2
-rw-r--r--testing/apache2/apache2-ssl.post-install32
-rw-r--r--testing/apache2/httpd.conf4
-rw-r--r--testing/apache2/ssl.conf223
5 files changed, 298 insertions, 10 deletions
diff --git a/testing/apache2/APKBUILD b/testing/apache2/APKBUILD
index a072fbab43..a18fe7f202 100644
--- a/testing/apache2/APKBUILD
+++ b/testing/apache2/APKBUILD
@@ -1,7 +1,7 @@
1# Maintainer: Natanael Copa <ncopa@alpinelinux.org> 1# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2pkgname=apache2 2pkgname=apache2
3pkgver=2.2.16 3pkgver=2.2.16
4pkgrel=1 4pkgrel=2
5pkgdesc="A high performance Unix-based HTTP server" 5pkgdesc="A high performance Unix-based HTTP server"
6url="http://httpd.apache.org/" 6url="http://httpd.apache.org/"
7license="APACHE" 7license="APACHE"
@@ -10,7 +10,8 @@ pkgusers="apache"
10pkggroups="apache" 10pkggroups="apache"
11makedepends="openssl-dev zlib-dev apr-util-dev apr-dev pcre-dev 11makedepends="openssl-dev zlib-dev apr-util-dev apr-dev pcre-dev
12 autoconf automake" 12 autoconf automake"
13subpackages="$pkgname-dev $pkgname-doc $pkgname-utils" 13subpackages="$pkgname-dev $pkgname-doc $pkgname-utils $pkgname-ssl
14 $pkgname-ldap"
14source="http://archive.apache.org/dist/httpd/httpd-$pkgver.tar.bz2 15source="http://archive.apache.org/dist/httpd/httpd-$pkgver.tar.bz2
15 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/02-rename-prefork-to-itk.patch 16 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/02-rename-prefork-to-itk.patch
16 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/03-add-mpm-to-build-system.patch 17 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.11-02/03-add-mpm-to-build-system.patch
@@ -25,6 +26,7 @@ source="http://archive.apache.org/dist/httpd/httpd-$pkgver.tar.bz2
25 apache2.logrotate 26 apache2.logrotate
26 apache2.initd 27 apache2.initd
27 httpd.conf 28 httpd.conf
29 ssl.conf
28 alpine.layout" 30 alpine.layout"
29 31
30prepare() { 32prepare() {
@@ -74,6 +76,7 @@ _buildmpm() {
74 --with-apr-util=/usr/bin/apu-1-config \ 76 --with-apr-util=/usr/bin/apu-1-config \
75 --with-pcre=/usr \ 77 --with-pcre=/usr \
76 --with-mpm=${mpm} \ 78 --with-mpm=${mpm} \
79 $@ \
77 || return 1 80 || return 1
78 make || return 1 81 make || return 1
79} 82}
@@ -84,7 +87,7 @@ build () {
84 # build prefork with everything 87 # build prefork with everything
85 _buildmpm prefork \ 88 _buildmpm prefork \
86 --enable-mods-shared=all \ 89 --enable-mods-shared=all \
87 --enable-ssl --with-ssl --enable-distcache \ 90 --enable-ssl --with-ssl \
88 --enable-proxy \ 91 --enable-proxy \
89 --enable-cache \ 92 --enable-cache \
90 --enable-disk-cache \ 93 --enable-disk-cache \
@@ -130,9 +133,19 @@ package() {
130 "$pkgdir/etc/conf.d/apache2" || return 1 133 "$pkgdir/etc/conf.d/apache2" || return 1
131 134
132 install -d "$pkgdir"/var/www 135 install -d "$pkgdir"/var/www
133 ln -fs /var/log/httpd "$pkgdir/var/www/logs" 136 ln -fs /var/log/apache2 "$pkgdir/var/www/logs"
134 ln -fs /var/run/httpd "$pkgdir/var/www/run" 137 ln -fs /var/run/apache2 "$pkgdir/var/www/run"
135 ln -fs /usr/lib/apache2 "$pkgdir/var/www/modules" 138 ln -fs /usr/lib/apache2 "$pkgdir/var/www/modules"
139 ln -fs /etc/apache2/conf.d "$pkgdir/var/www/conf.d"
140}
141
142# include the builddir and apxs in -dev package
143dev() {
144 default_dev
145 install -d "$subpkgdir"/usr/share/apache2/ \
146 "$subpkgdir"/usr/sbin
147 mv "$pkgdir"/usr/sbin/apxs "$subpkgdir"/usr/sbin/ || return 1
148 mv "$pkgdir"/usr/share/apache2/build "$subpkgdir"/usr/share/apache2/
136} 149}
137 150
138utils() { 151utils() {
@@ -143,6 +156,25 @@ utils() {
143 mv checkgid htcacheclean rotatelogs "$subpkgdir"/usr/sbin 156 mv checkgid htcacheclean rotatelogs "$subpkgdir"/usr/sbin
144} 157}
145 158
159ssl() {
160 pkgdesc="SSL/TLS module for the Apache HTTP Server"
161 install="apache2-ssl.post-install"
162 depends="apache2 openssl"
163 install -d "$subpkgdir"/usr/lib/apache2 \
164 "$subpkgdir"/etc/ssl/apache2
165 mv "$pkgdir"/usr/lib/apache2/mod_ssl.so "$subpkgdir"/usr/lib/apache2/ \
166 || return 1
167 install -m644 -D "$srcdir"/ssl.conf "$subpkgdir"/etc/apache2/conf.d/ssl.conf
168}
169
170ldap() {
171 pkgdesc="LDAP authentication/authorization module for the Apache HTTP Server"
172 url="http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html"
173 depends="apache2"
174 install -d "$subpkgdir"/usr/lib/apache2
175 mv "$pkgdir"/usr/lib/apache2/mod_*ldap*.so "$subpkgdir"/usr/lib/apache2
176}
177
146md5sums="c8ff2a07c884300bc7766a2e7f662d33 httpd-2.2.16.tar.bz2 178md5sums="c8ff2a07c884300bc7766a2e7f662d33 httpd-2.2.16.tar.bz2
147db42cfcc18ae1c32aaaff2347e35b79d 02-rename-prefork-to-itk.patch 179db42cfcc18ae1c32aaaff2347e35b79d 02-rename-prefork-to-itk.patch
148131408ad4dc7b18547b4e062e7e495ab 03-add-mpm-to-build-system.patch 180131408ad4dc7b18547b4e062e7e495ab 03-add-mpm-to-build-system.patch
@@ -156,5 +188,6 @@ d9667fcd2ffecc63e446edd4d6666731 10-nice.patch
156e322b5211e49511cac6e40c86af1b1da apache2.confd 188e322b5211e49511cac6e40c86af1b1da apache2.confd
15775fe4138b98fcffd01b8c8c077b944f3 apache2.logrotate 18975fe4138b98fcffd01b8c8c077b944f3 apache2.logrotate
1580261136ff734c3ae8dcf878a46ed5830 apache2.initd 1900261136ff734c3ae8dcf878a46ed5830 apache2.initd
159ea8669bd3b913c4d30f16b5a11c82564 httpd.conf 191769748b26d008f427678ac2bbc7ab171 httpd.conf
160af943bf52cec8088974084639661ba34 alpine.layout" 1925d0d024ca43571b863874ab871b2c109 ssl.conf
193c66ff5f70260d5266e6803a59b39bd7f alpine.layout"
diff --git a/testing/apache2/alpine.layout b/testing/apache2/alpine.layout
index 7146971d2a..99f20df529 100644
--- a/testing/apache2/alpine.layout
+++ b/testing/apache2/alpine.layout
@@ -7,7 +7,7 @@
7 libexecdir: ${prefix}/lib+ 7 libexecdir: ${prefix}/lib+
8 mandir: ${prefix}/share/man 8 mandir: ${prefix}/share/man
9 sysconfdir: /etc+ 9 sysconfdir: /etc+
10 datadir: ${usr}/share+ 10 datadir: ${prefix}/share+
11 installbuilddir: ${datadir}/build 11 installbuilddir: ${datadir}/build
12 errordir: ${datadir}/error 12 errordir: ${datadir}/error
13 iconsdir: ${datadir}/icons 13 iconsdir: ${datadir}/icons
diff --git a/testing/apache2/apache2-ssl.post-install b/testing/apache2/apache2-ssl.post-install
new file mode 100644
index 0000000000..d73b5fc622
--- /dev/null
+++ b/testing/apache2/apache2-ssl.post-install
@@ -0,0 +1,32 @@
1#!/bin/sh
2
3ssldir=/etc/ssl/apache2
4sslkey=$ssldir/server.key
5sslcert=$ssldir/server.pem
6
7umask 077
8
9if [ ! -f ${sslkey} ] ; then
10 openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > ${sslkey} 2> /dev/null
11fi
12
13FQDN=`hostname -f`
14if [ "x${FQDN}" = "x" ]; then
15 FQDN=localhost.localdomain
16fi
17
18if [ ! -f ${sslcert} ] ; then
19cat << EOF | openssl req -new -key ${sslkey} \
20 -x509 -days 365 -set_serial $RANDOM \
21 -out ${sslcert} 2>/dev/null
22--
23SomeState
24SomeCity
25SomeOrganization
26SomeOrganizationalUnit
27${FQDN}
28root@${FQDN}
29EOF
30fi
31
32
diff --git a/testing/apache2/httpd.conf b/testing/apache2/httpd.conf
index 5e0adee65e..fab84b80ba 100644
--- a/testing/apache2/httpd.conf
+++ b/testing/apache2/httpd.conf
@@ -216,9 +216,9 @@ LoadModule version_module modules/mod_version.so
216# 216#
217 217
218# 218#
219# Load config files from the config directory "/etc/httpd/conf.d". 219# Load config files from the config directory "/etc/apache2/conf.d".
220# 220#
221Include conf.d/*.conf 221Include /etc/apache2/conf.d/*.conf
222 222
223# 223#
224# ExtendedStatus controls whether Apache will generate "full" status 224# ExtendedStatus controls whether Apache will generate "full" status
diff --git a/testing/apache2/ssl.conf b/testing/apache2/ssl.conf
new file mode 100644
index 0000000000..8b156ebbc6
--- /dev/null
+++ b/testing/apache2/ssl.conf
@@ -0,0 +1,223 @@
1#
2# This is the Apache server configuration file providing SSL support.
3# It contains the configuration directives to instruct the server how to
4# serve pages over an https connection. For detailing information about these
5# directives see <URL:http://httpd.apache.org/docs/2.2/mod/mod_ssl.html>
6#
7# Do NOT simply read the instructions in here without understanding
8# what they do. They're here only as hints or reminders. If you are unsure
9# consult the online docs. You have been warned.
10#
11
12LoadModule ssl_module modules/mod_ssl.so
13
14#
15# When we also provide SSL we have to listen to the
16# the HTTPS port in addition.
17#
18Listen 443
19
20##
21## SSL Global Context
22##
23## All SSL configuration in this context applies both to
24## the main server and all SSL-enabled virtual hosts.
25##
26
27# Pass Phrase Dialog:
28# Configure the pass phrase gathering process.
29# The filtering dialog program (`builtin' is a internal
30# terminal dialog) has to provide the pass phrase on stdout.
31SSLPassPhraseDialog builtin
32
33# Inter-Process Session Cache:
34# Configure the SSL Session Cache: First the mechanism
35# to use and second the expiring timeout (in seconds).
36#SSLSessionCache dc:UNIX:/var/cache/mod_ssl/distcache
37SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
38SSLSessionCacheTimeout 300
39
40# Semaphore:
41# Configure the path to the mutual exclusion semaphore the
42# SSL engine uses internally for inter-process synchronization.
43SSLMutex default
44
45# Pseudo Random Number Generator (PRNG):
46# Configure one or more sources to seed the PRNG of the
47# SSL library. The seed data should be of good random quality.
48# WARNING! On some platforms /dev/random blocks if not enough entropy
49# is available. This means you then cannot use the /dev/random device
50# because it would lead to very long connection times (as long as
51# it requires to make more entropy available). But usually those
52# platforms additionally provide a /dev/urandom device which doesn't
53# block. So, if available, use this one instead. Read the mod_ssl User
54# Manual for more details.
55SSLRandomSeed startup file:/dev/urandom 256
56SSLRandomSeed connect builtin
57#SSLRandomSeed startup file:/dev/random 512
58#SSLRandomSeed connect file:/dev/random 512
59#SSLRandomSeed connect file:/dev/urandom 512
60
61#
62# Use "SSLCryptoDevice" to enable any supported hardware
63# accelerators. Use "openssl engine -v" to list supported
64# engine names. NOTE: If you enable an accelerator and the
65# server does not start, consult the error logs and ensure
66# your accelerator is functioning properly.
67#
68SSLCryptoDevice builtin
69#SSLCryptoDevice ubsec
70
71##
72## SSL Virtual Host Context
73##
74
75<VirtualHost _default_:443>
76
77# General setup for the virtual host, inherited from global configuration
78#DocumentRoot "/var/www/html"
79#ServerName www.example.com:443
80
81# Use separate log files for the SSL virtual host; note that LogLevel
82# is not inherited from httpd.conf.
83ErrorLog logs/ssl_error.log
84TransferLog logs/ssl_access.log
85LogLevel warn
86
87# SSL Engine Switch:
88# Enable/Disable SSL for this virtual host.
89SSLEngine on
90
91# SSL Protocol support:
92# List the enable protocol levels with which clients will be able to
93# connect. Disable SSLv2 access by default:
94SSLProtocol all -SSLv2
95
96# SSL Cipher Suite:
97# List the ciphers that the client is permitted to negotiate.
98# See the mod_ssl documentation for a complete list.
99SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
100
101# Server Certificate:
102# Point SSLCertificateFile at a PEM encoded certificate. If
103# the certificate is encrypted, then you will be prompted for a
104# pass phrase. Note that a kill -HUP will prompt again. A new
105# certificate can be generated using the genkey(1) command.
106SSLCertificateFile /etc/ssl/apache2/server.pem
107
108# Server Private Key:
109# If the key is not combined with the certificate, use this
110# directive to point at the key file. Keep in mind that if
111# you've both a RSA and a DSA private key you can configure
112# both in parallel (to also allow the use of DSA ciphers, etc.)
113SSLCertificateKeyFile /etc/ssl/apache2/server.key
114
115# Server Certificate Chain:
116# Point SSLCertificateChainFile at a file containing the
117# concatenation of PEM encoded CA certificates which form the
118# certificate chain for the server certificate. Alternatively
119# the referenced file can be the same as SSLCertificateFile
120# when the CA certificates are directly appended to the server
121# certificate for convinience.
122#SSLCertificateChainFile /etc/ssl/apache2/server-chain.crt
123
124# Certificate Authority (CA):
125# Set the CA certificate verification path where to find CA
126# certificates for client authentication or alternatively one
127# huge file containing all of them (file must be PEM encoded)
128#SSLCACertificateFile /etc/ssl/apache2/ca-bundle.crt
129
130# Client Authentication (Type):
131# Client certificate verification type and depth. Types are
132# none, optional, require and optional_no_ca. Depth is a
133# number which specifies how deeply to verify the certificate
134# issuer chain before deciding the certificate is not valid.
135#SSLVerifyClient require
136#SSLVerifyDepth 10
137
138# Access Control:
139# With SSLRequire you can do per-directory access control based
140# on arbitrary complex boolean expressions containing server
141# variable checks and other lookup directives. The syntax is a
142# mixture between C and Perl. See the mod_ssl documentation
143# for more details.
144#<Location />
145#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
146# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
147# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
148# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
149# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
150# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
151#</Location>
152
153# SSL Engine Options:
154# Set various options for the SSL engine.
155# o FakeBasicAuth:
156# Translate the client X.509 into a Basic Authorisation. This means that
157# the standard Auth/DBMAuth methods can be used for access control. The
158# user name is the `one line' version of the client's X.509 certificate.
159# Note that no password is obtained from the user. Every entry in the user
160# file needs this password: `xxj31ZMTZzkVA'.
161# o ExportCertData:
162# This exports two additional environment variables: SSL_CLIENT_CERT and
163# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
164# server (always existing) and the client (only existing when client
165# authentication is used). This can be used to import the certificates
166# into CGI scripts.
167# o StdEnvVars:
168# This exports the standard SSL/TLS related `SSL_*' environment variables.
169# Per default this exportation is switched off for performance reasons,
170# because the extraction step is an expensive operation and is usually
171# useless for serving static content. So one usually enables the
172# exportation for CGI and SSI requests only.
173# o StrictRequire:
174# This denies access when "SSLRequireSSL" or "SSLRequire" applied even
175# under a "Satisfy any" situation, i.e. when it applies access is denied
176# and no other module can change it.
177# o OptRenegotiate:
178# This enables optimized SSL connection renegotiation handling when SSL
179# directives are used in per-directory context.
180#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
181<Files ~ "\.(cgi|shtml|phtml|php3?)$">
182 SSLOptions +StdEnvVars
183</Files>
184<Directory "/var/www/cgi-bin">
185 SSLOptions +StdEnvVars
186</Directory>
187
188# SSL Protocol Adjustments:
189# The safe and default but still SSL/TLS standard compliant shutdown
190# approach is that mod_ssl sends the close notify alert but doesn't wait for
191# the close notify alert from client. When you need a different shutdown
192# approach you can use one of the following variables:
193# o ssl-unclean-shutdown:
194# This forces an unclean shutdown when the connection is closed, i.e. no
195# SSL close notify alert is send or allowed to received. This violates
196# the SSL/TLS standard but is needed for some brain-dead browsers. Use
197# this when you receive I/O errors because of the standard approach where
198# mod_ssl sends the close notify alert.
199# o ssl-accurate-shutdown:
200# This forces an accurate shutdown when the connection is closed, i.e. a
201# SSL close notify alert is send and mod_ssl waits for the close notify
202# alert of the client. This is 100% SSL/TLS standard compliant, but in
203# practice often causes hanging connections with brain-dead browsers. Use
204# this only for browsers where you know that their SSL implementation
205# works correctly.
206# Notice: Most problems of broken clients are also related to the HTTP
207# keep-alive facility, so you usually additionally want to disable
208# keep-alive for those clients, too. Use variable "nokeepalive" for this.
209# Similarly, one has to force some clients to use HTTP/1.0 to workaround
210# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
211# "force-response-1.0" for this.
212SetEnvIf User-Agent ".*MSIE.*" \
213 nokeepalive ssl-unclean-shutdown \
214 downgrade-1.0 force-response-1.0
215
216# Per-Server Logging:
217# The home of a custom SSL log file. Use this when you want a
218# compact non-error SSL logfile on a virtual host basis.
219CustomLog logs/ssl_request.log \
220 "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
221
222</VirtualHost>
223