{"thread":{"id":"18010","subject":"[PATCH] Allow HTTP tests to run on Darwin","startedAt":"2009-02-25T08:28:15Z","lastAt":"2009-02-25T08:28:15Z","messageCount":1,"participants":["Jay Soffian"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"106154","messageId":"1235550495-94709-1-git-send-email-jaysoffian@gmail.com","threadId":"18010","inReplyTo":null,"subject":"[PATCH] Allow HTTP tests to run on Darwin","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-02-25T08:28:15Z","receivedAt":"2009-02-25T08:28:15Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"This patch allows the HTTP tests to run on OS X 10.5. It is not\nsufficient to be able to pass in LIB_HTTPD_PATH and\nLIB_HTTPD_MODULE_PATH alone, as the apache.conf also needs a couple\ntweaks.\n\nThese changes are put into an <IfDefine> to keep them Darwin specific,\nbut this means lib-httpd.sh needs to be modified to pass -DDarwin to\napache when running on Darwin. As long as we're making this change to\nlib-httpd.sh, we may as well set LIB_HTTPD_PATH and\nLIB_HTTPD_MODULE_PATH to appropriate default values for the platform.\n\nNote that we now pass HTTPD_PARA to apache at shutdown as well.\nOtherwise apache will emit a harmless, but noisy warning that LogFormat\nis an unknown directive.\n\nSigned-off-by: Jay Soffian <jaysoffian@gmail.com>\n---\n t/lib-httpd.sh          |   22 +++++++++++++++++-----\n t/lib-httpd/apache.conf |    6 ++++++\n 2 files changed, 23 insertions(+), 5 deletions(-)\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex 3824020..86cdebc 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -11,7 +11,21 @@ then\n \texit\n fi\n \n-LIB_HTTPD_PATH=${LIB_HTTPD_PATH-'/usr/sbin/apache2'}\n+HTTPD_PARA=\"\"\n+\n+case $(uname) in\n+\tDarwin)\n+\t\tDEFAULT_HTTPD_PATH='/usr/sbin/httpd'\n+\t\tDEFAULT_HTTPD_MODULE_PATH='/usr/libexec/apache2'\n+\t\tHTTPD_PARA=\"$HTTPD_PARA -DDarwin\"\n+\t;;\n+\t*)\n+\t\tDEFAULT_HTTPD_PATH='/usr/sbin/apache2'\n+\t\tDEFAULT_HTTPD_MODULE_PATH='/usr/lib/apache2/modules'\n+\t;;\n+esac\n+\n+LIB_HTTPD_PATH=${LIB_HTTPD_PATH-\"$DEFAULT_HTTPD_PATH\"}\n LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}\n \n TEST_PATH=\"$TEST_DIRECTORY\"/lib-httpd\n@@ -39,14 +53,12 @@ then\n \t\t\texit\n \t\tfi\n \n-\t\tLIB_HTTPD_MODULE_PATH='/usr/lib/apache2/modules'\n+\t\tLIB_HTTPD_MODULE_PATH=\"$DEFAULT_HTTPD_MODULE_PATH\"\n \tfi\n else\n \terror \"Could not identify web server at '$LIB_HTTPD_PATH'\"\n fi\n \n-HTTPD_PARA=\"\"\n-\n prepare_httpd() {\n \tmkdir -p \"$HTTPD_DOCUMENT_ROOT_PATH\"\n \n@@ -95,5 +107,5 @@ stop_httpd() {\n \ttrap 'die' EXIT\n \n \t\"$LIB_HTTPD_PATH\" -d \"$HTTPD_ROOT_PATH\" \\\n-\t\t-f \"$TEST_PATH/apache.conf\" -k stop\n+\t\t-f \"$TEST_PATH/apache.conf\" $HTTPD_PARA -k stop\n }\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nindex fdb19a5..af6e5e1 100644\n--- a/t/lib-httpd/apache.conf\n+++ b/t/lib-httpd/apache.conf\n@@ -5,6 +5,12 @@ LogFormat \"%h %l %u %t \\\"%r\\\" %>s %b\" common\n CustomLog access.log common\n ErrorLog error.log\n \n+<IfDefine Darwin>\n+\tLoadModule log_config_module modules/mod_log_config.so\n+\tLockFile accept.lock\n+\tPidFile httpd.pid\n+</IfDefine>\n+\n <IfDefine SSL>\n LoadModule ssl_module modules/mod_ssl.so\n \n-- \n1.6.2.rc1.291.g83eb\n"}]}