Skip to content

Commit

Permalink
2.4.28 and
Browse files Browse the repository at this point in the history
  • Loading branch information
b-harper committed Oct 9, 2017
1 parent d6e97cf commit 760a39a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 31 deletions.
19 changes: 9 additions & 10 deletions SOURCES/httpd-2.4.17-socket-activation.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/server/listen.c b/server/listen.c
index 1d9be83..f5f7754 100644
index a8e9e6f..1a6c1d3 100644
--- a/server/listen.c
+++ b/server/listen.c
@@ -34,6 +34,10 @@
Expand Down Expand Up @@ -100,11 +100,10 @@ index 1d9be83..f5f7754 100644
}

#ifdef WIN32
@@ -277,6 +286,124 @@ static apr_status_t close_listeners_on_exec(void *v)
return APR_SUCCESS;
@@ -315,6 +324,123 @@ static int find_listeners(ap_listen_rec **from, ap_listen_rec **to,
return found;
}

+
+#ifdef HAVE_SYSTEMD
+
+static int find_systemd_socket(process_rec * process, apr_port_t port) {
Expand Down Expand Up @@ -222,10 +221,10 @@ index 1d9be83..f5f7754 100644
+
+#endif /* HAVE_SYSTEMD */
+
static const char *alloc_listener(process_rec *process, char *addr,
static const char *alloc_listener(process_rec *process, const char *addr,
apr_port_t port, const char* proto,
void *slave)
@@ -479,7 +606,7 @@ static int open_listeners(apr_pool_t *pool)
@@ -495,7 +621,7 @@ static int open_listeners(apr_pool_t *pool)
}
}
#endif
Expand All @@ -234,7 +233,7 @@ index 1d9be83..f5f7754 100644
++num_open;
}
else {
@@ -591,8 +718,28 @@ AP_DECLARE(int) ap_setup_listeners(server_rec *s)
@@ -607,8 +733,28 @@ AP_DECLARE(int) ap_setup_listeners(server_rec *s)
}
}

Expand Down Expand Up @@ -265,7 +264,7 @@ index 1d9be83..f5f7754 100644
}

for (lr = ap_listeners; lr; lr = lr->next) {
@@ -682,7 +829,7 @@ AP_DECLARE(apr_status_t) ap_duplicate_listeners(apr_pool_t *p, server_rec *s,
@@ -698,7 +844,7 @@ AP_DECLARE(apr_status_t) ap_duplicate_listeners(apr_pool_t *p, server_rec *s,
duplr->bind_addr);
return stat;
}
Expand All @@ -274,7 +273,7 @@ index 1d9be83..f5f7754 100644
#if AP_NONBLOCK_WHEN_MULTI_LISTEN
use_nonblock = (ap_listeners && ap_listeners->next);
stat = apr_socket_opt_set(duplr->sd, APR_SO_NONBLOCK, use_nonblock);
@@ -809,6 +956,11 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
@@ -825,6 +971,11 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
if (argc < 1 || argc > 2) {
return "Listen requires 1 or 2 arguments.";
}
Expand All @@ -286,7 +285,7 @@ index 1d9be83..f5f7754 100644

rv = apr_parse_addr_port(&host, &scope_id, &port, argv[0], cmd->pool);
if (rv != APR_SUCCESS) {
@@ -840,6 +992,12 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
@@ -856,6 +1007,12 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
ap_str_tolower(proto);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
diff --git a/modules/arch/unix/config5.m4 b/modules/arch/unix/config5.m4
index 77027a8..7a13d5a 100644
--- a/modules/arch/unix/config5.m4
+++ b/modules/arch/unix/config5.m4
@@ -18,6 +18,16 @@ APACHE_MODULE(privileges, Per-virtualhost Unix UserIDs and enhanced security for
diff -uap httpd-2.4.27/modules/arch/unix/config5.m4.systemd httpd-2.4.27/modules/arch/unix/config5.m4
diff -uap httpd-2.4.27/modules/arch/unix/config5.m4.systemd httpd-2.4.27/modules/arch/unix/config5.m4
diff -uap httpd-2.4.27/modules/arch/unix/config5.m4.systemd httpd-2.4.27/modules/arch/unix/config5.m4
diff -uap httpd-2.4.27/modules/arch/unix/config5.m4.systemd httpd-2.4.27/modules/arch/unix/config5.m4
--- httpd-2.4.27/modules/arch/unix/config5.m4.systemd
+++ httpd-2.4.27/modules/arch/unix/config5.m4
@@ -18,6 +18,16 @@
fi
])

Expand All @@ -19,12 +21,10 @@ index 77027a8..7a13d5a 100644
APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])

