diff --git a/README.md b/README.md index 04573f7..4944c90 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # apache +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. + diff --git a/apache.spec b/apache.spec new file mode 100644 index 0000000..5ed3b1e --- /dev/null +++ b/apache.spec @@ -0,0 +1,656 @@ +%define groupid 65026 +%define userid 65026 +%define nobodygroupid 65013 +%define nobodyuserid 65013 + +Name: apache +Version: 2.4.9 +Release: 3mamba +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 +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 0755 %{S:1} %{buildroot}%{_initrddir}/httpd +install -p -D -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/sysconfig/httpd + +# logrotate stuff +install -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/httpd + +# 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 +fi +exit 0 + +%post +systemctl daemon-reload +# 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 + systemctl enable httpd +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 +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 +/sbin/ldconfig +systemctl try-restart httpd +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 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 +%{_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 +%{_initrddir}/httpd +%{_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 +/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 +* 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 diff --git a/httpd-initscript b/httpd-initscript new file mode 100644 index 0000000..37a384a --- /dev/null +++ b/httpd-initscript @@ -0,0 +1,86 @@ +#!/bin/bash +# +# httpd -- startup script for the Apache Web Server +# +# chkconfig: 2345 55 15 +# description: Apache is a World Wide Web server. It is used to serve \ +# HTML files and CGI. +# processname: httpd +# pidfile: /run/httpd/httpd.pid +# config: /etc/httpd/conf/httpd.conf + +. /etc/sysconfig/rc + +# Source function library. +[ -r "$rc_functions" ] && . $rc_functions + +NAME=httpd +DAEMON=/usr/sbin/$NAME +DAEMONPID=/run/httpd/$NAME.pid +DAEMONCONF=/etc/httpd/httpd.conf +OPTIONS= + +# Path to the apachectl script, server binary, and short-form for messages. +APACHECTL=/usr/sbin/apachectl + +[ -x $DAEMON ] || exit 0 + +# This will prevent initlog from swallowing up a pass-phrase prompt if +# mod_ssl needs a pass-phrase from the user. +INITLOG_ARGS="" + +# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server +# with the thread-based "worker" MPM; BE WARNED that some modules may not +# work correctly with a thread-based MPM; notably PHP will refuse to start. + +[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME + +[ -r $DAEMONCONF ] || exit 0 + +RETVAL=0 + +# See how we were called. +case "$1" in + start) + echo -n $"Starting $NAME: " + daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS + RETVAL=$? + echo + [ $RETVAL = 0 ] && touch /var/lock/subsys/$NAME + ;; + stop) + echo -n $"Stopping $NAME: " + killproc -p $DAEMONPID $DAEMON + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$NAME $DAEMONPID + ;; + status) + statusproc $DAEMON + RETVAL=$? + ;; + restart|force-reload) + $0 stop + sleep 1 + $0 start + ;; + condrestart) + [ -e /var/lock/subsys/$NAME ] && $0 restart || : + ;; + reload) + echo -n $"Reloading $NAME: " + reloadproc $DAEMON -HUP + RETVAL=$? + echo + ;; + graceful|help|configtest|fullstatus) + $APACHECTL $@ + RETVAL=$? + ;; + *) + echo $"Usage: ""$0 {start|stop|restart|condrestart|reload|status|graceful|help|configtest|fullstatus}" + exit 1 + ;; +esac + +exit $RETVAL diff --git a/httpd-logrotate b/httpd-logrotate new file mode 100644 index 0000000..f4473b1 --- /dev/null +++ b/httpd-logrotate @@ -0,0 +1,17 @@ +/var/log/httpd/access_log { + monthly + rotate 5 + copytruncate + compress + notifempty + missingok +} + +/var/log/httpd/error_log { + monthly + rotate 5 + copytruncate + compress + notifempty + missingok +} diff --git a/httpd-sysconfig b/httpd-sysconfig new file mode 100644 index 0000000..f462fc9 --- /dev/null +++ b/httpd-sysconfig @@ -0,0 +1,4 @@ +# Apache webserver configuration file + +# enable https +#OPTIONS="-D SSL" diff --git a/httpd-update_httpdconf.sh b/httpd-update_httpdconf.sh new file mode 100644 index 0000000..a65bd7e --- /dev/null +++ b/httpd-update_httpdconf.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# update_httpdconf.sh - updates httpd.conf modules list +# Copyright (c) 2006 by Silvan Calarco + +INPUT_CONF=/etc/httpd/httpd.conf.rpmnew +OUTPUT_CONF=/etc/httpd/httpd.conf +MODULES_PREFIX=/usr +MODULES_APPEND=lib/apache +MODULES_PATH=$MODULES_PREFIX/$MODULES_APPEND +cont=0 + +# no rpmnew file ? silently nothing to do +[ -e $INPUT_CONF ] || exit 0 + +for a in `grep ^LoadModule $INPUT_CONF | gawk '{ print $3 }'`; do + MODULE[$cont]=`echo $a | sed "s|.*/mod_\(.*\)\.so|\1|"` + let cont+=1 +done + +# remove missing modules +for a in `grep ^LoadModule $OUTPUT_CONF | gawk '{ print $3 }'`; do + [ -e $MODULES_PREFIX/$a ] || { + echo "Removing missing module $a" + A=`echo $a | sed 's|\/|\\\\\/|g'` + sed -i "/^LoadModule .* $A/d" $OUTPUT_CONF + } +done + +ANCHOR_LINE=`grep "^LoadModule .*" $OUTPUT_CONF | tail -n 1 | sed 's|\/|\\\\\/|g'` + +#echo $ANCHOR_LINE +#exit 1 + +# adding new modules +for a in ${MODULE[*]}; do + grep "^LoadModule .* $MODULES_APPEND/mod_$a.so" $OUTPUT_CONF >/dev/null || { + #echo "Configuring module $a" + sed -i "/${ANCHOR_LINE}/a \ +LoadModule ${a}_module $MODULES_APPEND\/mod_$a.so" $OUTPUT_CONF + ANCHOR_LINE=`echo "LoadModule ${a}_module $MODULES_APPEND/mod_$a.so" | sed 's|\/|\\\\\/|g'` + } +done + +sed -i "s|/etc/httpd/ssl.conf|/etc/httpd/extra/httpd-ssl.conf|" $OUTPUT_CONF diff --git a/httpd.service b/httpd.service new file mode 100644 index 0000000..4665ac3 --- /dev/null +++ b/httpd.service @@ -0,0 +1,16 @@ +[Unit] +Description=The Apache HTTP Server +After=network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +Environment=LANG=C +PIDFile=/run/httpd/httpd.pid +ExecStart=/usr/sbin/apachectl start $OPTIONS +ExecStop=/usr/sbin/apachectl graceful-stop +ExecReload=/usr/sbin/apachectl graceful $OPTIONS +PrivateTmp=true +LimitNOFILE=infinity + +[Install] +WantedBy=multi-user.target