Skip to content

Commit

Permalink
r1106@embla: ask | 2006-03-05 17:45:03 -0800
Browse files Browse the repository at this point in the history
 local branch
 r2355@embla:  ask | 2006-03-05 19:23:40 -0800
 small bundle updates
 r2472@embla:  ask | 2006-03-21 14:00:10 -0800
 update todo (with things already done?)
 
 take warnings out of CPANRatings::Control::Rate
 r2488@embla:  ask | 2006-03-23 16:50:45 -0800
 automatically add CBROOT and CBROOTLOCAL to @inc
 r2489@embla:  ask | 2006-03-23 17:20:51 -0800
 work_path and log_path configuration options
 


git-svn-id: https://svn.develooper.com/combust/trunk@477 516b4451-ceb8-0310-875f-b17149c99682
  • Loading branch information
abh committed Mar 24, 2006
1 parent 8755efe commit 8521815
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 31 deletions.
9 changes: 0 additions & 9 deletions TODO
Expand Up @@ -2,15 +2,6 @@
In rough order of priority
==========================

root_default in httpd.tmpl

in combust/apache/conf/httpd.tmpl

make "sites = " default to all configured sites
disabled=1 option in the sites section



Sort out where mime.types is being found. Is what it says in the
sample configuration right? What is apache_config used for anyway?

Expand Down
29 changes: 15 additions & 14 deletions apache/conf/httpd.tmpl
Expand Up @@ -17,9 +17,9 @@
# configurable in a future release.

ServerRoot "[% root_default %]/apache/"
LockFile [% root_default %]/apache/logs/httpd.lock
PidFile [% root_default %]/apache/logs/httpd.pid
ScoreBoardFile [% root_default %]/apache/logs/httpd.scoreboard
LockFile "[% config.log_path %]/httpd.lock"
PidFile "[% config.log_path %]/httpd.pid"
ScoreBoardFile "[% config.log_path %]/httpd.scoreboard"
Timeout 300
KeepAlive [% config.keepalive %]
KeepAliveTimeout [% config.keepalivetimeout %]
Expand All @@ -30,7 +30,7 @@ MaxClients [% config.maxclients %]
MaxRequestsPerChild [% config.maxrequestsperchild %]
Listen [% config.port %]

CoreDumpDirectory [% root_default %]/apache/
CoreDumpDirectory "[% config.work_path %]"