APACHE_MODPATH_FINISH
diff --git a/modules/arch/unix/mod_systemd.c b/modules/arch/unix/mod_systemd.c
new file mode 100644
index 0000000..5381c98
--- /dev/null
+++ b/modules/arch/unix/mod_systemd.c
@@ -0,0 +1,145 @@
diff -uap httpd-2.4.27/modules/arch/unix/mod_systemd.c.systemd httpd-2.4.27/modules/arch/unix/mod_systemd.c
--- httpd-2.4.27/modules/arch/unix/mod_systemd.c.systemd
+++ httpd-2.4.27/modules/arch/unix/mod_systemd.c
@@ -0,0 +1,161 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
Expand Down Expand Up @@ -66,11 +66,20 @@ index 0000000..5381c98
+static unsigned long bytes_served;
+static pid_t mainpid;
+
+static int systemd_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
+ apr_pool_t *ptemp)
+{
+ sd_notify(0,
+ "RELOADING=1\n"
+ "STATUS=Reading configuration...\n");
+ ap_extended_status = 1;
+ return OK;
+}
+
+static int systemd_pre_mpm(apr_pool_t *p, ap_scoreboard_e sb_type)
+{
+ int rv;
+
+ ap_extended_status = 1;
+ mainpid = getpid();
+
+ rv = sd_notifyf(0, "READY=1\n"
Expand All @@ -91,6 +100,11 @@ index 0000000..5381c98
+ char bps[5];
+ int rv;
+
+ if (!ap_extended_status) {
+ /* Nothing useful to report if ExtendedStatus disabled. */
+ return DECLINED;
+ }
+
+ ap_get_sload(&sload);
+ /* up_time in seconds */
+ up_time = (apr_uint32_t) apr_time_sec(apr_time_now() -
Expand Down Expand Up @@ -136,6 +150,8 @@ index 0000000..5381c98
+
+static void systemd_register_hooks(apr_pool_t *p)
+{
+ /* Enable ap_extended_status. */
+ ap_hook_pre_config(systemd_pre_config, NULL, NULL, APR_HOOK_LAST);
+ /* We know the PID in this hook ... */
+ ap_hook_pre_mpm(systemd_pre_mpm, NULL, NULL, APR_HOOK_LAST);
+ /* Used to update httpd's status line using sd_notifyf */
Expand Down
5 changes: 5 additions & 0 deletions SOURCES/httpd.service.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ Wants=network-online.target</programlisting>
which terminates the server only once active connections have
been processed.</para>

<para>To "ungracefully" stop the server without waiting for
requests to complete, use <command>systemctl kill
--kill-who=main httpd</command>; similarly to "ungracefully"
reload the configuration, use <command>systemctl kill
--kill-who=main --signal=HUP httpd</command>.</para>
</refsect2>

<refsect2>
Expand Down
30 changes: 21 additions & 9 deletions SPECS/httpd24u.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@

Summary: Apache HTTP Server
Name: %{real_name}%{ius_suffix}
Version: 2.4.27
Release: 2.ius%{?dist}
URL: http://httpd.apache.org/
Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Version: 2.4.28
Release: 1.ius%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source2: httpd.logrotate
Source3: httpd.sysconf
Source4: httpd-ssl-pass-dialog
Expand Down Expand Up @@ -97,13 +97,12 @@ Patch25: httpd-2.4.25-selinux.patch
Patch26: httpd-2.4.4-r1337344+.patch
Patch27: httpd-2.4.2-icons.patch
Patch28: httpd-2.4.6-r1332643+.patch
Patch29: httpd-2.4.10-mod_systemd.patch
Patch29: httpd-2.4.27-systemd.patch
Patch30: httpd-2.4.4-cachehardmax.patch
Patch31: httpd-2.4.18-sslmultiproxy.patch
Patch34: httpd-2.4.17-socket-activation.patch
# Bug fixes
Patch56: httpd-2.4.4-mod_unique_id.patch
Patch57: httpd-2.4.10-sigint.patch
# Security fixes

License: ASL 2.0
Expand Down Expand Up @@ -313,7 +312,6 @@ interface for storing and accessing per-user session data.
%{?with_systemd:%patch34 -p1 -b .socketactivation}

%patch56 -p1 -b .uniqueid
%patch57 -p1 -b .sigint

# Patch in the vendor string
sed -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h
Expand Down Expand Up @@ -769,8 +767,6 @@ exit $rv
%if %{with systemd}
%{_unitdir}/*.service
%{_unitdir}/*.socket
%attr(755,root,root) %dir %{_unitdir}/httpd.service.d
%attr(755,root,root) %dir %{_unitdir}/httpd.socket.d
%else
# sysvinit
%{_sysconfdir}/rc.d/init.d/httpd
Expand All @@ -786,6 +782,10 @@ exit $rv
%dir %{docroot}/html
%dir %{contentdir}
%dir %{contentdir}/icons
%if %{with systemd}
%attr(755,root,root) %dir %{_unitdir}/httpd.service.d
%attr(755,root,root) %dir %{_unitdir}/httpd.socket.d
%endif

%files tools
%{_bindir}/*
Expand Down Expand Up @@ -831,6 +831,18 @@ exit $rv


%changelog
* Wed Oct 04 2017 Ben Harper <[email protected]> - 2.4.28-1.ius
- Latest upstream
- Remove Patch57, fixed upsteam
- Update Source29 from Fedora:
https://src.fedoraproject.org/rpms/httpd/c/adcaa3428979e75ed3cc4e3a942842be7b16cfa2
- use https for URL and Source0 from Fedora:
https://src.fedoraproject.org/rpms/httpd/c/ddabcffa42aeee042fbe2af37931158ec539cb80
- move service.d and socket.d folders to -filesystem from Fedora:
https://src.fedoraproject.org/rpms/httpd/c/a7a88382f7efa6154d762b7a7a22fc7e4d057adb
- update Source32 from Fedora:
https://src.fedoraproject.org/rpms/httpd/c/870b71c4f0c8e363d0e46c365f5d85fa76b62803

* Mon Aug 07 2017 Carl George <[email protected]> - 2.4.27-2.ius
- Rebuild for EL7.4's openssl-1.0.2k

Expand Down

0 comments on commit 760a39a

Please sign in to comment.