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
12 Version: APACHE_VERSION
13 Release: APACHE_RELEASE
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-1-config, /usr/bin/apu-1-config
22 Requires: apr >= 1.0.2, apr-util >= 1.0.2, 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 >= 1.0.2, apr-util-devel >= 1.0.2
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-1-config \
115 --with-apr-util=/usr/bin/apu-1-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-authnz-ldap \
134 --enable-cache --enable-disk-cache --enable-mem-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|`/usr/bin/apr-1-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
206 rm $RPM_BUILD_ROOT%{contentdir}/manual/*/*.xml
209 rmdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/logs
210 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/httpd
212 # symlinks for /etc/httpd
213 ln -s ../..%{_localstatedir}/log/httpd $RPM_BUILD_ROOT/etc/httpd/logs
214 ln -s ../..%{_localstatedir}/run $RPM_BUILD_ROOT/etc/httpd/run
215 ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules
216 ln -s ../..%{_libdir}/httpd/build $RPM_BUILD_ROOT/etc/httpd/build
218 # install SYSV init stuff
219 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
220 install -m755 ./build/rpm/httpd.init \
221 $RPM_BUILD_ROOT/etc/rc.d/init.d/httpd
222 %{__perl} -pi -e "s:\@docdir\@:%{_docdir}/%{name}-%{version}:g" \
223 $RPM_BUILD_ROOT/etc/rc.d/init.d/httpd
225 # install log rotation stuff
226 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
227 install -m644 ./build/rpm/httpd.logrotate \
228 $RPM_BUILD_ROOT/etc/logrotate.d/httpd
230 # Remove unpackaged files
231 rm -rf $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.exp \
232 $RPM_BUILD_ROOT%{contentdir}/htdocs/* \
233 $RPM_BUILD_ROOT%{contentdir}/cgi-bin/*
236 # Add the "apache" user
237 /usr/sbin/useradd -c "Apache" -u 48 \
238 -s /sbin/nologin -r -d %{contentdir} apache 2> /dev/null || :
240 %triggerpostun -- apache < 2.0
241 /sbin/chkconfig --add httpd
244 # Register the httpd service
245 /sbin/chkconfig --add httpd
249 /sbin/service httpd stop > /dev/null 2>&1
250 /sbin/chkconfig --del httpd
254 /sbin/ldconfig ### is this needed?
257 if [ ! -f %{_sysconfdir}/httpd/conf/ssl.key/server.key ] ; then
258 %{_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
262 if [ "x${FQDN}" = "x" ]; then
263 FQDN=localhost.localdomain
266 if [ ! -f %{_sysconfdir}/httpd/conf/ssl.crt/server.crt ] ; then
267 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
272 SomeOrganizationalUnit
279 rm -rf $RPM_BUILD_ROOT
282 %defattr(-,root,root)
284 %doc ABOUT_APACHE README CHANGES LICENSE NOTICE
286 %dir %{_sysconfdir}/httpd
287 %{_sysconfdir}/httpd/modules
288 %{_sysconfdir}/httpd/logs
289 %{_sysconfdir}/httpd/run
290 %dir %{_sysconfdir}/httpd/conf
291 %config(noreplace) %{_sysconfdir}/httpd/conf/httpd.conf
292 %{_sysconfdir}/httpd/conf/httpd-std.conf
293 %config(noreplace) %{_sysconfdir}/httpd/conf/highperformance.conf
294 %{_sysconfdir}/httpd/conf/highperformance-std.conf
295 %config(noreplace) %{_sysconfdir}/httpd/conf/magic
296 %config(noreplace) %{_sysconfdir}/httpd/conf/mime.types
298 %config %{_sysconfdir}/logrotate.d/httpd
299 %config %{_sysconfdir}/rc.d/init.d/httpd
302 %{_sbindir}/htcacheclean
306 %{_sbindir}/logresolve
308 %{_sbindir}/httpd.worker
309 %{_sbindir}/apachectl
310 %{_sbindir}/rotatelogs
311 %attr(4510,root,%{suexec_caller}) %{_sbindir}/suexec
313 %dir %{_libdir}/httpd
314 %dir %{_libdir}/httpd/modules
315 # everything but mod_ssl.so:
316 %{_libdir}/httpd/modules/mod_[a-r]*.so
317 %{_libdir}/httpd/modules/mod_s[petu]*.so
318 %{_libdir}/httpd/modules/mod_[t-z]*.so
321 %dir %{contentdir}/cgi-bin
322 %dir %{contentdir}/html
323 %dir %{contentdir}/icons
324 %dir %{contentdir}/error
325 %dir %{contentdir}/error/include
326 %{contentdir}/icons/*
327 %{contentdir}/error/README
328 %config(noreplace) %{contentdir}/error/*.var
329 %config(noreplace) %{contentdir}/error/include/*.html
331 %attr(0700,root,root) %dir %{_localstatedir}/log/httpd
333 %attr(0700,apache,apache) %dir %{_localstatedir}/lib/dav
337 %{_mandir}/man8/rotatelogs*
338 %{_mandir}/man8/logresolve*
339 %{_mandir}/man8/suexec*
340 %{_mandir}/man8/apachectl.8*
341 %{_mandir}/man8/httpd.8*
342 %{_mandir}/man8/htcacheclean.8*
345 %defattr(-,root,root)
347 %{contentdir}/error/README
350 %defattr(-,root,root)
351 %{_libdir}/httpd/modules/mod_ssl.so
352 %config(noreplace) %{_sysconfdir}/httpd/conf/ssl.conf
353 %{_sysconfdir}/httpd/conf/ssl-std.conf
354 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.crl
355 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.crt
356 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.csr
357 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.key
358 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.prm
359 #%config %{_sysconfdir}/httpd/conf/Makefile
360 #%dir %{_sysconfdir}/httpd/conf/ssl.*
361 %attr(0700,apache,root) %dir %{_localstatedir}/cache/mod_ssl
362 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.dir
363 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.pag
364 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.sem
367 %defattr(-,root,root)
369 %{_sysconfdir}/httpd/build
372 %{_sbindir}/dbmmanage
374 %{_mandir}/man8/apxs.8*
375 %dir %{_libdir}/httpd/build
376 %{_libdir}/httpd/build/*.mk
377 %{_libdir}/httpd/build/instdso.sh
378 %{_libdir}/httpd/build/config.nice
381 * Thu Dec 16 2004 Graham Leggett <minfrin@apache.org> 2.1.3-dev
382 - Changed build to use external apr and apr-util
384 * Thu May 20 2004 Graham Leggett <minfrin@apache.org> 2.0.50-dev
385 - Changed default dependancy to link to db4 instead of db3.
386 - Fixed complaints about unpackaged files.
388 * Sat Apr 5 2003 Graham Leggett <minfrin@apache.org> 2.0.46-dev
389 - Moved mime.types back to the default location.
390 - Added mod_ldap and friends, mod_cache and friends.
391 - Added openldap dependancy.
393 * Sun Mar 30 2003 Graham Leggett <minfrin@apache.org> 2.0.45-1
394 - Created generic Apache rpm spec file from that donated by Redhat.
395 - Removed Redhat specific patches and boilerplate files.
396 - Removed SSL related Makefiles.
398 * Mon Feb 24 2003 Joe Orton <jorton@redhat.com> 2.0.40-21
399 - add security fix for CAN-2003-0020; replace non-printable characters
400 with '!' when printing to error log.
401 - disable debuginfo on IA64.
403 * Tue Feb 11 2003 Joe Orton <jorton@redhat.com> 2.0.40-20
404 - disable POSIX semaphores to support 2.4.18 kernel (#83324)
406 * Wed Jan 29 2003 Joe Orton <jorton@redhat.com> 2.0.40-19
407 - require xmlto 0.0.11 or later
408 - fix apr_strerror on glibc2.3
410 * Wed Jan 22 2003 Tim Powers <timp@redhat.com> 2.0.40-18
413 * Thu Jan 16 2003 Joe Orton <jorton@redhat.com> 2.0.40-17
414 - add mod_cgid and httpd binary built with worker MPM (#75496)
415 - allow choice of httpd binary in init script
416 - pick appropriate CGI module based on loaded MPM in httpd.conf
417 - source /etc/sysconfig/httpd in apachectl to get httpd choice
418 - make "apachectl status" fail gracefully when links isn't found (#78159)
420 * Mon Jan 13 2003 Joe Orton <jorton@redhat.com> 2.0.40-16
421 - rebuild for OpenSSL 0.9.7
423 * Fri Jan 3 2003 Joe Orton <jorton@redhat.com> 2.0.40-15
424 - fix possible infinite recursion in config dir processing (#77206)
425 - fix memory leaks in request body processing (#79282)
427 * Thu Dec 12 2002 Joe Orton <jorton@redhat.com> 2.0.40-14
428 - remove unstable shmht session cache from mod_ssl
429 - get SSL libs from pkg-config if available (Nalin Dahyabhai)
430 - stop "apxs -a -i" from inserting AddModule into httpd.conf (#78676)
432 * Wed Nov 6 2002 Joe Orton <jorton@redhat.com> 2.0.40-13
433 - fix location of installbuilddir in apxs when libdir!=/usr/lib
435 * Wed Nov 6 2002 Joe Orton <jorton@redhat.com> 2.0.40-12
436 - pass libdir to configure; clean up config_vars.mk
437 - package instdso.sh, fixing apxs -i (#73428)
438 - prevent build if upstream MMN differs from mmn macro
439 - remove installed but unpackaged files
441 * Wed Oct 9 2002 Joe Orton <jorton@redhat.com> 2.0.40-11
442 - correct SERVER_NAME encoding in i18n error pages (thanks to Andre Malo)
444 * Wed Oct 9 2002 Joe Orton <jorton@redhat.com> 2.0.40-10
445 - fix patch for CAN-2002-0840 to also cover i18n error pages
447 * Wed Oct 2 2002 Joe Orton <jorton@redhat.com> 2.0.40-9
448 - security fixes for CAN-2002-0840 and CAN-2002-0843
449 - fix for possible mod_dav segfault for certain requests
451 * Tue Sep 24 2002 Gary Benson <gbenson@redhat.com>
452 - updates to the migration guide
454 * Wed Sep 4 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.40-8
455 - link httpd with libssl to avoid library loading/unloading weirdness
457 * Tue Sep 3 2002 Joe Orton <jorton@redhat.com> 2.0.40-7
458 - add LoadModule lines for proxy modules in httpd.conf (#73349)
459 - fix permissions of conf/ssl.*/ directories; add Makefiles for
460 certificate management (#73352)
462 * Mon Sep 2 2002 Joe Orton <jorton@redhat.com> 2.0.40-6
463 - provide "httpd-mmn" to manage module ABI compatibility
465 * Sun Sep 1 2002 Joe Orton <jorton@redhat.com> 2.0.40-5
466 - fix SSL session cache (#69699)
467 - revert addition of LDAP support to apr-util
469 * Mon Aug 26 2002 Joe Orton <jorton@redhat.com> 2.0.40-4
470 - set SIGXFSZ disposition to "ignored" (#69520)
471 - make dummy connections to the first listener in config (#72692)
473 * Mon Aug 26 2002 Joe Orton <jorton@redhat.com> 2.0.40-3
474 - allow "apachectl configtest" on a 1.3 httpd.conf
476 - enable LDAP support in apr-util
477 - don't package everything in /var/www/error as config(noreplace)
479 * Wed Aug 21 2002 Bill Nottingham <notting@redhat.com> 2.0.40-2
480 - add trigger (#68657)
482 * Mon Aug 12 2002 Joe Orton <jorton@redhat.com> 2.0.40-1
485 * Wed Jul 24 2002 Joe Orton <jorton@redhat.com> 2.0.36-8
486 - improve comment on use of UserDir in default config (#66886)
488 * Wed Jul 10 2002 Joe Orton <jorton@redhat.com> 2.0.36-7
489 - use /sbin/nologin as shell for apache user (#68371)
490 - add patch from CVS to fix possible infinite loop when processing
493 * Wed Jun 26 2002 Gary Benson <gbenson@redhat.com> 2.0.36-6
494 - modify init script to detect 1.3.x httpd.conf's and direct users
495 to the migration guide
497 * Tue Jun 25 2002 Gary Benson <gbenson@redhat.com> 2.0.36-5
498 - patch apachectl to detect 1.3.x httpd.conf's and direct users
499 to the migration guide
500 - ship the migration guide
502 * Fri Jun 21 2002 Joe Orton <jorton@redhat.com>
503 - move /etc/httpd2 back to /etc/httpd
504 - add noindex.html page and poweredby logo; tweak default config
505 to load noindex.html if no default "/" page is present.
506 - add patch to prevent mutex errors on graceful restart
508 * Fri Jun 21 2002 Tim Powers <timp@redhat.com> 2.0.36-4
511 * Wed Jun 12 2002 Joe Orton <jorton@redhat.com> 2.0.36-3
512 - add patch to fix SSL mutex handling
514 * Wed Jun 12 2002 Joe Orton <jorton@redhat.com> 2.0.36-2
515 - improved config directory patch
517 * Mon May 20 2002 Joe Orton <jorton@redhat.com>
518 - initial build; based heavily on apache.spec and mod_ssl.spec
519 - fixes: #65214, #58490, #57376, #61265, #65518, #58177, #57245