[%# this should be a bit more sophisticated and check for each module,
but for now it'll do ... %]
Expand Down Expand Up @@ -80,7 +80,7 @@ serveradmin ask@perl.org
ServerName [% config.servername %]

# valid empty directory
DocumentRoot "[% root_default %]/tmp/htdocs"
DocumentRoot "[% config.work_path %]/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
Expand Down Expand Up @@ -116,19 +116,20 @@ LogFormat "%h %V %u %t %{site}n \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
LogFormat "%h %V %u %t \"%r\" %>s %b" common

[% IF config.use_cronolog %]
[% cronolog_access = config.cronolog_template.replace("LOGFILE","access");
[% log_path = config.log_path;
cronolog_access = config.cronolog_template.replace("LOGFILE","access");
cronolog_error = config.cronolog_template.replace("LOGFILE","error");
cronolog_access_params = config.cronolog_params.replace("LOGFILE","access");
cronolog_error_params = config.cronolog_params.replace("LOGFILE","error");
cronolog_access_params = cronolog_access_params.replace("LOGDIR", "${root_default}/apache/logs");
cronolog_error_params = cronolog_error_params.replace("LOGDIR", "${root_default}/apache/logs");
cronolog_access_params = cronolog_access_params.replace("LOGDIR", log_path);
cronolog_error_params = cronolog_error_params.replace("LOGDIR", log_path);
%]
ErrorLog "|[% config.cronolog_path %] [% root_default %]/apache/logs/[% cronolog_error %] [% cronolog_error_params %]"
CustomLog "|[% config.cronolog_path %] [% root_default %]/apache/logs/[% cronolog_access %] [% cronolog_access_params %]" combined
ErrorLog "|[% config.cronolog_path %] [% config.log_path %]/[% cronolog_error %] [% cronolog_error_params %]"
CustomLog "|[% config.cronolog_path %] [% config.log_path %]/[% cronolog_access %] [% cronolog_access_params %]" combined
[% ELSE %]
ErrorLog [% root_default %]/apache/logs/error_log
CustomLog [% root_default %]/apache/logs/access_log combined
[% END %]
ErrorLog [% config.log_path %]/error_log
CustomLog [% config.log_path %]/access_log combined
[% END %]


ServerSignature Off
Expand Down Expand Up @@ -288,7 +289,7 @@ PerlSetVar ReloadDebug On
[% IF config.apache_dumpheaders %]
PerlModule Apache::DumpHeaders
PerlLogHandler Apache::DumpHeaders
PerlSetVar DumpHeaders_File [% root %]/apache/logs/dumpheaders.log
PerlSetVar DumpHeaders_File [% config.log_path %]/dumpheaders.log
[% END %]

PerlRequire [% root %]/apache/conf/startup.pl
Expand Down
4 changes: 1 addition & 3 deletions bin/cprove
Expand Up @@ -15,9 +15,7 @@ my $prove = $config->perl;
$prove =~ s/\/perl/\/prove/;
$ENV{CBCONFIG} = ($cbrl || $cbr) . '/combust.conf.testing';

my @inc = map { "-I$_/lib" } grep { $_ } ($cbrl, $cbr);

my @prove = ("$cbr/bin/perl", $prove, @inc, @ARGV);
my @prove = ("$cbr/bin/perl", $prove, @ARGV);

print join(" ", @prove), "\n";

Expand Down
6 changes: 5 additions & 1 deletion bin/perl
Expand Up @@ -19,6 +19,10 @@ if [ -z $MYPERL ]; then
exit
fi

$MYPERL ${1+"$@"}
if [ ! -z $CBROOTLOCAL ]; then
LLIB=-I$CBROOTLOCAL/lib
fi

$MYPERL -I$CBROOT/lib $LLIB ${1+"$@"}


7 changes: 5 additions & 2 deletions bin/run_httpd
Expand Up @@ -13,9 +13,12 @@ else
cd $CBROOT
fi

# TODO: change this to check if the httpd is still running every second

mkdir -p tmp/htdocs && mkdir -p tmp/ctpl && mkdir -p apache/logs && \
LOG_PATH=`$CBROOT/bin/perl -MCombust::Config -e 'print Combust::Config->new->log_path'`
WORK_PATH=`$CBROOT/bin/perl -MCombust::Config -e 'print Combust::Config->new->work_path'`

# TODO: change this to check if the httpd is still running every second
mkdir -p $WORK_PATH/htdocs && mkdir -p $WORK_PATH/ctpl && mkdir -p $LOG_PATH && \
$CBROOT/bin/make_configs && \
$CBROOT/apache/bin/apachectl configtest && \
$CBROOT/apache/bin/apachectl stop && sleep 6 && $CBROOT/apache/bin/apachectl start
6 changes: 6 additions & 0 deletions combust.conf.sample
Expand Up @@ -39,6 +39,12 @@ external_port = 0
# use Template::Timer to insert timing information in the TT output (default 0)
# template_timer = 1

# path for log files and the httpd.pid file
# log_path = apache/logs

# path for temporary work files (compiled template cache etc)
# work_path = tmp

# use cronolog for logging:
# use_cronolog = 1
# activate cronologging
Expand Down
16 changes: 15 additions & 1 deletion lib/Combust/Config.pm
Expand Up @@ -208,8 +208,22 @@ sub modperl_path {
$cfg->param('modperl_path');
}

sub log_path {
my $self = shift;
my $path = $cfg->param('log_path') || $self->root_local . '/apache/logs';
$path =~ s!/$!!;
$path;
}

sub work_path {
my $self = shift;
my $path = $cfg->param('work_path') || $self->root_local . '/tmp';
$path =~ s!/$!!;
$path
}

sub httpd {
$cfg->param('httpd') || '/home/perl/apache1/bin/httpd';
$cfg->param('httpd') || '/usr/sbin/httpd';
}

sub perl {
Expand Down
2 changes: 1 addition & 1 deletion lib/Combust/Template.pm
Expand Up @@ -37,7 +37,7 @@ sub new {
my %provider_config = (
PARSER => $parser,
COMPILE_EXT => '.ttc',
COMPILE_DIR => $config->root_local . "/tmp/ctpl",
COMPILE_DIR => $config->work_path . "/ctpl",
#TOLERANT => 1,
#RELATIVE => 1,
CACHE_SIZE => 128, # cache 128 templates
Expand Down

0 comments on commit 8521815

Please sign in to comment.