Script fixes to get database working with the HTTPS-enabled store-cluster sample configuration. Also some logging improvements and aggregation of the sample logs using scribe.

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@987012 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jsdelfino 2010-08-19 04:10:43 +00:00
commit 768a1e33e5
28 changed files with 455 additions and 119 deletions

View file

@ -92,7 +92,7 @@ HostNameLookups Off
# Log HTTP requests
LogLevel info
ErrorLog $root/logs/error_log
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
LogFormat "[%{%a %b %d %H:%M:%S %Y}t] [access] %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
CustomLog $root/logs/access_log combined
# Configure Mime types

View file

@ -24,6 +24,9 @@ root=`readlink -f $1`
conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"`
host=`echo $conf | awk '{ print $6 }'`
gport=`echo $conf | awk '{ print $7 }'`
port=`$here/httpd-addr port $gport`
pport=`$here/httpd-addr pport $gport`
sslpport=`$here/httpd-addr pport $2`
ssllisten=`$here/httpd-addr listen $2`
@ -44,7 +47,8 @@ cat >>$root/conf/httpd.conf <<EOF
# Redirect all HTTP traffic to HTTPS
<Location />
RewriteEngine on
RewriteCond %{HTTPS} !^on$
RewriteCond %{SERVER_PORT} ^$port$ [OR]
RewriteCond %{SERVER_PORT} ^$pport$
RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L]
</Location>
@ -99,8 +103,7 @@ SSLVerifyClient optional
SSLVerifyDepth 1
# Log SSL requests
#CustomLog "$root/logs/ssl_request_log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
LogFormat "%h %l %u %t %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" \"%{SSL_CLIENT_I_DN}x\" \"%{SSL_CLIENT_S_DN}x\"" sslcombined
LogFormat "[%{%a %b %d %H:%M:%S %Y}t] [sslaccess] %h %l %u %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" \"%{SSL_CLIENT_I_DN}x\" \"%{SSL_CLIENT_S_DN}x\"" sslcombined
CustomLog $root/logs/ssl_access_log sslcombined
EOF

View file

@ -43,6 +43,7 @@
#include <util_script.h>
#include <util_md5.h>
#include <http_config.h>
#include <http_log.h>
#include <ap_mpm.h>
#include <mod_core.h>
@ -50,6 +51,7 @@
#include "stream.hpp"
#include "list.hpp"
#include "value.hpp"
#include "monad.hpp"
namespace tuscany {
@ -408,44 +410,60 @@ const void* userData(const string& k, const server_rec* s) {
/**
* Debug log.
*/
/**
* Log an optional value.
*/
const char* debugOptional(const char* s) {
if (s == NULL)
return "";
return s;
}
/**
* Log a header
*/
int debugHeader(unused void* r, const char* key, const char* value) {
cerr << " header key: " << key << ", value: " << value << endl;
cdebug << " header key: " << key << ", value: " << value << endl;
return 1;
}
/**
* Log an environment variable
*/
int debugEnv(unused void* r, const char* key, const char* value) {
cerr << " var key: " << key << ", value: " << value << endl;
cdebug << " var key: " << key << ", value: " << value << endl;
return 1;
}
/**
* Log a note.
*/
int debugNote(unused void* r, const char* key, const char* value) {
cerr << " note key: " << key << ", value: " << value << endl;
cdebug << " note key: " << key << ", value: " << value << endl;
return 1;
}
/**
* Log a request.
*/
const bool debugRequest(request_rec* r, const string& msg) {
cerr << msg << ":" << endl;
cerr << " server: " << debugOptional(r->server->server_hostname) << endl;
cerr << " protocol: " << debugOptional(r->protocol) << endl;
cerr << " method: " << debugOptional(r->method) << endl;
cerr << " method number: " << r->method_number << endl;
cerr << " content type: " << contentType(r) << endl;
cerr << " content encoding: " << debugOptional(r->content_encoding) << endl;
cdebug << msg << ":" << endl;
cdebug << " server: " << debugOptional(r->server->server_hostname) << endl;
cdebug << " protocol: " << debugOptional(r->protocol) << endl;
cdebug << " method: " << debugOptional(r->method) << endl;
cdebug << " method number: " << r->method_number << endl;
cdebug << " content type: " << contentType(r) << endl;
cdebug << " content encoding: " << debugOptional(r->content_encoding) << endl;
apr_table_do(debugHeader, r, r->headers_in, NULL);
cerr << " unparsed uri: " << debugOptional(r->unparsed_uri) << endl;
cerr << " uri: " << debugOptional(r->uri) << endl;
cerr << " path info: " << debugOptional(r->path_info) << endl;
cerr << " filename: " << debugOptional(r->filename) << endl;
cerr << " uri tokens: " << pathTokens(r->uri) << endl;
cerr << " args: " << debugOptional(r->args) << endl;
cerr << " user: " << debugOptional(r->user) << endl;
cerr << " auth type: " << debugOptional(r->ap_auth_type) << endl;
cdebug << " unparsed uri: " << debugOptional(r->unparsed_uri) << endl;
cdebug << " uri: " << debugOptional(r->uri) << endl;
cdebug << " path info: " << debugOptional(r->path_info) << endl;
cdebug << " filename: " << debugOptional(r->filename) << endl;
cdebug << " uri tokens: " << pathTokens(r->uri) << endl;
cdebug << " args: " << debugOptional(r->args) << endl;
cdebug << " user: " << debugOptional(r->user) << endl;
cdebug << " auth type: " << debugOptional(r->ap_auth_type) << endl;
apr_table_do(debugEnv, r, r->subprocess_env, NULL);
apr_table_do(debugEnv, r, r->notes, NULL);
return true;