%define groupid 65026 %define userid 65026 %define nobodygroupid 65013 %define nobodyuserid 65013 %define sftponlygroupid 65437 Name: apache Version: 2.4.17 Release: 1mamba Epoch: 1 Summary: The Apache webserver Group: System/Servers Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco URL: http://httpd.apache.org Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2 Source1: httpd-initscript Source2: httpd-sysconfig Source3: httpd-logrotate Source4: httpd-update_httpdconf.sh Source5: httpd.service Source6: apache-add-vhost License: Apache License 2.0 ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel BuildRequires: libapr-devel BuildRequires: libaprutil-devel BuildRequires: libdb47-devel BuildRequires: libexpat-devel BuildRequires: libgdbm-devel BuildRequires: liblua-devel BuildRequires: liblzma-devel BuildRequires: libopenldap-devel BuildRequires: libopenssl-devel BuildRequires: libpcre-devel BuildRequires: libsasl-devel BuildRequires: libuuid-devel BuildRequires: libxml2-devel BuildRequires: libz-devel BuildRequires: perl-devel ## AUTOBUILDREQ-END BuildRequires: libdistcache-devel Provides: httpd = %{?epoch:%epoch:}%{version}-%{release} Obsoletes: apache-source BuildRoot: %{_tmppath}/%{name}-%{version}-root %description Apache is a powerful, full-featured, efficient, and freely-available Web server. Apache is also the most popular Web server on the Internet. The Apache/Perl integration project brings together the full power of the Perl programming language and the Apache HTTP server. %package devel Group: Development/Libraries Summary: Module development tools for apache Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} Provides: httpd-devel = %{?epoch:%epoch:}%{version}-%{release} %description -n apache-devel The apache-devel package contains the APXS binary and other files that you need to build Dynamic Shared Objects (DSOs) for Apache. If you are installing the Apache Web server and you want to be able to compile or develop additional modules for Apache, you need to install this package. %package manual Summary: The apache Manual Group: Documentation Provides: httpd-manual = %{?epoch:%epoch:}%{version}-%{release} %description -n apache-manual This package contains the apache server documentation in HTML format. %package source Summary: The apache sources Group: Development/Applications Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} Requires: %{name}-devel = %{?epoch:%epoch:}%{version}-%{release} Provides: httpd-source = %{?epoch:%epoch:}%{version}-%{release} %description -n apache-source This package contains the apache server sources, to be used to build modules. %package mod_suexec Group: Applications/Security Summary: Apache module for launching a CGI script as another user Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} %description mod_suexec Apache module for launching a CGI script as another user. %debug_package %prep %setup -q -n httpd-%{version} cat >> config.layout << _EOF prefix: %{_prefix} exec_prefix: %{_prefix} bindir: %{_bindir} sbindir: %{_sbindir} libdir: %{_libdir} libexecdir: %{_libdir}/apache mandir: %{_mandir} sysconfdir: %{_sysconfdir}/httpd/ datadir: /var/www installbuilddir: /usr/lib/apache/build errordir: /var/www/error iconsdir: /var/www/icons htdocsdir: /var/www/html manualdir: /var/www/manual cgidir: /var/www/cgi-bin includedir: %{_includedir}/apache localstatedir: /var runtimedir: /run/httpd logfiledir: /var/log/httpd proxycachedir: /var/cache/httpd _EOF %build %configure \ --datadir=/var/www \ --includedir=%{_includedir}/apache \ --libexecdir=%{_libdir}/apache \ --sysconfdir=%{_sysconfdir}/httpd/ \ --enable-layout=OPENMAMBA \ --enable-so \ --enable-modules=all \ --enable-mods-shared=all \ --enable-authn-file=shared \ --enable-authn_dbm=shared \ --enable-authn_anon=shared \ --enable-authn_dbd=shared \ --enable-authn_default=shared \ --enable-authn_alias=shared \ --enable-authz_host=shared \ --enable-authz_groupfile=shared \ --enable-authz_user=shared \ --enable-authz_dbm=shared \ --enable-authz_owner=shared \ --enable-authnz_ldap=shared \ --enable-auth_digest=shared \ --enable-alias=shared \ --enable-file-cache=shared \ --enable-cache=shared \ --enable-disk-cache=shared \ --enable-mem-cache=shared \ --enable-dbd=shared \ --enable-bucketeer=shared \ --enable-dumpio=shared \ --enable-echo=shared \ --enable-case_filter=shared \ --enable-case-filter-in=shared \ --enable-ext-filter=shared \ --enable-include=shared \ --enable-charset-lite=shared \ --enable-deflate=shared \ --enable-ldap=shared \ --enable-log_config=shared \ --enable-log-forensic=shared \ --enable-logio=shared \ --enable-env=shared \ --enable-mime-magic=shared \ --enable-cern-meta=shared \ --enable-expires=shared \ --enable-headers=shared \ --enable-ident=shared \ --enable-usertrack=shared \ --enable-unique-id=shared \ --enable-setenvif=shared \ --enable-proxy=shared \ --enable-proxy-connect=shared \ --enable-proxy-ftp=shared \ --enable-proxy-http=shared \ --enable-proxy-ajp=shared \ --enable-proxy-balancer=shared \ --enable-ssl=shared \ --enable-optional-hook-export=shared \ --enable-optional-hook-import=shared \ --enable-optional-fn-import=shared \ --enable-optional-fn-export=shared \ --enable-mime=shared \ --enable-dav=shared \ --enable-status=shared \ --enable-autoindex=shared \ --enable-asis=shared \ --enable-info=shared \ --enable-cgid=shared \ --enable-cgi=shared \ --enable-dav-fs=shared \ --enable-dav-lock=shared \ --enable-vhost-alias=shared \ --enable-negotiation=shared \ --enable-dir=shared \ --enable-imagemap=shared \ --enable-actions=shared \ --enable-speling=shared \ --enable-userdir=shared \ --enable-alias=shared \ --enable-rewrite=shared \ --enable-suexec=shared \ --disable-example \ --enable-distcache \ --enable-http=yes \ --with-z=%{_prefix} \ --with-ssl=%{_prefix} \ --with-pcre=%{_prefix} # Win32 module: --enable-isapi %make %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %makeinstall install -d %{buildroot}%{_libdir}/apache/build install -d %{buildroot}/var/log/httpd #install -d %{buildroot}/var/run/httpd #mv %{buildroot}/var/www/build/* %{buildroot}%{_libdir}/apache/build/ install -p -D -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/sysconfig/httpd # logrotate stuff install -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/httpd install -D -m 0755 %{S:6} %{buildroot}%{_sbindir}/apache-add-vhost # create void log files > %{buildroot}/var/log/httpd/access_log > %{buildroot}/var/log/httpd/error_log %make clean # modify configuration file sed -i "\ s|^User .*|User apache|;\ s|^Group .*|Group nobody|;\ s|#\(AddHandler cgi-script .cgi\)|\1|;\ s|\(LoadModule suexec_module.*\)|#\1|" \ %{buildroot}%{_sysconfdir}/httpd/httpd.conf # modify SSL configuration file sed -i "\ s|logs/|/var/log/httpd/|;\ s|you@example.com|webmaster@`hostname -d`|;\ s|/etc/httpd/.*/server.crt|/var/ssl/certs/localhost.crt|;\ s|/etc/httpd/.*/server.key|/var/ssl/private/localhost.key|;\ s|/usr/htdocs|/var/www/html|" \ %{buildroot}%{_sysconfdir}/httpd/extra/httpd-ssl.conf sed -i "s|^\(#Include .*httpd-ssl.conf\)|\1|" \ %{buildroot}%{_sysconfdir}/httpd/httpd.conf # add httpd.d configuration dir install -d %{buildroot}%{_sysconfdir}/httpd/httpd.d echo " IncludeOptional %{_sysconfdir}/httpd/httpd.d/*.conf" >> \ %{buildroot}%{_sysconfdir}/httpd/httpd.conf # install httpd.conf conversion tool install -m 0755 %{S:4} %{buildroot}%{_sbindir}/update_httpdconf # systemd install -D -m0644 %{SOURCE5} %{buildroot}/lib/systemd/system/httpd.service install -d -m0755 %{buildroot}%{_prefix}/lib/tmpfiles.d cat > %{buildroot}%{_prefix}/lib/tmpfiles.d/httpd.conf << _EOF d /run/httpd 710 root apache d /run/httpd/htcacheclean 700 apache apache _EOF %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %pre if [ $1 -ge 1 ]; then /usr/sbin/groupadd apache -g %{groupid} 2>/dev/null /usr/sbin/useradd -u %{userid} -c 'Apache user' -d /dev/null -g apache \ -s /bin/false apache 2>/dev/null /usr/sbin/groupadd nobody -g %{nobodygroupid} 2>/dev/null /usr/sbin/useradd -c nobody -u %{nobodyuserid} -d /dev/null -g nobody \ -s /bin/false nobody 2>/dev/null /usr/sbin/groupadd sftponly -g %{sftponlygroupid} 2>/dev/null fi exit 0 %post /sbin/ldconfig # new install if [ $1 -eq 1 ]; then # do configuration stuff sed -i "s|^ServerAdmin .*|ServerAdmin webmaster@`hostname -d`|" \ %{_sysconfdir}/httpd/httpd.conf if [ -d %{_sysconfdir}/qmail ]; then install -d %{_sysconfdir}/qmail/alias/ echo "root" > %{_sysconfdir}/qmail/alias/.qmail-webmaster fi fi if [ $1 -ge 1 ]; then apxs -e -a -n slotmem_shm %{_libdir}/apache/mod_slotmem_shm.so sed -i "s|Include[[:space:]]\(/etc/httpd/httpd\.d/\*\.conf\)|IncludeOptional \1|" %{_sysconfdir}/httpd/httpd.conf systemd-tmpfiles --create httpd.conf systemctl -q daemon-reload fi if [ $1 -eq 2 ]; then # update grep "httpd\.d" %{_sysconfdir}/httpd/httpd.conf >/dev/null || \ echo " Include %{_sysconfdir}/httpd/httpd.d/*.conf" >> %{_sysconfdir}/httpd/httpd.conf fi if [ $1 -gt 1 ]; then systemctl -q try-restart httpd elif [ $1 -eq 1 ]; then systemctl -q enable httpd systemctl -q start httpd fi exit 0 %preun if [ $1 -eq 0 ]; then /sbin/chkconfig --del httpd systemctl daemon-reload systemctl disable httpd systemctl stop httpd /usr/sbin/groupdel apache 2>/dev/null /usr/sbin/userdel apache 2>/dev/null fi exit 0 %postun if [ $1 -eq 1 ]; then systemctl try-restart httpd fi /sbin/ldconfig exit 0 %posttrans %{_sbindir}/update_httpdconf exit 0 %post mod_suexec if [ $1 -eq 1 ]; then #install apxs -e -a -n suexec %{_libdir}/apache/mod_suexec.so systemctl -q daemon-reload systemctl -q reload-or-try-restart httpd fi exit 0 %preun mod_suexec if [ $1 -eq 0 ]; then #erase apxs -e -A -n suexec %{_libdir}/apache/mod_suexec.so fi exit 0 %postun mod_suexec if [ $1 -eq 1 ]; then #upgrade test -e /var/lock/subsys/httpd && systemctl reload httpd fi exit 0 %files %defattr(-,root,root) %dir %{_sysconfdir}/httpd %dir %{_sysconfdir}/httpd/extra %dir %{_sysconfdir}/httpd/original %config(noreplace) %{_sysconfdir}/httpd/extra/* %{_sysconfdir}/httpd/original/* %config(noreplace) %{_sysconfdir}/httpd/httpd.conf %config(noreplace) %{_sysconfdir}/httpd/magic %config(noreplace) %{_sysconfdir}/httpd/mime.types %config(noreplace) %{_sysconfdir}/sysconfig/httpd %config(noreplace) %{_sysconfdir}/logrotate.d/httpd %dir %{_sysconfdir}/httpd/httpd.d %{_bindir}/ab %{_bindir}/apxs %{_bindir}/dbmmanage %{_bindir}/htdbm %{_bindir}/htdigest %{_bindir}/htpasswd %{_bindir}/logresolve %{_bindir}/httxt2dbm %{_sbindir}/apachectl %{_sbindir}/checkgid %{_sbindir}/envvars %{_sbindir}/fcgistarter %{_sbindir}/httpd %{_sbindir}/rotatelogs %{_sbindir}/htcacheclean %{_sbindir}/update_httpdconf %{_sbindir}/apache-add-vhost /lib/systemd/system/httpd.service %dir %{_libdir}/apache %{_libdir}/apache/httpd.exp %{_libdir}/apache/mod_*.so %{_prefix}/lib/tmpfiles.d/httpd.conf %exclude %{_libdir}/apache/mod_suexec.so %{_prefix}/lib/apache/build/* /var/www/cgi-bin/* %dir /var/www/error /var/www/error/* /var/www/html/* %dir /var/www/icons /var/www/icons/* %attr(0755,apache,apache) %dir /var/log/httpd %ghost /var/log/httpd/access_log %ghost /var/log/httpd/error_log %{_mandir}/man?/* %files devel %defattr(-,root,root) %{_sbindir}/envvars-std %dir %{_includedir}/apache %{_includedir}/apache/* %dir %{_libdir}/apache %files -n apache-manual %defattr(-,root,root) %dir /var/www/manual /var/www/manual/* %files mod_suexec %defattr(-,root,root) %attr(4750,root,apache) %{_sbindir}/suexec %{_libdir}/apache/mod_suexec.so %changelog * Wed Oct 14 2015 Automatic Build System 2.4.17-1mamba - automatic version update by autodist * Thu Jul 16 2015 Automatic Build System 2.4.16-1mamba - automatic version update by autodist * Sat May 02 2015 Silvan Calarco 2.4.12-4mamba - don't replace %{_sysconfdir}/httpd/extra/* * Thu Mar 12 2015 Silvan Calarco 2.4.12-3mamba - apache-add-vhost: updated with logrotate support and fix for password setting * Thu Feb 12 2015 Silvan Calarco 2.4.12-2mamba - added apache-add-vhost and sftponly group to simplify virtualhosts creation with sftp access - removed obsolete sysv initscript * Thu Feb 05 2015 Automatic Build System 2.4.12-1mamba - automatic version update by autodist * Tue Aug 26 2014 Silvan Calarco 2.4.10-2mamba - httpd.service: set PrivateTmp=false * Sun Jul 20 2014 Automatic Build System 2.4.10-1mamba - automatic version update by autodist * Sun May 25 2014 Silvan Calarco 2.4.9-4mamba - run systemd-tmpfiles in %post to work after installation * Sat May 03 2014 Silvan Calarco 2.4.9-3mamba - x86_64: move tmpfiles.d/httpd.conf from %{_libdir} to %{_prefix}/lib * Mon Apr 21 2014 Silvan Calarco 2.4.9-2mamba - remove executable permission from systemd file * Mon Mar 17 2014 Automatic Build System 2.4.9-1mamba - automatic version update by autodist * Sat Nov 23 2013 Automatic Build System 2.4.7-1mamba - automatic version update by autodist * Sat Aug 10 2013 Silvan Calarco 2.4.6-2mamba - switch runtime dir to /var/run/httpd to /run/httpd, add tmpfiles.d/httpd.conf - systemd service support * Fri Jul 19 2013 Automatic Build System 2.4.6-1mamba - automatic version update by autodist * Thu Feb 28 2013 Automatic Build System 2.4.4-1mamba - automatic version update by autodist * Wed Oct 03 2012 Silvan Calarco 2.4.3-3mamba - replace Include /etc/httpd/httpd.d with IncludeOptional in both default and running configuration * Sat Sep 29 2012 Silvan Calarco 2.4.3-2mamba - enable required slotmem_shm module in configuration upon installation * Mon Aug 20 2012 Automatic Build System 2.4.3-1mamba - automatic version update by autodist * Sun Apr 15 2012 Automatic Build System 2.4.2-1mamba - automatic version update by autodist * Tue Mar 06 2012 Automatic Build System 2.4.1-1mamba - automatic version update by autodist * Tue Jan 31 2012 Automatic Build System 2.2.22-1mamba - automatic version update by autodist * Tue Sep 13 2011 Automatic Build System 2.2.21-1mamba - automatic version update by autodist * Wed Aug 31 2011 Automatic Build System 2.2.20-1mamba - automatic version update by autodist * Sun May 22 2011 Automatic Build System 2.2.19-1mamba - automatic update by autodist * Wed May 11 2011 Automatic Build System 2.2.18-1mamba - automatic update by autodist * Mon Mar 14 2011 Silvan Calarco 2.2.17-3mamba - disable mod_suexec in default configuration as it is packaged apart * Wed Nov 24 2010 Silvan Calarco 2.2.17-2mamba - rebuilt with --enable-mods-shared=all; added debug package * Mon Oct 18 2010 Automatic Build System 2.2.17-1mamba - automatic update to 2.2.17 by autodist * Mon Jul 26 2010 Automatic Build System 2.2.16-1mamba - update to 2.2.16 * Fri Apr 09 2010 Silvan Calarco 2.2.15-2mamba - rebuilt with mod_suexec enabled and packaged apart (required by virtualmin) * Sat Mar 06 2010 Automatic Build System 2.2.15-1mamba - automatic update to 2.2.15 by autodist * Tue Oct 06 2009 Automatic Build System 2.2.14-1mamba - automatic update to 2.2.14 by autodist * Sun Aug 09 2009 Automatic Build System 2.2.13-1mamba - automatic update to 2.2.13 by autodist * Tue Jul 28 2009 Automatic Build System 2.2.12-1mamba - automatic update to 2.2.12 by autodist * Fri Dec 19 2008 Silvan Calarco 2.2.11-1mamba - automatic update to 2.2.11 by autodist * Wed Oct 15 2008 Silvan Calarco 2.2.10-1mamba - automatic update to 2.2.10 by autodist * Sat Jul 05 2008 gil 2.2.9-1mamba - update to 2.2.9 * Thu May 29 2008 Silvan Calarco 2.2.8-1mamba - update to 2.2.8 * Sat Oct 06 2007 Silvan Calarco 2.2.6-2mamba - fix typo in post script * Wed Sep 12 2007 Aleph0 2.2.6-1mamba - update to 2.2.6 - fix CVE-2006-5752, CVE-2007-1862, CVE-2007-1863, CVE-2007-3304, CVE-2007-3847 - fix permissions of %{_sysconfdir}/sysconfig/httpd - build requires libsqlite2-devel * Thu May 24 2007 Silvan Calarco 2.2.4-2mamba - use nobody as the daemon execution group * Thu Apr 19 2007 Davide Madrisan 2.2.4-1mamba - update to version 2.2.4 by autospec - start/stop httpd using a call to service - update initscript * Wed Aug 02 2006 Davide Madrisan 2.2.3-1qilnx - update to version 2.2.3 by autospec - also fixes CVE-2006-3747 (bugzilla#210) - bumped to epoch 1 * Fri May 12 2006 Davide Madrisan 2.2.2-1qilnx - update to version 2.2.2 by autospec - this release include the fixes for both CVE-2005-3352 and CVE-2005-3357 * Wed Mar 01 2006 Silvan Calarco 2.2.0-1qilnx - update to version 2.2.0 by autospec - added modules configuration update script - removed source package * Wed Jan 25 2006 Davide Madrisan 2.0.55-3qilnx - security update for CVE-2005-3352 and CVE-2005-3357 (qibug#96) - fixed package license - some minor fixes on the specfile * Wed Nov 02 2005 Davide Madrisan 2.0.55-2qilnx - requires libapr 0.9.7 * Wed Nov 02 2005 Davide Madrisan 2.0.55-1qilnx - update to version 2.0.55 by autospec - 2.0.55 addresses CAN-2005-[1268,2088,2491,2700,2728,2970]: QSA-2005-130 * Thu Sep 22 2005 Alessandro Ramazzina 2.0.54-3qilnx - security fixes: CAN-2005-2700, CAN-2005-2728 (QSA-2005-110) * Wed Jun 01 2005 Silvan Calarco 2.0.54-2qilnx - added logrotate - added nobody user creation for standards compatibility * Mon May 09 2005 Davide Madrisan 2.0.54-1qilnx - update to version 2.0.54 by autospec - group modified - specfile updates * Fri Feb 18 2005 Silvan Calarco 2.0.53-2qilnx - chkconfig service on new install * Mon Feb 07 2005 Silvan Calarco 2.0.53-1qilnx - update to version 2.0.53 by autospec * Fri Jan 28 2005 Silvan Calarco 2.0.52-5qilnx - apache user and group are now created with their own system (>65000) ids * Thu Jan 27 2005 Silvan Calarco 2.0.52-4qilnx - removed dependency on qmail * Mon Nov 22 2004 Davide Madrisan 2.0.52-3qilnx - security fix QSA-2004-059 (CAN-2004-0942) * Thu Oct 28 2004 Silvan Calarco 2.0.52-2qilnx - rebuild with libdb42 * Wed Oct 27 2004 Silvan Calarco 2.0.52-1qilnx - update to version 2.0.52 by autospec - added httpd.d directory management for included configuration files - also fix: CAN-2004-0811, CAN-2004-0885 * Thu Sep 16 2004 Davide Madrisan 2.0.51-1qilnx - update to version 2.0.51 by autospec - also fixes security vulnerabilities: CAN-2004-0747, CAN-2004-0748, CAN-2004-0751, CAN-2004-0786, CAN-2004-0809 * Fri Sep 03 2004 Davide Madrisan 2.0.50-2qilnx - fixed SSL crt, key path, and webmaster name in the ssl configuration file * Thu Jul 01 2004 Davide Madrisan 2.0.50-1qilnx - new version rebuild - security fixes: CAN-2004-0488, CAN-2004-0493 * Fri May 14 2004 Davide Madrisan 2.0.49-1qilnx - new version rebuild * Wed May 12 2004 Davide Madrisan 2.0.48-4qilnx - security fix: CAN-2004-0113 * Wed Feb 18 2004 Silvan Calarco 2.0.48-3qilnx - fixed initscript reload and condrestart * Tue Feb 17 2004 Silvan Calarco 2.0.48-2qilnx - apr stuff moved to main package * Mon Nov 03 2003 Davide Madrisan 2.0.48-1qilnx - rebuilt with version 2.0.48 - specfile updates * Mon Sep 15 2003 Silvan Calarco 2.0.47-2qilnx - added /etc/sysconfig/httpd with option for ssl - ssl.conf adapted to QiLinux system environment * Tue Sep 09 2003 Silvan Calarco 2.0.47-1qilnx - rebuilt with new version * Wed Jun 18 2003 Silvan Calarco 2.0.45-9qilnx - moved apxs from devel to main package * Tue Jun 17 2003 Silvan Calarco 2.0.45-8qilnx - added apache-source package - fixed %%post and %%postun ... scripts * Wed May 21 2003 Silvan Calarco 2.0.45-7qilnx - moved user creation from %%post to %%pre script * Wed May 21 2003 Silvan Calarco 2.0.45-7qilnx - moved user creation from %%post to %%pre script * Tue May 20 2003 Silvan Calarco 2.0.45-6qilnx - fixed chkconfig initscript part * Tue May 20 2003 Silvan Calarco 2.0.45-5qilnx - added layout configuration * Mon May 19 2003 Silvan Calarco 2.0.45-4qilnx - added httpd initscript * Mon May 12 2003 Alessandro Ramazzina - fixed modules compilation so that they are created as shared objects * Tue May 06 2003 Alessandro Ramazzina - creation of apache package