1 %define contentdir /var/www
2 %define suexec_caller apache
6 # disable debuginfo on IA64
7 %define debug_package %{nil}
10 Summary: Apache HTTP Server
14 URL: http://httpd.apache.org/
15 Vendor: Apache Software Foundation
16 Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.gz
17 License: Apache License, Version 2.0
18 Group: System Environment/Daemons
19 BuildRoot: %{_tmppath}/%{name}-root
20 BuildPrereq: apr-devel, apr-util-devel, openldap-devel, db4-devel, expat-devel, findutils, perl, pkgconfig
21 BuildPrereq: /usr/bin/apr-config, /usr/bin/apu-config
22 Requires: apr >= 0.9.7, apr-util >= 0.9.7, gawk, /usr/share/magic.mime, /usr/bin/find, openldap
23 Prereq: /sbin/chkconfig, /bin/mktemp, /bin/rm, /bin/mv
24 Prereq: sh-utils, textutils, /usr/sbin/useradd
26 Provides: httpd-mmn = %{mmn}
28 Obsoletes: apache, secureweb, mod_dav
31 Apache is a powerful, full-featured, efficient, and freely-available
32 Web server. Apache is also the most popular Web server on the
36 Group: Development/Libraries
37 Summary: Development tools for the Apache HTTP server.
38 Obsoletes: secureweb-devel, apache-devel
39 Requires: libtool, httpd = %{version}
40 Requires: apr-devel >= 0.9.7, apr-util-devel >= 0.9.7
43 The httpd-devel package contains the APXS binary and other files
44 that you need to build Dynamic Shared Objects (DSOs) for Apache.
46 If you are installing the Apache HTTP server and you want to be
47 able to compile or develop additional modules for Apache, you need
48 to install this package.
52 Summary: Documentation for the Apache HTTP server.
53 Obsoletes: secureweb-manual, apache-manual
56 The httpd-manual package contains the complete manual and
57 reference guide for the Apache HTTP server. The information can
58 also be found at http://httpd.apache.org/docs/.
61 Group: System Environment/Daemons
62 Summary: SSL/TLS module for the Apache HTTP server
64 BuildPrereq: openssl-devel
65 Prereq: openssl, dev, /bin/cat
66 Requires: httpd, make, httpd-mmn = %{mmn}
68 %description -n mod_ssl
69 The mod_ssl module provides strong cryptography for the Apache Web
70 server via the Secure Sockets Layer (SSL) and Transport Layer
71 Security (TLS) protocols.
76 # Safety check: prevent build if defined MMN does not equal upstream MMN.
77 vmmn=`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include \`pwd\`/include/ap_mmn.h | grep -e '^[0-9]'`
78 if test x${vmmn} != x%{mmn}; then
79 : Error: Upstream MMN is now ${vmmn}, packaged MMN is %{mmn}.
80 : Update the mmn macro and rebuild.
84 # regenerate configure scripts
87 # Before configure; fix location of build dir in generated apxs
88 %{__perl} -pi -e "s:\@exp_installbuilddir\@:%{_libdir}/httpd/build:g" \
93 if pkg-config openssl ; then
94 # configure -C barfs with trailing spaces in CFLAGS
95 CFLAGS="$RPM_OPT_FLAGS `pkg-config --cflags openssl | sed 's/ *$//'`"
96 AP_LIBS="$AP_LIBS `pkg-config --libs openssl`"
98 CFLAGS="$RPM_OPT_FLAGS"
99 AP_LIBS="-lssl -lcrypto"
107 mkdir $mpm; pushd $mpm
108 cat > config.cache <<EOF
109 ac_cv_func_pthread_mutexattr_setpshared=no
110 ac_cv_func_sem_open=no
113 --prefix=%{_sysconfdir}/httpd \
114 --with-apr=/usr/bin/apr-config \
115 --with-apr-util=/usr/bin/apu-config \
116 --exec-prefix=%{_prefix} \
117 --bindir=%{_bindir} \
118 --sbindir=%{_sbindir} \
119 --mandir=%{_mandir} \
120 --libdir=%{_libdir} \
121 --sysconfdir=%{_sysconfdir}/httpd/conf \
122 --includedir=%{_includedir}/httpd \
123 --libexecdir=%{_libdir}/httpd/modules \
124 --datadir=%{contentdir} \
126 --enable-suexec --with-suexec \
127 --with-suexec-caller=%{suexec_caller} \
128 --with-suexec-docroot=%{contentdir} \
129 --with-suexec-logfile=%{_localstatedir}/log/httpd/suexec.log \
130 --with-suexec-bin=%{_sbindir}/suexec \
131 --with-suexec-uidmin=500 --with-suexec-gidmin=500 \
133 --with-ldap --enable-ldap --enable-auth-ldap \
134 --enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache \
135 --enable-ssl --with-ssl \
136 --enable-deflate --enable-cgid \
137 --enable-proxy --enable-proxy-connect \
138 --enable-proxy-http --enable-proxy-ftp \
145 # Only bother enabling optional modules for main build.
146 mpmbuild prefork --enable-mods-shared=all
148 # To prevent most modules being built statically into httpd.worker,
149 # easiest way seems to be enable them shared.
150 mpmbuild worker --enable-mods-shared=all
152 # Verify that the same modules were built into the two httpd binaries
153 ./prefork/httpd -l | grep -v prefork > prefork.mods
154 ./worker/httpd -l | grep -v worker > worker.mods
155 if ! diff -u prefork.mods worker.mods; then
156 : Different modules built into httpd binaries, will not proceed
161 rm -rf $RPM_BUILD_ROOT
164 make DESTDIR=$RPM_BUILD_ROOT install
166 # install worker binary
167 install -m 755 worker/httpd $RPM_BUILD_ROOT%{_sbindir}/httpd.worker
170 for suffix in crl crt csr key prm; do
171 mkdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/ssl.${suffix}
174 # Makefiles for certificate management
175 #for ext in crt crl; do
176 # install -m 644 ./build/rpm/mod_ssl-Makefile.${ext} \
177 # $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/ssl.${ext}/Makefile.${ext}
179 #ln -s ../../../usr/share/ssl/certs/Makefile $RPM_BUILD_ROOT/etc/httpd/conf
181 # for holding mod_dav lock database
182 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/dav
184 # create a prototype session cache
185 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/mod_ssl
186 touch $RPM_BUILD_ROOT%{_localstatedir}/cache/mod_ssl/scache.{dir,pag,sem}
188 # move the build directory to within the library directory
189 mv $RPM_BUILD_ROOT%{contentdir}/build $RPM_BUILD_ROOT%{_libdir}/httpd/build
191 # fix up config_vars file: relocate the build directory into libdir;
192 # reference correct libtool from apr; remove references to RPM build root.
193 sed -e "s|%{contentdir}/build|%{_libdir}/httpd/build|g" \
194 -e "/AP_LIBS/d" -e "/abs_srcdir/d" \
195 -e "/^LIBTOOL/s|/[^ ]*/libtool|`apr-config --apr-libtool`|" \
196 -e "/^EXTRA_INCLUDES/s|-I$RPM_BUILD_DIR[^ ]* ||g" \
197 < prefork/build/config_vars.mk \
198 > $RPM_BUILD_ROOT%{_libdir}/httpd/build/config_vars.mk
200 # Make the MMN accessible to module packages
201 echo %{mmn} > $RPM_BUILD_ROOT%{_includedir}/httpd/.mmn
204 mkdir $RPM_BUILD_ROOT%{contentdir}/html
205 rm -r $RPM_BUILD_ROOT%{contentdir}/manual/style
208 rmdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/logs
209 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/httpd
211 # symlinks for /etc/httpd
212 ln -s ../..%{_localstatedir}/log/httpd $RPM_BUILD_ROOT/etc/httpd/logs
213 ln -s ../..%{_localstatedir}/run $RPM_BUILD_ROOT/etc/httpd/run
214 ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules
215 ln -s ../..%{_libdir}/httpd/build $RPM_BUILD_ROOT/etc/httpd/build
217 # install SYSV init stuff
218 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
219 install -m755 ./build/rpm/httpd.init \
220 $RPM_BUILD_ROOT/etc/rc.d/init.d/httpd
221 %{__perl} -pi -e "s:\@docdir\@:%{_docdir}/%{name}-%{version}:g" \
222 $RPM_BUILD_ROOT/etc/rc.d/init.d/httpd
224 # install log rotation stuff
225 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
226 install -m644 ./build/rpm/httpd.logrotate \
227 $RPM_BUILD_ROOT/etc/logrotate.d/httpd
229 # Remove unpackaged files
230 rm -rf $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.exp \
231 $RPM_BUILD_ROOT%{contentdir}/htdocs/* \
232 $RPM_BUILD_ROOT%{contentdir}/cgi-bin/*
235 # Add the "apache" user
236 /usr/sbin/useradd -c "Apache" -u 48 \
237 -s /sbin/nologin -r -d %{contentdir} apache 2> /dev/null || :
239 %triggerpostun -- apache < 2.0
240 /sbin/chkconfig --add httpd
243 # Register the httpd service
244 /sbin/chkconfig --add httpd
248 /sbin/service httpd stop > /dev/null 2>&1
249 /sbin/chkconfig --del httpd
253 /sbin/ldconfig ### is this needed?
256 if [ ! -f %{_sysconfdir}/httpd/conf/ssl.key/server.key ] ; then
257 %{_bindir}/openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > %{_sysconfdir}/httpd/conf/ssl.key/server.key 2> /dev/null
261 if [ "x${FQDN}" = "x" ]; then
262 FQDN=localhost.localdomain
265 if [ ! -f %{_sysconfdir}/httpd/conf/ssl.crt/server.crt ] ; then
266 cat << EOF | %{_bindir}/openssl req -new -key %{_sysconfdir}/httpd/conf/ssl.key/server.key -x509 -days 365 -out %{_sysconfdir}/httpd/conf/ssl.crt/server.crt 2>/dev/null
271 SomeOrganizationalUnit
278 rm -rf $RPM_BUILD_ROOT
281 %defattr(-,root,root)
283 %doc ABOUT_APACHE README CHANGES LICENSE NOTICE
285 %dir %{_sysconfdir}/httpd
286 %{_sysconfdir}/httpd/modules
287 %{_sysconfdir}/httpd/logs
288 %{_sysconfdir}/httpd/run
289 %dir %{_sysconfdir}/httpd/conf
290 %config(noreplace) %{_sysconfdir}/httpd/conf/*.conf
291 %config(noreplace) %{_sysconfdir}/httpd/conf/magic
292 %config(noreplace) %{_sysconfdir}/httpd/conf/mime.types
294 %config %{_sysconfdir}/logrotate.d/httpd
295 %config %{_sysconfdir}/rc.d/init.d/httpd
297 #%dir %{_sysconfdir}/httpd/conf
303 %{_sbindir}/httxt2dbm
304 %{_sbindir}/logresolve
306 %{_sbindir}/httpd.worker
307 %{_sbindir}/apachectl
308 %{_sbindir}/rotatelogs
309 %attr(4510,root,%{suexec_caller}) %{_sbindir}/suexec
311 %dir %{_libdir}/httpd
312 %dir %{_libdir}/httpd/modules
313 # everything but mod_ssl.so:
314 %{_libdir}/httpd/modules/mod_[a-r]*.so
315 %{_libdir}/httpd/modules/mod_s[petu]*.so
316 %{_libdir}/httpd/modules/mod_[t-z]*.so
319 %dir %{contentdir}/cgi-bin
320 %dir %{contentdir}/html
321 %dir %{contentdir}/icons
322 %dir %{contentdir}/error
323 %dir %{contentdir}/error/include
324 %{contentdir}/icons/*
325 %{contentdir}/error/README
326 %config(noreplace) %{contentdir}/error/*.var
327 %config(noreplace) %{contentdir}/error/include/*.html
329 %attr(0700,root,root) %dir %{_localstatedir}/log/httpd
331 %attr(0700,apache,apache) %dir %{_localstatedir}/lib/dav
335 %{_mandir}/man8/apachectl*
336 %{_mandir}/man8/httpd*
337 %{_mandir}/man8/logresolve*
338 %{_mandir}/man8/rotatelogs*
339 %{_mandir}/man8/suexec*
342 %defattr(-,root,root)
346 %defattr(-,root,root)
347 %{_libdir}/httpd/modules/mod_ssl.so
348 %config(noreplace) %{_sysconfdir}/httpd/conf/ssl.conf
349 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.*
350 #%config %{_sysconfdir}/httpd/conf/Makefile
351 #%dir %{_sysconfdir}/httpd/conf/ssl.*
352 %attr(0700,apache,root) %dir %{_localstatedir}/cache/mod_ssl
353 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.dir
354 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.pag
355 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.sem
358 %defattr(-,root,root)
360 %{_sysconfdir}/httpd/build
363 %{_sbindir}/dbmmanage
365 %{_mandir}/man8/apxs.8*
366 %dir %{_libdir}/httpd/build
367 %{_libdir}/httpd/build/*.mk
368 %{_libdir}/httpd/build/config.nice
369 %{_libdir}/httpd/build/instdso.sh
372 * Mon Mar 27 2006 Graham Leggett <minfrin@apache.org> 2.0.56-dev
373 - Add the missing file-cache module to the cache family of modules in
376 * Tue Oct 11 2005 Graham Leggett <minfrin@apache.org> 2.0.56-dev
377 - Updated the apr and apr-util dependencies to require at least v0.9.7
378 - Stop trying to remove *.xml doc files, the httpd build does that already.
380 * Thu Dec 16 2004 Graham Leggett <minfrin@apache.org> 2.0.53-dev
381 - Changed build to use external apr and apr-util
383 * Sat Apr 5 2003 Graham Leggett <minfrin@apache.org> 2.0.46-dev
384 - Moved mime.types back to the default location.
385 - Added mod_ldap and friends, mod_cache and friends.
386 - Added openldap dependancy.
388 * Sun Mar 30 2003 Graham Leggett <minfrin@apache.org> 2.0.45-1
389 - Created generic Apache rpm spec file from that donated by Redhat.
390 - Removed Redhat specific patches and boilerplate files.
391 - Removed SSL related Makefiles.
393 * Mon Feb 24 2003 Joe Orton <jorton@redhat.com> 2.0.40-21
394 - add security fix for CAN-2003-0020; replace non-printable characters
395 with '!' when printing to error log.
396 - disable debuginfo on IA64.
398 * Tue Feb 11 2003 Joe Orton <jorton@redhat.com> 2.0.40-20
399 - disable POSIX semaphores to support 2.4.18 kernel (#83324)
401 * Wed Jan 29 2003 Joe Orton <jorton@redhat.com> 2.0.40-19
402 - require xmlto 0.0.11 or later
403 - fix apr_strerror on glibc2.3
405 * Wed Jan 22 2003 Tim Powers <timp@redhat.com> 2.0.40-18
408 * Thu Jan 16 2003 Joe Orton <jorton@redhat.com> 2.0.40-17
409 - add mod_cgid and httpd binary built with worker MPM (#75496)
410 - allow choice of httpd binary in init script
411 - pick appropriate CGI module based on loaded MPM in httpd.conf
412 - source /etc/sysconfig/httpd in apachectl to get httpd choice
413 - make "apachectl status" fail gracefully when links isn't found (#78159)
415 * Mon Jan 13 2003 Joe Orton <jorton@redhat.com> 2.0.40-16
416 - rebuild for OpenSSL 0.9.7
418 * Fri Jan 3 2003 Joe Orton <jorton@redhat.com> 2.0.40-15
419 - fix possible infinite recursion in config dir processing (#77206)
420 - fix memory leaks in request body processing (#79282)
422 * Thu Dec 12 2002 Joe Orton <jorton@redhat.com> 2.0.40-14
423 - remove unstable shmht session cache from mod_ssl
424 - get SSL libs from pkg-config if available (Nalin Dahyabhai)
425 - stop "apxs -a -i" from inserting AddModule into httpd.conf (#78676)
427 * Wed Nov 6 2002 Joe Orton <jorton@redhat.com> 2.0.40-13
428 - fix location of installbuilddir in apxs when libdir!=/usr/lib
430 * Wed Nov 6 2002 Joe Orton <jorton@redhat.com> 2.0.40-12
431 - pass libdir to configure; clean up config_vars.mk
432 - package instdso.sh, fixing apxs -i (#73428)
433 - prevent build if upstream MMN differs from mmn macro
434 - remove installed but unpackaged files
436 * Wed Oct 9 2002 Joe Orton <jorton@redhat.com> 2.0.40-11
437 - correct SERVER_NAME encoding in i18n error pages (thanks to Andre Malo)
439 * Wed Oct 9 2002 Joe Orton <jorton@redhat.com> 2.0.40-10
440 - fix patch for CAN-2002-0840 to also cover i18n error pages
442 * Wed Oct 2 2002 Joe Orton <jorton@redhat.com> 2.0.40-9
443 - security fixes for CAN-2002-0840 and CAN-2002-0843
444 - fix for possible mod_dav segfault for certain requests
446 * Tue Sep 24 2002 Gary Benson <gbenson@redhat.com>
447 - updates to the migration guide
449 * Wed Sep 4 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.40-8
450 - link httpd with libssl to avoid library loading/unloading weirdness
452 * Tue Sep 3 2002 Joe Orton <jorton@redhat.com> 2.0.40-7
453 - add LoadModule lines for proxy modules in httpd.conf (#73349)
454 - fix permissions of conf/ssl.*/ directories; add Makefiles for
455 certificate management (#73352)
457 * Mon Sep 2 2002 Joe Orton <jorton@redhat.com> 2.0.40-6
458 - provide "httpd-mmn" to manage module ABI compatibility
460 * Sun Sep 1 2002 Joe Orton <jorton@redhat.com> 2.0.40-5
461 - fix SSL session cache (#69699)
462 - revert addition of LDAP support to apr-util
464 * Mon Aug 26 2002 Joe Orton <jorton@redhat.com> 2.0.40-4
465 - set SIGXFSZ disposition to "ignored" (#69520)
466 - make dummy connections to the first listener in config (#72692)
468 * Mon Aug 26 2002 Joe Orton <jorton@redhat.com> 2.0.40-3
469 - allow "apachectl configtest" on a 1.3 httpd.conf
471 - enable LDAP support in apr-util
472 - don't package everything in /var/www/error as config(noreplace)
474 * Wed Aug 21 2002 Bill Nottingham <notting@redhat.com> 2.0.40-2
475 - add trigger (#68657)
477 * Mon Aug 12 2002 Joe Orton <jorton@redhat.com> 2.0.40-1
480 * Wed Jul 24 2002 Joe Orton <jorton@redhat.com> 2.0.36-8
481 - improve comment on use of UserDir in default config (#66886)
483 * Wed Jul 10 2002 Joe Orton <jorton@redhat.com> 2.0.36-7
484 - use /sbin/nologin as shell for apache user (#68371)
485 - add patch from CVS to fix possible infinite loop when processing
488 * Wed Jun 26 2002 Gary Benson <gbenson@redhat.com> 2.0.36-6
489 - modify init script to detect 1.3.x httpd.conf's and direct users
490 to the migration guide
492 * Tue Jun 25 2002 Gary Benson <gbenson@redhat.com> 2.0.36-5
493 - patch apachectl to detect 1.3.x httpd.conf's and direct users
494 to the migration guide
495 - ship the migration guide
497 * Fri Jun 21 2002 Joe Orton <jorton@redhat.com>
498 - move /etc/httpd2 back to /etc/httpd
499 - add noindex.html page and poweredby logo; tweak default config
500 to load noindex.html if no default "/" page is present.
501 - add patch to prevent mutex errors on graceful restart
503 * Fri Jun 21 2002 Tim Powers <timp@redhat.com> 2.0.36-4
506 * Wed Jun 12 2002 Joe Orton <jorton@redhat.com> 2.0.36-3
507 - add patch to fix SSL mutex handling
509 * Wed Jun 12 2002 Joe Orton <jorton@redhat.com> 2.0.36-2
510 - improved config directory patch
512 * Mon May 20 2002 Joe Orton <jorton@redhat.com>
513 - initial build; based heavily on apache.spec and mod_ssl.spec
514 - fixes: #65214, #58490, #57376, #61265, #65518, #58177, #57245