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 %config(noreplace) %{_sysconfdir}/httpd/conf/magic
293 %config(noreplace) %{_sysconfdir}/httpd/conf/mime.types
294 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-autoindex.conf
295 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-dav.conf
296 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-default.conf
297 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-info.conf
298 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-languages.conf
299 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-manual.conf
300 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-mpm.conf
301 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-multilang-errordoc.conf
302 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-userdir.conf
303 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-vhosts.conf
304 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-autoindex.conf
305 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-dav.conf
306 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-default.conf
307 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-info.conf
308 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-languages.conf
309 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-manual.conf
310 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-mpm.conf
311 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-multilang-errordoc.conf
312 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-userdir.conf
313 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-vhosts.conf
314 %config(noreplace) %{_sysconfdir}/httpd/conf/original/httpd.conf
316 %config %{_sysconfdir}/logrotate.d/httpd
317 %config %{_sysconfdir}/rc.d/init.d/httpd
320 %{_sbindir}/htcacheclean
324 %{_sbindir}/logresolve
326 %{_sbindir}/httpd.worker
327 %{_sbindir}/apachectl
328 %{_sbindir}/rotatelogs
329 %attr(4510,root,%{suexec_caller}) %{_sbindir}/suexec
331 %dir %{_libdir}/httpd
332 %dir %{_libdir}/httpd/modules
333 # everything but mod_ssl.so:
334 %{_libdir}/httpd/modules/mod_[a-r]*.so
335 %{_libdir}/httpd/modules/mod_s[petu]*.so
336 %{_libdir}/httpd/modules/mod_[t-z]*.so
339 %dir %{contentdir}/cgi-bin
340 %dir %{contentdir}/html
341 %dir %{contentdir}/icons
342 %dir %{contentdir}/error
343 %dir %{contentdir}/error/include
344 %{contentdir}/icons/*
345 %{contentdir}/error/README
346 %config(noreplace) %{contentdir}/error/*.var
347 %config(noreplace) %{contentdir}/error/include/*.html
349 %attr(0700,root,root) %dir %{_localstatedir}/log/httpd
351 %attr(0700,apache,apache) %dir %{_localstatedir}/lib/dav
355 %{_mandir}/man8/rotatelogs*
356 %{_mandir}/man8/logresolve*
357 %{_mandir}/man8/suexec*
358 %{_mandir}/man8/apachectl.8*
359 %{_mandir}/man8/httpd.8*
360 %{_mandir}/man8/htcacheclean.8*
363 %defattr(-,root,root)
365 %{contentdir}/error/README
368 %defattr(-,root,root)
369 %{_libdir}/httpd/modules/mod_ssl.so
370 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.crl
371 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.crt
372 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.csr
373 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.key
374 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.prm
375 #%config %{_sysconfdir}/httpd/conf/Makefile
376 #%dir %{_sysconfdir}/httpd/conf/ssl.*
377 %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-ssl.conf
378 %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-ssl.conf
379 %attr(0700,apache,root) %dir %{_localstatedir}/cache/mod_ssl
380 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.dir
381 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.pag
382 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.sem
385 %defattr(-,root,root)
387 %{_sysconfdir}/httpd/build
390 %{_sbindir}/dbmmanage
392 %{_mandir}/man8/apxs.8*
393 %dir %{_libdir}/httpd/build
394 %{_libdir}/httpd/build/*.mk
395 %{_libdir}/httpd/build/instdso.sh
396 %{_libdir}/httpd/build/config.nice
397 %{_libdir}/httpd/build/mkdir.sh
400 * Sat Jul 2 2005 Graham Leggett <minfrin@apache.org> 2.1.7-dev
401 - Fixed complaints about unpackaged files with new config file changes.
403 * Thu Dec 16 2004 Graham Leggett <minfrin@apache.org> 2.1.3-dev
404 - Changed build to use external apr and apr-util
406 * Thu May 20 2004 Graham Leggett <minfrin@apache.org> 2.0.50-dev
407 - Changed default dependancy to link to db4 instead of db3.
408 - Fixed complaints about unpackaged files.
410 * Sat Apr 5 2003 Graham Leggett <minfrin@apache.org> 2.0.46-dev
411 - Moved mime.types back to the default location.
412 - Added mod_ldap and friends, mod_cache and friends.
413 - Added openldap dependancy.
415 * Sun Mar 30 2003 Graham Leggett <minfrin@apache.org> 2.0.45-1
416 - Created generic Apache rpm spec file from that donated by Redhat.
417 - Removed Redhat specific patches and boilerplate files.
418 - Removed SSL related Makefiles.
420 * Mon Feb 24 2003 Joe Orton <jorton@redhat.com> 2.0.40-21
421 - add security fix for CAN-2003-0020; replace non-printable characters
422 with '!' when printing to error log.
423 - disable debuginfo on IA64.
425 * Tue Feb 11 2003 Joe Orton <jorton@redhat.com> 2.0.40-20
426 - disable POSIX semaphores to support 2.4.18 kernel (#83324)
428 * Wed Jan 29 2003 Joe Orton <jorton@redhat.com> 2.0.40-19
429 - require xmlto 0.0.11 or later
430 - fix apr_strerror on glibc2.3
432 * Wed Jan 22 2003 Tim Powers <timp@redhat.com> 2.0.40-18
435 * Thu Jan 16 2003 Joe Orton <jorton@redhat.com> 2.0.40-17
436 - add mod_cgid and httpd binary built with worker MPM (#75496)
437 - allow choice of httpd binary in init script
438 - pick appropriate CGI module based on loaded MPM in httpd.conf
439 - source /etc/sysconfig/httpd in apachectl to get httpd choice
440 - make "apachectl status" fail gracefully when links isn't found (#78159)
442 * Mon Jan 13 2003 Joe Orton <jorton@redhat.com> 2.0.40-16
443 - rebuild for OpenSSL 0.9.7
445 * Fri Jan 3 2003 Joe Orton <jorton@redhat.com> 2.0.40-15
446 - fix possible infinite recursion in config dir processing (#77206)
447 - fix memory leaks in request body processing (#79282)
449 * Thu Dec 12 2002 Joe Orton <jorton@redhat.com> 2.0.40-14
450 - remove unstable shmht session cache from mod_ssl
451 - get SSL libs from pkg-config if available (Nalin Dahyabhai)
452 - stop "apxs -a -i" from inserting AddModule into httpd.conf (#78676)
454 * Wed Nov 6 2002 Joe Orton <jorton@redhat.com> 2.0.40-13
455 - fix location of installbuilddir in apxs when libdir!=/usr/lib
457 * Wed Nov 6 2002 Joe Orton <jorton@redhat.com> 2.0.40-12
458 - pass libdir to configure; clean up config_vars.mk
459 - package instdso.sh, fixing apxs -i (#73428)
460 - prevent build if upstream MMN differs from mmn macro
461 - remove installed but unpackaged files
463 * Wed Oct 9 2002 Joe Orton <jorton@redhat.com> 2.0.40-11
464 - correct SERVER_NAME encoding in i18n error pages (thanks to Andre Malo)
466 * Wed Oct 9 2002 Joe Orton <jorton@redhat.com> 2.0.40-10
467 - fix patch for CAN-2002-0840 to also cover i18n error pages
469 * Wed Oct 2 2002 Joe Orton <jorton@redhat.com> 2.0.40-9
470 - security fixes for CAN-2002-0840 and CAN-2002-0843
471 - fix for possible mod_dav segfault for certain requests
473 * Tue Sep 24 2002 Gary Benson <gbenson@redhat.com>
474 - updates to the migration guide
476 * Wed Sep 4 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.40-8
477 - link httpd with libssl to avoid library loading/unloading weirdness
479 * Tue Sep 3 2002 Joe Orton <jorton@redhat.com> 2.0.40-7
480 - add LoadModule lines for proxy modules in httpd.conf (#73349)
481 - fix permissions of conf/ssl.*/ directories; add Makefiles for
482 certificate management (#73352)
484 * Mon Sep 2 2002 Joe Orton <jorton@redhat.com> 2.0.40-6
485 - provide "httpd-mmn" to manage module ABI compatibility
487 * Sun Sep 1 2002 Joe Orton <jorton@redhat.com> 2.0.40-5
488 - fix SSL session cache (#69699)
489 - revert addition of LDAP support to apr-util
491 * Mon Aug 26 2002 Joe Orton <jorton@redhat.com> 2.0.40-4
492 - set SIGXFSZ disposition to "ignored" (#69520)
493 - make dummy connections to the first listener in config (#72692)
495 * Mon Aug 26 2002 Joe Orton <jorton@redhat.com> 2.0.40-3
496 - allow "apachectl configtest" on a 1.3 httpd.conf
498 - enable LDAP support in apr-util
499 - don't package everything in /var/www/error as config(noreplace)
501 * Wed Aug 21 2002 Bill Nottingham <notting@redhat.com> 2.0.40-2
502 - add trigger (#68657)
504 * Mon Aug 12 2002 Joe Orton <jorton@redhat.com> 2.0.40-1
507 * Wed Jul 24 2002 Joe Orton <jorton@redhat.com> 2.0.36-8
508 - improve comment on use of UserDir in default config (#66886)
510 * Wed Jul 10 2002 Joe Orton <jorton@redhat.com> 2.0.36-7
511 - use /sbin/nologin as shell for apache user (#68371)
512 - add patch from CVS to fix possible infinite loop when processing
515 * Wed Jun 26 2002 Gary Benson <gbenson@redhat.com> 2.0.36-6
516 - modify init script to detect 1.3.x httpd.conf's and direct users
517 to the migration guide
519 * Tue Jun 25 2002 Gary Benson <gbenson@redhat.com> 2.0.36-5
520 - patch apachectl to detect 1.3.x httpd.conf's and direct users
521 to the migration guide
522 - ship the migration guide
524 * Fri Jun 21 2002 Joe Orton <jorton@redhat.com>
525 - move /etc/httpd2 back to /etc/httpd
526 - add noindex.html page and poweredby logo; tweak default config
527 to load noindex.html if no default "/" page is present.
528 - add patch to prevent mutex errors on graceful restart
530 * Fri Jun 21 2002 Tim Powers <timp@redhat.com> 2.0.36-4
533 * Wed Jun 12 2002 Joe Orton <jorton@redhat.com> 2.0.36-3
534 - add patch to fix SSL mutex handling
536 * Wed Jun 12 2002 Joe Orton <jorton@redhat.com> 2.0.36-2
537 - improved config directory patch
539 * Mon May 20 2002 Joe Orton <jorton@redhat.com>
540 - initial build; based heavily on apache.spec and mod_ssl.spec
541 - fixes: #65214, #58490, #57376, #61265, #65518, #58177, #57245