Created
March 9, 2018 13:15
-
-
Save JBlond/c82a3f6243ba4d5ff550fc2dbaab49d2 to your computer and use it in GitHub Desktop.
branding apache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- include/ap_branding.h 2014-08-22 12:13:35.648000000 -0700 | |
+++ include/ap_branding.h 2014-08-28 16:21:34.234800000 -0700 | |
@@ -0,0 +1,36 @@ | |
+/* 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. | |
+ * The ASF licenses this file to You under the Apache License, Version 2.0 | |
+ * (the "License"); you may not use this file except in compliance with | |
+ * the License. You may obtain a copy of the License at | |
+ * | |
+ * http://www.apache.org/licenses/LICENSE-2.0 | |
+ * | |
+ * Unless required by applicable law or agreed to in writing, software | |
+ * distributed under the License is distributed on an "AS IS" BASIS, | |
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
+ * See the License for the specific language governing permissions and | |
+ * limitations under the License. | |
+ */ | |
+ | |
+/** | |
+ * @file ap_branding.h | |
+ * @brief Third party branding options | |
+ */ | |
+ | |
+#ifndef AP_BRANDING_H | |
+#define AP_BRANDING_H | |
+ | |
+#define AP_BRANDING 1 /* 1, on or 0, off */ | |
+ | |
+#define AP_BRANDING_COMPANY "The Apache Haus" | |
+#define AP_BRANDING_COMPANY_URL "http://www.apachehaus.com" | |
+ | |
+ | |
+#define AP_BRANDING_DISCAIMER "* " AP_BRANDING_COMPANY "\n" \ | |
+"* is not affiliated with, or endorsed by, the Apache Software Foundation.\n" \ | |
+"* Apache HTTP Server, Apache, and the Apache feather logo are trademarks of\n" \ | |
+"* The Apache Software Foundation.\n" | |
+ | |
+#endif /* AP_BRANDING_H */ | |
Index: include/ap_config.h | |
=================================================================== | |
--- include/ap_config.h (revision 1621503) | |
+++ include/ap_config.h (working copy) | |
@@ -25,6 +25,7 @@ | |
#include "apr.h" | |
#include "apr_hooks.h" | |
#include "apr_optional_hooks.h" | |
+#include "ap_branding.h" | |
/* Although this file doesn't declare any hooks, declare the hook group here */ | |
/** | |
Index: include/httpd.h | |
=================================================================== | |
--- include/httpd.h (revision 1621503) | |
+++ include/httpd.h (working copy) | |
@@ -81,7 +81,7 @@ | |
#define HTTPD_ROOT "/os2httpd" | |
#elif defined(WIN32) | |
/** Set default for Windows file system */ | |
-#define HTTPD_ROOT "/apache" | |
+#define HTTPD_ROOT "/Apache22" | |
#elif defined (BEOS) | |
/** Set the default for BeOS */ | |
#define HTTPD_ROOT "/boot/home/apache" | |
@@ -153,6 +153,13 @@ | |
#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin" | |
#endif | |
+/** The path to the httpd executable */ | |
+#ifdef WIN32 | |
+#ifndef HTTPD_EXEC | |
+#define HTTPD_EXEC HTTPD_ROOT "/bin/httpd.exe" | |
+#endif | |
+#endif | |
+ | |
/** The path to the suExec wrapper, can be overridden in Configuration */ | |
#if !defined(NETWARE) && !defined(WIN32) | |
#ifndef SUEXEC_BIN | |
Index: modules/generators/mod_info.c | |
=================================================================== | |
--- modules/generators/mod_info.c (revision 1621503) | |
+++ modules/generators/mod_info.c (working copy) | |
@@ -353,6 +353,18 @@ | |
"<dt><strong>Server Built:</strong> " | |
"<font size=\"+1\"><tt>%s</tt></font></dt>\n", | |
ap_get_server_built()); | |
+#if AP_BRANDING | |
+ ap_rprintf(r, | |
+ "<dt><strong>Distributed by:</strong> " | |
+ "<font size=\"+1\"><tt>%s</tt> (%s)</font></dt>\n", | |
+ AP_BRANDING_COMPANY, AP_BRANDING_COMPANY_URL); | |
+#endif | |
+#if _MSC_VER | |
+ ap_rprintf(r, | |
+ "<dt><strong>Compiled with:</strong> " | |
+ "<font size=\"+1\"><tt>%s</tt></font></dt>\n", | |
+ MSVC_COMPILER); | |
+#endif | |
ap_rprintf(r, | |
"<dt><strong>Server loaded APR Version:</strong> " | |
"<tt>%s</tt></dt>\n", apr_version_string()); | |
Index: modules/generators/mod_status.c | |
=================================================================== | |
--- modules/generators/mod_status.c (revision 1621503) | |
+++ modules/generators/mod_status.c (working copy) | |
@@ -414,7 +414,16 @@ | |
ap_rvputs(r, "<dl><dt>Server Version: ", | |
ap_get_server_description(), "</dt>\n", NULL); | |
ap_rvputs(r, "<dt>Server Built: ", | |
- ap_get_server_built(), "\n</dt></dl><hr /><dl>\n", NULL); | |
+ ap_get_server_built(), "\n</dt>\n", NULL); | |
+#if AP_BRANDING | |
+ ap_rvputs(r, "<dt>Distributed by: ", | |
+ AP_BRANDING_COMPANY, " (", | |
+ AP_BRANDING_COMPANY_URL, ")\n</dt>\n", NULL); | |
+#endif | |
+#ifdef _MSC_VER | |
+ ap_rvputs(r, "<dt>Compiled with: ", | |
+ MSVC_COMPILER, "\n</dt></dl><hr /><dl>\n", NULL); | |
+#endif | |
ap_rvputs(r, "<dt>Current Time: ", | |
ap_ht_time(r->pool, nowtime, DEFAULT_TIME_FORMAT, 0), | |
"</dt>\n", NULL); | |
Index: modules/http/http_filters.c | |
=================================================================== | |
--- modules/http/http_filters.c (revision 1621503) | |
+++ modules/http/http_filters.c (working copy) | |
@@ -1004,6 +1004,10 @@ | |
server = apr_table_get(r->headers_out, "Server"); | |
if (server) { | |
form_header_field(&h, "Server", server); | |
+#if AP_BRANDING | |
+ form_header_field(&h, "X-Distributed-by", AP_BRANDING_COMPANY " (" | |
+ AP_BRANDING_COMPANY_URL ")"); | |
+#endif | |
} | |
} | |
else { | |
@@ -1011,6 +1015,10 @@ | |
ap_recent_rfc822_date(date, r->request_time); | |
form_header_field(&h, "Date", date); | |
form_header_field(&h, "Server", ap_get_server_banner()); | |
+#if AP_BRANDING | |
+ form_header_field(&h, "X-Distributed-by", AP_BRANDING_COMPANY " (" | |
+ AP_BRANDING_COMPANY_URL ")"); | |
+#endif | |
} | |
/* unset so we don't send them again */ | |
Index: modules/proxy/mod_proxy_balancer.c | |
=================================================================== | |
--- modules/proxy/mod_proxy_balancer.c (revision 1621503) | |
+++ modules/proxy/mod_proxy_balancer.c (working copy) | |
@@ -845,7 +845,16 @@ | |
ap_rvputs(r, "<dl><dt>Server Version: ", | |
ap_get_server_description(), "</dt>\n", NULL); | |
ap_rvputs(r, "<dt>Server Built: ", | |
- ap_get_server_built(), "\n</dt></dl>\n", NULL); | |
+ ap_get_server_built(), "\n</dt>\n", NULL); | |
+#if AP_BRANDING | |
+ ap_rvputs(r, "<dt>Distributed by: ", | |
+ AP_BRANDING_COMPANY, " (", | |
+ AP_BRANDING_COMPANY_URL, ")</dt>\n", NULL); | |
+#endif | |
+#if _MSC_VER | |
+ ap_rvputs(r, "<dt>Compiled with: ", | |
+ MSVC_COMPILER, "</dt></dl>\n", NULL); | |
+#endif | |
balancer = (proxy_balancer *)conf->balancers->elts; | |
for (i = 0; i < conf->balancers->nelts; i++) { | |
Index: os/win32/os.h | |
=================================================================== | |
--- os/win32/os.h (revision 1621503) | |
+++ os/win32/os.h (working copy) | |
@@ -44,6 +44,32 @@ | |
#define PLATFORM "Win32" | |
#endif | |
+/* With all the different binary packages from third parties available | |
+ * using many different versions of Visual Studio, it would be nice to | |
+ * allow the user to know just which compiler the server was built on | |
+ * allowing them to make a more informed choice when finding third party | |
+ * modules to extend their server. | |
+ */ | |
+#if _MSC_VER | |
+# if _MSC_VER == 1300 /* (Visual Studio 6) */ | |
+# define MSVC_COMPILER "Visual Studio 6" | |
+# elif _MSC_VER == 1310 /* (Visual Studio .Net 2003) */ | |
+# define MSVC_COMPILER "Visual Studio .Net 2003" | |
+# elif _MSC_VER == 1400 /* (Visual Studio 2005) */ | |
+# define MSVC_COMPILER "Visual Studio 2005" | |
+# elif _MSC_VER == 1500 /* (Visual Studio 2008) */ | |
+# define MSVC_COMPILER "Visual Studio 2008" | |
+# elif _MSC_VER == 1600 /* (Visual Studio 2010) */ | |
+# define MSVC_COMPILER "Visual Studio 2010" | |
+# elif _MSC_VER == 1700 /* (Visual Studio 2012) */ | |
+# define MSVC_COMPILER "Visual Studio 2012" | |
+# elif _MSC_VER == 1800 /* (Visual Studio 2013) */ | |
+# define MSVC_COMPILER "Visual Studio 2013" | |
+# elif _MSC_VER == 1900 /* (Visual Studio 14) */ | |
+# define MSVC_COMPILER "Visual Studio 14" | |
+# endif | |
+#endif | |
+ | |
/* going away shortly... */ | |
#define HAVE_DRIVE_LETTERS | |
#define HAVE_UNC_PATHS | |
Index: server/main.c | |
=================================================================== | |
--- server/main.c (revision 1621503) | |
+++ server/main.c (working copy) | |
@@ -91,6 +91,13 @@ | |
{ | |
printf("Server version: %s\n", ap_get_server_description()); | |
printf("Server built: %s\n", ap_get_server_built()); | |
+#if AP_BRANDING | |
+ printf("Distributed by: %s (%s)\n", AP_BRANDING_COMPANY, | |
+ AP_BRANDING_COMPANY_URL); | |
+#endif | |
+#ifdef _MSC_VER | |
+ printf("Compiled with: %s\n", MSVC_COMPILER); | |
+#endif | |
printf("Server's Module Magic Number: %u:%u\n", | |
MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR); | |
printf("Server loaded: APR %s, APR-Util %s\n", | |
@@ -221,6 +228,10 @@ | |
printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n"); | |
#endif | |
+#ifdef HTTPD_EXEC | |
+ printf(" -D HTTPD_EXEC=\"" HTTPD_EXEC "\"\n"); | |
+#endif | |
+ | |
#ifdef SUEXEC_BIN | |
printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n"); | |
#endif | |
@@ -252,6 +263,10 @@ | |
#ifdef SERVER_CONFIG_FILE | |
printf(" -D SERVER_CONFIG_FILE=\"" SERVER_CONFIG_FILE "\"\n"); | |
#endif | |
+ | |
+#if AP_BRANDING | |
+ printf("\n%s\n", AP_BRANDING_DISCAIMER); | |
+#endif | |
} | |
#define TASK_SWITCH_SLEEP 10000 | |
Index: server/mpm/winnt/mpm_winnt.c | |
=================================================================== | |
--- server/mpm/winnt/mpm_winnt.c (revision 1621503) | |
+++ server/mpm/winnt/mpm_winnt.c (working copy) | |
@@ -1717,6 +1717,15 @@ | |
ap_get_server_description()); | |
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, | |
"Server built: %s", ap_get_server_built()); | |
+#if AP_BRANDING | |
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, | |
+ "Distributed by: %s (%s)", AP_BRANDING_COMPANY, | |
+ AP_BRANDING_COMPANY_URL); | |
+#endif | |
+#if _MSC_VER | |
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, | |
+ "Compiled with: %s", MSVC_COMPILER); | |
+#endif | |
restart = master_main(ap_server_conf, shutdown_event, restart_event); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ./include/ap_branding.h 2014-08-19 02:27:17.552291500 -0700 | |
+++ ./include/ap_branding.h 2014-08-17 22:01:05.039800000 -0700 | |
@@ -0,0 +1,35 @@ | |
+/* 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. | |
+ * The ASF licenses this file to You under the Apache License, Version 2.0 | |
+ * (the "License"); you may not use this file except in compliance with | |
+ * the License. You may obtain a copy of the License at | |
+ * | |
+ * http://www.apache.org/licenses/LICENSE-2.0 | |
+ * | |
+ * Unless required by applicable law or agreed to in writing, software | |
+ * distributed under the License is distributed on an "AS IS" BASIS, | |
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
+ * See the License for the specific language governing permissions and | |
+ * limitations under the License. | |
+ */ | |
+ | |
+/** | |
+ * @file ap_branding.h | |
+ * @brief Third party branding options | |
+ */ | |
+ | |
+#ifndef AP_BRANDING_H | |
+#define AP_BRANDING_H | |
+ | |
+#define AP_BRANDING 1 /* 1, on or 0, off */ | |
+ | |
+#define AP_BRANDING_COMPANY "The Apache Haus" | |
+ | |
+ | |
+#define AP_BRANDING_DISCAIMER "* " AP_BRANDING_COMPANY "\n" \ | |
+"* is not affiliated with, or endorsed by, the Apache Software Foundation.\n" \ | |
+"* Apache HTTP Server, Apache, and the Apache feather logo are trademarks of\n" \ | |
+"* The Apache Software Foundation.\n" | |
+ | |
+#endif /* AP_BRANDING_H */ | |
Index: include/ap_config.h | |
=================================================================== | |
--- include/ap_config.h (revision 1618997) | |
+++ include/ap_config.h (working copy) | |
@@ -22,6 +22,7 @@ | |
#ifndef AP_CONFIG_H | |
#define AP_CONFIG_H | |
+#include "ap_branding.h" | |
#include "ap_hooks.h" | |
/* Although this file doesn't declare any hooks, declare the exports group here */ | |
Index: include/httpd.h | |
=================================================================== | |
--- include/httpd.h (revision 1619012) | |
+++ include/httpd.h (working copy) | |
@@ -81,7 +81,7 @@ | |
#define HTTPD_ROOT "/os2httpd" | |
#elif defined(WIN32) | |
/** Set default for Windows file system */ | |
-#define HTTPD_ROOT "/apache" | |
+#define HTTPD_ROOT "/Apache24" | |
#elif defined (NETWARE) | |
/** Set the default for NetWare */ | |
#define HTTPD_ROOT "/apache" | |
@@ -150,10 +150,19 @@ | |
#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin" | |
#endif | |
+/** The path to the httpd executable */ | |
+#ifdef WIN32 | |
+#ifndef HTTPD_EXEC | |
+#define HTTPD_EXEC HTTPD_ROOT "/bin/httpd.exe" | |
+#endif | |
+#endif | |
+ | |
/** The path to the suExec wrapper, can be overridden in Configuration */ | |
+#ifdef WIN32 | |
#ifndef SUEXEC_BIN | |
#define SUEXEC_BIN HTTPD_ROOT "/bin/suexec" | |
#endif | |
+#endif | |
/** The timeout for waiting for messages */ | |
#ifndef DEFAULT_TIMEOUT | |
Index: modules/generators/mod_info.c | |
=================================================================== | |
--- modules/generators/mod_info.c (revision 1618997) | |
+++ modules/generators/mod_info.c (working copy) | |
@@ -439,7 +439,19 @@ | |
"<dt><strong>Server Built:</strong> " | |
"<font size=\"+1\"><tt>%s</tt></font></dt>\n", | |
ap_get_server_built()); | |
+#if AP_BRANDING | |
+ ap_rprintf(r, | |
+ "<dt><strong>Distributed by:</strong> " | |
+ "<font size=\"+1\"><tt>%s</tt></font></dt>\n", | |
+ AP_BRANDING_COMPANY); | |
+#endif | |
+#if _MSC_VER | |
ap_rprintf(r, | |
+ "<dt><strong>Compiled with:</strong> " | |
+ "<font size=\"+1\"><tt>%s</tt></font></dt>\n", | |
+ MSVC_COMPILER); | |
+#endif | |
+ ap_rprintf(r, | |
"<dt><strong>Server loaded APR Version:</strong> " | |
"<tt>%s</tt></dt>\n", apr_version_string()); | |
ap_rprintf(r, | |
Index: modules/generators/mod_status.c | |
=================================================================== | |
--- modules/generators/mod_status.c (revision 1618997) | |
+++ modules/generators/mod_status.c (working copy) | |
@@ -408,7 +408,15 @@ | |
ap_rvputs(r, "<dt>Server MPM: ", | |
ap_show_mpm(), "</dt>\n", NULL); | |
ap_rvputs(r, "<dt>Server Built: ", | |
- ap_get_server_built(), "\n</dt></dl><hr /><dl>\n", NULL); | |
+ ap_get_server_built(), "\n</dt>\n", NULL); | |
+#if AP_BRANDING | |
+ ap_rvputs(r, "<dt>Distributed by: ", | |
+ AP_BRANDING_COMPANY, "\n</dt>\n", NULL); | |
+#endif | |
+#ifdef _MSC_VER | |
+ ap_rvputs(r, "<dt>Compiled with: ", | |
+ MSVC_COMPILER, "\n</dt></dl><hr /><dl>\n", NULL); | |
+#endif | |
ap_rvputs(r, "<dt>Current Time: ", | |
ap_ht_time(r->pool, nowtime, DEFAULT_TIME_FORMAT, 0), | |
"</dt>\n", NULL); | |
Index: modules/http/http_filters.c | |
=================================================================== | |
--- modules/http/http_filters.c (revision 1622526) | |
+++ modules/http/http_filters.c (working copy) | |
@@ -1038,6 +1038,11 @@ | |
if (server) | |
form_header_field(&h, "Server", server); | |
+#if AP_BRANDING | |
+ form_header_field(&h, "X-Distributed-by", AP_BRANDING_COMPANY " (" | |
+ AP_BRANDING_COMPANY_URL ")"); | |
+#endif | |
+ | |
if (APLOGrtrace3(r)) { | |
ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, r, | |
"Response sent with status %d%s", | |
Index: modules/proxy/mod_proxy_balancer.c | |
=================================================================== | |
--- modules/proxy/mod_proxy_balancer.c (revision 1618997) | |
+++ modules/proxy/mod_proxy_balancer.c (working copy) | |
@@ -1466,6 +1466,14 @@ | |
ap_get_server_description(), "</dt>\n", NULL); | |
ap_rvputs(r, "<dt>Server Built: ", | |
ap_get_server_built(), "</dt>\n", NULL); | |
+#if AP_BRANDING | |
+ ap_rvputs(r, "<dt>Distributed by: ", | |
+ AP_BRANDING_COMPANY, "</dt>\n", NULL); | |
+#endif | |
+#if _MSC_VER | |
+ ap_rvputs(r, "<dt>Compiled with: ", | |
+ MSVC_COMPILER, "</dt>\n", NULL); | |
+#endif | |
ap_rvputs(r, "<dt>Balancer changes will ", conf->bal_persist ? "" : "NOT ", | |
"be persisted on restart.</dt>", NULL); | |
ap_rvputs(r, "<dt>Balancers are ", conf->inherit ? "" : "NOT ", | |
Index: os/win32/os.h | |
=================================================================== | |
--- os/win32/os.h (revision 1619023) | |
+++ os/win32/os.h (working copy) | |
@@ -44,6 +44,34 @@ | |
#define PLATFORM "Win32" | |
#endif | |
+/* With all the different binary packages from third parties available | |
+ * using many different versions of Visual Studio, it would be nice to | |
+ * allow the user to know just which compiler the server was built on | |
+ * allowing them to make a more informed choice when finding third party | |
+ * modules to extend their server. This should show when calling http -V | |
+ * from the command line in Windows. Thank you Microsoft form making it | |
+ * such a mess! | |
+ */ | |
+#if _MSC_VER | |
+# if _MSC_VER == 1300 /* (Visual Studio 6) */ | |
+# define MSVC_COMPILER "Visual Studio 6" | |
+# elif _MSC_VER == 1310 /* (Visual Studio .Net 2003) */ | |
+# define MSVC_COMPILER "Visual Studio .Net 2003" | |
+# elif _MSC_VER == 1400 /* (Visual Studio 2005) */ | |
+# define MSVC_COMPILER "Visual Studio 2005" | |
+# elif _MSC_VER == 1500 /* (Visual Studio 2008) */ | |
+# define MSVC_COMPILER "Visual Studio 2008" | |
+# elif _MSC_VER == 1600 /* (Visual Studio 2010) */ | |
+# define MSVC_COMPILER "Visual Studio 2010" | |
+# elif _MSC_VER == 1700 /* (Visual Studio 2012) */ | |
+# define MSVC_COMPILER "Visual Studio 2012" | |
+# elif _MSC_VER == 1800 /* (Visual Studio 2013) */ | |
+# define MSVC_COMPILER "Visual Studio 2013" | |
+# elif _MSC_VER == 1900 /* (Visual Studio 14) */ | |
+# define MSVC_COMPILER "Visual Studio 14" | |
+# endif | |
+#endif | |
+ | |
/* Define command-line rewriting for this platform, handled by core. | |
* For Windows, this is currently handled inside the WinNT MPM. | |
* XXX To support a choice of MPMs, extract common platform behavior | |
Index: server/main.c | |
=================================================================== | |
--- server/main.c (revision 1618997) | |
+++ server/main.c (working copy) | |
@@ -95,6 +95,12 @@ | |
{ | |
printf("Server version: %s\n", ap_get_server_description()); | |
printf("Server built: %s\n", ap_get_server_built()); | |
+#if AP_BRANDING | |
+ printf("Distributed by: %s\n", AP_BRANDING_COMPANY); | |
+#endif | |
+#ifdef _MSC_VER | |
+ printf("Compiled with: %s\n", MSVC_COMPILER); | |
+#endif | |
printf("Server's Module Magic Number: %u:%u\n", | |
MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR); | |
#if APR_MAJOR_VERSION >= 2 | |
@@ -222,8 +228,8 @@ | |
printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n"); | |
#endif | |
-#ifdef SUEXEC_BIN | |
- printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n"); | |
+#ifdef HTTPD_EXEC | |
+ printf(" -D HTTPD_EXEC=\"" HTTPD_EXEC "\"\n"); | |
#endif | |
#ifdef DEFAULT_PIDLOG | |
@@ -245,6 +251,10 @@ | |
#ifdef SERVER_CONFIG_FILE | |
printf(" -D SERVER_CONFIG_FILE=\"" SERVER_CONFIG_FILE "\"\n"); | |
#endif | |
+ | |
+#if AP_BRANDING | |
+ printf("\n%s\n", AP_BRANDING_DISCAIMER); | |
+#endif | |
} | |
#define TASK_SWITCH_SLEEP 10000 | |
Index: server/mpm/winnt/mpm_winnt.c | |
=================================================================== | |
--- server/mpm/winnt/mpm_winnt.c (revision 1618997) | |
+++ server/mpm/winnt/mpm_winnt.c (working copy) | |
@@ -1722,6 +1722,15 @@ | |
ap_get_server_description()); | |
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(00456) | |
"Server built: %s", ap_get_server_built()); | |
+#if AP_BRANDING | |
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(80000) | |
+ "Distributed by: %s", AP_BRANDING_COMPANY); | |
+#endif | |
+#if _MSC_VER | |
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(80001) | |
+ "Compiled with: %s", MSVC_COMPILER); | |
+#endif | |
+ | |
ap_log_command_line(plog, s); | |
restart = master_main(ap_server_conf, shutdown_event, restart_event); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ./include/ap_branding.h 2014-08-19 02:27:17.552291500 -0700 | |
+++ ./include/ap_branding.h 2014-08-17 22:01:05.039800000 -0700 | |
@@ -0,0 +1,35 @@ | |
+/* 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. | |
+ * The ASF licenses this file to You under the Apache License, Version 2.0 | |
+ * (the "License"); you may not use this file except in compliance with | |
+ * the License. You may obtain a copy of the License at | |
+ * | |
+ * http://www.apache.org/licenses/LICENSE-2.0 | |
+ * | |
+ * Unless required by applicable law or agreed to in writing, software | |
+ * distributed under the License is distributed on an "AS IS" BASIS, | |
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
+ * See the License for the specific language governing permissions and | |
+ * limitations under the License. | |
+ */ | |
+ | |
+/** | |
+ * @file ap_branding.h | |
+ * @brief Third party branding options | |
+ */ | |
+ | |
+#ifndef AP_BRANDING_H | |
+#define AP_BRANDING_H | |
+ | |
+#define AP_BRANDING 1 /* 1, on or 0, off */ | |
+ | |
+#define AP_BRANDING_COMPANY "The Apache Haus" | |
+ | |
+ | |
+#define AP_BRANDING_DISCAIMER "* " AP_BRANDING_COMPANY "\n" \ | |
+"* is not affiliated with, or endorsed by, the Apache Software Foundation.\n" \ | |
+"* Apache HTTP Server, Apache, and the Apache feather logo are trademarks of\n" \ | |
+"* The Apache Software Foundation.\n" | |
+ | |
+#endif /* AP_BRANDING_H */ | |
Index: include/ap_config.h | |
=================================================================== | |
--- include/ap_config.h (revision 1618997) | |
+++ include/ap_config.h (working copy) | |
@@ -22,6 +22,7 @@ | |
#ifndef AP_CONFIG_H | |
#define AP_CONFIG_H | |
+#include "ap_branding.h" | |
#include "ap_hooks.h" | |
/* Although this file doesn't declare any hooks, declare the exports group here */ | |
Index: include/httpd.h | |
=================================================================== | |
--- include/httpd.h (revision 1619012) | |
+++ include/httpd.h (working copy) | |
@@ -81,7 +81,7 @@ | |
#define HTTPD_ROOT "/os2httpd" | |
#elif defined(WIN32) | |
/** Set default for Windows file system */ | |
-#define HTTPD_ROOT "/apache" | |
+#define HTTPD_ROOT "/Apache24" | |
#elif defined (NETWARE) | |
/** Set the default for NetWare */ | |
#define HTTPD_ROOT "/apache" | |
@@ -150,10 +150,19 @@ | |
#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin" | |
#endif | |
+/** The path to the httpd executable */ | |
+#ifdef WIN32 | |
+#ifndef HTTPD_EXEC | |
+#define HTTPD_EXEC HTTPD_ROOT "/bin/httpd.exe" | |
+#endif | |
+#endif | |
+ | |
/** The path to the suExec wrapper, can be overridden in Configuration */ | |
+#ifdef WIN32 | |
#ifndef SUEXEC_BIN | |
#define SUEXEC_BIN HTTPD_ROOT "/bin/suexec" | |
#endif | |
+#endif | |
/** The timeout for waiting for messages */ | |
#ifndef DEFAULT_TIMEOUT | |
Index: modules/generators/mod_info.c | |
=================================================================== | |
--- modules/generators/mod_info.c (revision 1618997) | |
+++ modules/generators/mod_info.c (working copy) | |
@@ -439,7 +439,19 @@ | |
"<dt><strong>Server Built:</strong> " | |
"<font size=\"+1\"><tt>%s</tt></font></dt>\n", | |
ap_get_server_built()); | |
+#if AP_BRANDING | |
+ ap_rprintf(r, | |
+ "<dt><strong>Distributed by:</strong> " | |
+ "<font size=\"+1\"><tt>%s</tt></font></dt>\n", | |
+ AP_BRANDING_COMPANY); | |
+#endif | |
+#if _MSC_VER | |
ap_rprintf(r, | |
+ "<dt><strong>Compiled with:</strong> " | |
+ "<font size=\"+1\"><tt>%s</tt></font></dt>\n", | |
+ MSVC_COMPILER); | |
+#endif | |
+ ap_rprintf(r, | |
"<dt><strong>Server loaded APR Version:</strong> " | |
"<tt>%s</tt></dt>\n", apr_version_string()); | |
ap_rprintf(r, | |
Index: modules/generators/mod_status.c | |
=================================================================== | |
--- modules/generators/mod_status.c (revision 1618997) | |
+++ modules/generators/mod_status.c (working copy) | |
@@ -408,7 +408,15 @@ | |
ap_rvputs(r, "<dt>Server MPM: ", | |
ap_show_mpm(), "</dt>\n", NULL); | |
ap_rvputs(r, "<dt>Server Built: ", | |
- ap_get_server_built(), "\n</dt></dl><hr /><dl>\n", NULL); | |
+ ap_get_server_built(), "\n</dt>\n", NULL); | |
+#if AP_BRANDING | |
+ ap_rvputs(r, "<dt>Distributed by: ", | |
+ AP_BRANDING_COMPANY, "\n</dt>\n", NULL); | |
+#endif | |
+#ifdef _MSC_VER | |
+ ap_rvputs(r, "<dt>Compiled with: ", | |
+ MSVC_COMPILER, "\n</dt></dl><hr /><dl>\n", NULL); | |
+#endif | |
ap_rvputs(r, "<dt>Current Time: ", | |
ap_ht_time(r->pool, nowtime, DEFAULT_TIME_FORMAT, 0), | |
"</dt>\n", NULL); | |
Index: modules/http/http_filters.c | |
=================================================================== | |
--- modules/http/http_filters.c (revision 1622530) | |
+++ modules/http/http_filters.c (working copy) | |
@@ -956,6 +956,11 @@ | |
if (server) | |
form_header_field(&h, "Server", server); | |
+#if AP_BRANDING | |
+ form_header_field(&h, "X-Distributed-by", AP_BRANDING_COMPANY " (" | |
+ AP_BRANDING_COMPANY_URL ")"); | |
+#endif | |
+ | |
if (APLOGrtrace3(r)) { | |
ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, r, | |
"Response sent with status %d%s", | |
Index: modules/proxy/mod_proxy_balancer.c | |
=================================================================== | |
--- modules/proxy/mod_proxy_balancer.c (revision 1618997) | |
+++ modules/proxy/mod_proxy_balancer.c (working copy) | |
@@ -1466,6 +1466,14 @@ | |
ap_get_server_description(), "</dt>\n", NULL); | |
ap_rvputs(r, "<dt>Server Built: ", | |
ap_get_server_built(), "</dt>\n", NULL); | |
+#if AP_BRANDING | |
+ ap_rvputs(r, "<dt>Distributed by: ", | |
+ AP_BRANDING_COMPANY, "</dt>\n", NULL); | |
+#endif | |
+#if _MSC_VER | |
+ ap_rvputs(r, "<dt>Compiled with: ", | |
+ MSVC_COMPILER, "</dt>\n", NULL); | |
+#endif | |
ap_rvputs(r, "<dt>Balancer changes will ", conf->bal_persist ? "" : "NOT ", | |
"be persisted on restart.</dt>", NULL); | |
ap_rvputs(r, "<dt>Balancers are ", conf->inherit ? "" : "NOT ", | |
Index: os/win32/os.h | |
=================================================================== | |
--- os/win32/os.h (revision 1619023) | |
+++ os/win32/os.h (working copy) | |
@@ -44,6 +44,34 @@ | |
#define PLATFORM "Win32" | |
#endif | |
+/* With all the different binary packages from third parties available | |
+ * using many different versions of Visual Studio, it would be nice to | |
+ * allow the user to know just which compiler the server was built on | |
+ * allowing them to make a more informed choice when finding third party | |
+ * modules to extend their server. This should show when calling http -V | |
+ * from the command line in Windows. Thank you Microsoft form making it | |
+ * such a mess! | |
+ */ | |
+#if _MSC_VER | |
+# if _MSC_VER == 1300 /* (Visual Studio 6) */ | |
+# define MSVC_COMPILER "Visual Studio 6" | |
+# elif _MSC_VER == 1310 /* (Visual Studio .Net 2003) */ | |
+# define MSVC_COMPILER "Visual Studio .Net 2003" | |
+# elif _MSC_VER == 1400 /* (Visual Studio 2005) */ | |
+# define MSVC_COMPILER "Visual Studio 2005" | |
+# elif _MSC_VER == 1500 /* (Visual Studio 2008) */ | |
+# define MSVC_COMPILER "Visual Studio 2008" | |
+# elif _MSC_VER == 1600 /* (Visual Studio 2010) */ | |
+# define MSVC_COMPILER "Visual Studio 2010" | |
+# elif _MSC_VER == 1700 /* (Visual Studio 2012) */ | |
+# define MSVC_COMPILER "Visual Studio 2012" | |
+# elif _MSC_VER == 1800 /* (Visual Studio 2013) */ | |
+# define MSVC_COMPILER "Visual Studio 2013" | |
+# elif _MSC_VER == 1900 /* (Visual Studio 14) */ | |
+# define MSVC_COMPILER "Visual Studio 14" | |
+# endif | |
+#endif | |
+ | |
/* Define command-line rewriting for this platform, handled by core. | |
* For Windows, this is currently handled inside the WinNT MPM. | |
* XXX To support a choice of MPMs, extract common platform behavior | |
Index: server/main.c | |
=================================================================== | |
--- server/main.c (revision 1618997) | |
+++ server/main.c (working copy) | |
@@ -95,6 +95,12 @@ | |
{ | |
printf("Server version: %s\n", ap_get_server_description()); | |
printf("Server built: %s\n", ap_get_server_built()); | |
+#if AP_BRANDING | |
+ printf("Distributed by: %s\n", AP_BRANDING_COMPANY); | |
+#endif | |
+#ifdef _MSC_VER | |
+ printf("Compiled with: %s\n", MSVC_COMPILER); | |
+#endif | |
printf("Server's Module Magic Number: %u:%u\n", | |
MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR); | |
#if APR_MAJOR_VERSION >= 2 | |
@@ -222,8 +228,8 @@ | |
printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n"); | |
#endif | |
-#ifdef SUEXEC_BIN | |
- printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n"); | |
+#ifdef HTTPD_EXEC | |
+ printf(" -D HTTPD_EXEC=\"" HTTPD_EXEC "\"\n"); | |
#endif | |
#ifdef DEFAULT_PIDLOG | |
@@ -245,6 +251,10 @@ | |
#ifdef SERVER_CONFIG_FILE | |
printf(" -D SERVER_CONFIG_FILE=\"" SERVER_CONFIG_FILE "\"\n"); | |
#endif | |
+ | |
+#if AP_BRANDING | |
+ printf("\n%s\n", AP_BRANDING_DISCAIMER); | |
+#endif | |
} | |
#define TASK_SWITCH_SLEEP 10000 | |
Index: server/mpm/winnt/mpm_winnt.c | |
=================================================================== | |
--- server/mpm/winnt/mpm_winnt.c (revision 1618997) | |
+++ server/mpm/winnt/mpm_winnt.c (working copy) | |
@@ -1722,6 +1722,15 @@ | |
ap_get_server_description()); | |
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(00456) | |
"Server built: %s", ap_get_server_built()); | |
+#if AP_BRANDING | |
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(80000) | |
+ "Distributed by: %s", AP_BRANDING_COMPANY); | |
+#endif | |
+#if _MSC_VER | |
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(80001) | |
+ "Compiled with: %s", MSVC_COMPILER); | |
+#endif | |
+ | |
ap_log_command_line(plog, s); | |
restart = master_main(ap_server_conf, shutdown_event, restart_event); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment