diff --git a/.gitignore b/.gitignore index c4c6257..62a3130 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ x86_64 /httpd-2.4.18.tar.bz2 /httpd-2.4.23.tar.bz2 /httpd-2.4.25.tar.bz2 +/httpd.socket.5 +/httpd.service.5 diff --git a/httpd.service b/httpd.service index 65048d2..5875d9c 100644 --- a/httpd.service +++ b/httpd.service @@ -1,3 +1,5 @@ +# See httpd.service(5) for more information on using the httpd service. + # Modifying this file in-place is not recommended, because changes # will be overwritten during package upgrades. If you want to # customize the behaviour, the best way is to use "systemctl edit" diff --git a/httpd.service.xml b/httpd.service.xml new file mode 100644 index 0000000..9524045 --- /dev/null +++ b/httpd.service.xml @@ -0,0 +1,180 @@ + + + + + + httpd systemd units + httpd + AuthorOrtonJoejorton@redhat.com + + + + httpd.service + 5 + + + + httpd.service + httpd.socket + httpd unit files for systemd + + + + + /usr/lib/systemd/system/httpd.service, + /usr/lib/systemd/system/httpd.socket + + + + + Description + + This manual page describes the systemd + unit files used to integrate the httpd daemon + with systemd. Two unit files are available: + httpd.service allows the + httpd daemon to be run as a system service, and + httpd.socket allows httpd to be started via + socket-based activation. Most systems will use + httpd.service. + + + Changing default behaviour + + To change the default behaviour of the httpd service, an + over-ride file should be created, rather + than changing + /usr/lib/systemd/system/httpd.service + directly, since such changes would be lost over package + upgrades. Running systemctl edit + httpd.service or systemctl edit + httpd.socket as root will create a drop-in file in + /etc/systemd/system/httpd.service.d which + over-rides the system defaults. + + For example, to set the LD_LIBRARY_PATH + environment variable for the daemon, run systemctl edit + httpd.service and enter: + + [Service] +Environment=LD_LIBRARY_PATH=/opt/vendor/lib + + + + + Starting the service at boot time + + The httpd.service and httpd.socket units are + disabled by default. To start the httpd + service at boot time, run: systemctl enable + httpd.service. In the default configuration, the + httpd daemon will accept connections on port 80 (and, if mod_ssl + is installed, TLS connections on port 443) for any configured + IPv4 or IPv6 address. + + If httpd is configured to depend on any specific IP + address (for example, with a "Listen" directive), which may only + become available during startup, or if httpd depends on other + services (such as a database daemon), the service + must be configured to ensure correct + startup ordering. + + For example, to ensure httpd is only running after all + configured network interfaces are configured, create a drop-in + file (as described above) with the following: + + [Unit] +After=network-online.target +Wants=network-online.target + + See + for more information on startup ordering with systemd. + + + + + Reloading and stopping the service + + When running systemctl reload + httpd.service, a "graceful" + restart is used, which sends a signal to the httpd parent + process to reload the configuration and re-open log files. Any + children with open connections at the time of reload will + terminate only once they have completed serving requests. This + prevents users of the server seeing errors (or potentially + losing data) due to the reload, but means some there is some + delay before any configuration changes take effect for all + users. + + Similarly, a "graceful stop" is used + when systemctl stop httpd.service is run, + which terminates the server only once active connections have + been processed. + + + + + systemd integration and mod_systemd + + httpd.service uses the "" systemd + service type. The mod_systemd module must be + loaded (as in the default configuration) for this to work + correctly - the service will fail if this module is not + loaded. mod_systemd also makes worker and + request statistics available when running systemctl status + httpd. See + systemd.exec5 + for more information on systemd service types. + + + + Security and SELinux + + The default SELinux policy restricts the httpd service in + various ways. The ports to which httpd can bind (using the + Listen directive), which parts of the + filesystem can be accessed, whether outgoing TCP connections are + possible, are limited by default, for example. Many of these + restrictions can be lifted using SELinux booleans and port + types. See + httpd_selinux8 + for more information. + + The httpd service enables PrivateTmp + by default. The /tmp and + /var/tmp directories available within the + httpd process (and CGI scripts, etc) are not shared by other + processes. See + systemd.exec5 + for more information. + + + + + + + Files + + /usr/lib/systemd/system/httpd.service, + /usr/lib/systemd/system/httpd.socket, + /etc/systemd/systemd/httpd.service.d + + + + See also + + + httpd8, + systemd1, + systemctl1, + systemd.service5, + systemd.exec5, + httpd_selinux8 + + + + diff --git a/httpd.socket b/httpd.socket index 705c4e5..a75779c 100644 --- a/httpd.socket +++ b/httpd.socket @@ -1,3 +1,5 @@ +# See httpd.socket(5) for more information on using the httpd service. + [Unit] Description=Apache httpd Server Socket diff --git a/httpd.spec b/httpd.spec index ccae88e..34ae869 100644 --- a/httpd.spec +++ b/httpd.spec @@ -8,7 +8,7 @@ Summary: Apache HTTP Server Name: httpd Version: 2.4.25 -Release: 8%{?dist} +Release: 9%{?dist} URL: http://httpd.apache.org/ Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2 Source1: index.html @@ -40,6 +40,7 @@ Source28: 00-optional.conf # Documentation Source30: README.confd Source31: README.confmod +Source32: httpd.service.xml Source40: htcacheclean.service Source41: htcacheclean.sysconf # build/scripts patches @@ -234,6 +235,8 @@ if test "x${vmmn}" != "x%{mmn}"; then exit 1 fi +xmlto man $RPM_SOURCE_DIR/httpd.service.xml + : Building with MMN %{mmn}, MMN-ISA %{mmnisa} and vendor string '%{vstring}' %build @@ -435,6 +438,11 @@ mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d install -m 644 -p $RPM_SOURCE_DIR/httpd.logrotate \ $RPM_BUILD_ROOT/etc/logrotate.d/httpd +# Install systemd service man pages +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man5 +install -m 644 -p httpd.service.5 httpd.socket.5 \ + $RPM_BUILD_ROOT%{_mandir}/man5 + # fix man page paths sed -e "s|/usr/local/apache2/conf/httpd.conf|/etc/httpd/conf/httpd.conf|" \ -e "s|/usr/local/apache2/conf/mime.types|/etc/mime.types|" \ @@ -625,6 +633,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0700,apache,apache) %dir %{_localstatedir}/cache/httpd/proxy %{_mandir}/man8/* +%{_mandir}/man5/* %{_unitdir}/*.service %{_unitdir}/*.socket @@ -691,6 +700,9 @@ rm -rf $RPM_BUILD_ROOT %{_rpmconfigdir}/macros.d/macros.httpd %changelog +* Fri May 19 2017 Joe Orton - 2.4.25-9 +- add httpd.service(5) and httpd.socket(5) man pages + * Tue May 16 2017 Joe Orton - 2.4.25-8 - require mod_http2, now packaged separately