head	1.14;
access;
symbols
	TIGRIS_1_1_0RC2:1.13
	TIGRIS_1_1_0RC1:1.13
	TIGRIS_1_1:1.13.0.14
	TIGRIS_1_0_8:1.13
	TIGRIS_1_0_8RC3:1.13
	TIGRIS_1_0_8RC2:1.13
	TIGRIS_1_0_8RC1:1.13
	TIGRIS_1_0_7:1.13
	TIGRIS_1_0_7RC3:1.13
	TIGRIS_1_0_7RC2:1.13
	TIGRIS_1_0_7RC1:1.13
	TIGRIS_1_0_6:1.13
	TIGRIS_1_0_6RC5:1.13
	TIGRIS_1_0_6RC4:1.13
	TIGRIS_1_0_6RC3:1.13
	TIGRIS_1_0_6RC2:1.13
	TIGRIS_1_0_6RC1:1.13
	TIGRIS_1_0_5:1.13
	TIGRIS_1_0_5RC6:1.13
	TIGRIS_1_0_5RC5:1.13
	TIGRIS_1_0_5RC4:1.13
	TIGRIS_1_0_5RC3:1.13
	TIGRIS_1_0_5RC2:1.13
	TIGRIS_1_0_5RC1:1.13
	TIGRIS_1_0_4:1.13
	TIGRIS_1_0_3:1.13
	TIGRIS_1_0_2:1.13
	TIGRIS_1_0_1:1.13
	TIGRIS_1_0:1.13.0.16
	TIGRIS_1_0_0:1.13
	TIGRIS_1_0_0_RC1:1.13.0.12
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.13
	TIGRIS_0_9_2_3:1.13
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.13
	TIGRIS_0_9_2_1:1.13
	TIGRIS_0_9_2:1.13.0.10
	TIGRIS_0_9_0:1.13.0.8
	TIGRIS_0_8_4:1.13.0.6
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1
	OLDHELM:1.13.0.4
	TIGRIS_NOV_11_2000:1.13
	TIGRIS_SEP_13_2000:1.13.0.2
	TIGRIS_BASELINE:1.13;
locks; strict;
comment	@# @;


1.14
date	2001.08.14.21.57.24;	author edk;	state dead;
branches;
next	1.13;

1.13
date	2000.08.29.15.37.55;	author jrobbins;	state Exp;
branches;
next	1.12;

1.12
date	2000.07.13.00.09.13;	author jrobbins;	state Exp;
branches;
next	1.11;

1.11
date	2000.06.22.22.18.06;	author dlr;	state Exp;
branches;
next	1.10;

1.10
date	2000.06.20.02.08.06;	author jrobbins;	state Exp;
branches;
next	1.9;

1.9
date	2000.05.09.16.16.17;	author jrobbins;	state Exp;
branches;
next	1.8;

1.8
date	2000.05.09.01.25.04;	author jrobbins;	state Exp;
branches;
next	1.7;

1.7
date	2000.05.02.21.08.48;	author jrobbins;	state Exp;
branches;
next	1.6;

1.6
date	2000.04.26.20.50.34;	author jrobbins;	state Exp;
branches;
next	1.5;

1.5
date	2000.03.26.20.28.18;	author jrobbins;	state Exp;
branches;
next	1.4;

1.4
date	2000.03.16.00.43.43;	author jrobbins;	state Exp;
branches;
next	1.3;

1.3
date	2000.02.03.04.21.34;	author jrobbins;	state Exp;
branches;
next	1.2;

1.2
date	2000.02.02.08.25.04;	author jrobbins;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.30.03.22.37;	author jrobbins;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.17.02;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.14
log
@remove obsolete/non-functional scripts
@
text
@# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#


# Helm/ApacheConfig.pm
# ----------------------
# Generate an Apache configuration file based on the Web modules

package Helm::ApacheConfig;

use Helm::Updater;
@@ISA = qw(Helm::Updater);

use strict;

sub user {
    my ($class, $db) = @@_;
    return $db->config('apache_user');
}

# update Helm::CVSUsers $db;
# We just process the list of modules and add them. Trivial, really.
sub update {
    my ($class, $db) = @@_;
    my $htdocs = $db->config('apache_htdocs');
    my $dir = $db->config('apache_configdir');

    open(CONFIG, ">$dir/webmodules.conf")
	or die "Could not open $dir/webmodules.conf: $!\n";

    print CONFIG "# THIS FILE WAS AUTOMATICALLY GENERATED - DO NOT EDIT\n";
    print CONFIG "# output from Helm::ApacheConfig\n\n";

    # Set up the virtual host for name-based vhost-ing
    my $ip = $db->config('apache_hostip');
    my $port = $db->config('apache_hostport');
    print CONFIG "NameVirtualHost $ip:$port\n";

    my $domain = $db->config('domain_dns');

    # Look in the module_website 
    my $sth = $db->dbh->prepare("SELECT project,module,vhost,root "
				. "FROM module_website");
    $sth->execute;

    while (my ($project, $module, $vhost, $root) = $sth->fetchrow_array) {
	print CONFIG "\n# Configuration for Web module $project-$module\n";

	if ($vhost eq 'Y') {
	    if ($root eq '/') {
		print CONFIG <<"EOF";
<VirtualHost $ip:$port>
ServerAdmin webmaster\@@$project.$domain
DocumentRoot $htdocs/$project/$module
ServerName $project.$domain
ErrorLog log/project-$project-error.log
CustomLog log/project-$project-access.log combined

EOF



                print CONFIG <<"EOF";
#
# rewrite rules
#
  <IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteLog log/rewrite_log
  RewriteLogLevel 0

  RewriteRule ^/project/([a-zA-Z0-9_]+)/nonav/(.*)\$      /\$1/www/\$2 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/api/(.*)\$        /\$1/www/api/\$2 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*)/api/(.*)\$   /\$1/www/\$2/api/\$3 [PT]
  RewriteRule ^/nonav(/.*)/\$          \$1/index.html [PT]
  RewriteRule ^/nonav(/.*)\$   \$1 [PT]
  RewriteRule ^(/.*/api/.*)\$          \$1 [PT]
  RewriteRule ^(/bugs)\$               \$1 [PT]
  RewriteRule ^(/(bugs|source|search)/.*)\$               \$1 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)\$                 /servlets/TView?project=\$1&page=index.html [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*/)\$           /servlets/TView?project=\$1&page=\$2/index.html [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.html?)\$    /servlets/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.shtml)\$    /servlets/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*)\$            /servlets/TView?project=\$1&page=\$2/index.html [PT]
  RewriteRule ^(.*/)\$                 /servlets/TView?page=\$1/index.html [PT]
  RewriteRule ^(/.*\\.html?)\$         /servlets/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\\.shtml)\$         /servlets/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\\.[a-zA-Z0-9]+)\$            \$1 [PT]
  RewriteRule ^/([A-Za-z0-9_]+)\$      /servlets/\$1 [PT]

</IfModule>

EOF
                print CONFIG <<"EOF";
</VirtualHost>
EOF
	    } else {
		# TODO.
		die "Oops... non-root vhosts not currently implemented\n";
	    }
	} else {
	    print CONFIG "Alias $root $htdocs/$project/$module/\n"
	}

	# The options should be configurable
	print CONFIG <<"EOF";
<Directory $htdocs/$project/$module>
Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
</Directory>
EOF
    }

    close CONFIG;
}

# Nothing special beyond updating
sub add_project {
}
sub del_project {
}
@


1.13
log
@improved rewrite rules for non-html content, now not served via TView
@
text
@@


1.12
log
@logs --> log
@
text
@d119 1
a119 2
  RewriteRule ^/nonav(/.*\\.html?)\$   \$1 [PT]
  RewriteRule ^/nonav(/.*\\.shtml)\$   \$1 [PT]
a128 1
  RewriteRule ^(/.*\\.js)\$            \$1 [PT]
d131 1
@


1.11
log
@Aligned and combined some of the rewrite rules.
@
text
@d99 2
a100 2
ErrorLog logs/project-$project-error.log
CustomLog logs/project-$project-access.log combined
d112 1
a112 1
  RewriteLog logs/rewrite_log
@


1.10
log
@updated to match latest jserv.properties zone name
@
text
@d115 7
a121 8
  RewriteRule ^/project/([a-zA-Z0-9_]+)/nonav/(.*)\$        /\$1/www/\$2 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/api/(.*)\$          /\$1/www/api/\$2 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*)/api/(.*)\$          /\$1/www/\$2/api/\$3 [PT]
  RewriteRule ^/nonav(/.*)/\$        \$1/index.html [PT]
  RewriteRule ^/nonav(/.*\\.shtml)\$        \$1 [PT]
  RewriteRule ^/nonav(/.*\\.html)\$        \$1 [PT]
  RewriteRule ^/nonav(/.*\\.htm)\$        \$1 [PT]
  RewriteRule ^(/.*/api/.*)\$        \$1 [PT]
d123 4
a126 5
  RewriteRule ^(/bugs/.*)\$            \$1 [PT]
  RewriteRule ^(/source/.*)\$          \$1 [PT]
  RewriteRule ^(/search/.*)\$          \$1 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)\$        /servlets/TView?project=\$1&page=index.html [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*/)\$        /servlets/TView?project=\$1&page=\$2/index.html [PT]
d128 1
a128 3
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.html)\$    /servlets/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.htm)\$    /servlets/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*)\$        /servlets/TView?project=\$1&page=\$2/index.html [PT]
d130 3
a132 4
  RewriteRule ^(/.*\\.js)\$             \$1 [PT]
  RewriteRule ^(/.*\\.shtml)\$           /servlets/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\\.html)\$           /servlets/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\\.htm)\$           /servlets/TView?page=\$1 [QSA,PT]
@


1.9
log
@added explicit support for .htm and .shtml files with nav bars
also, corrected missing double backslashs for dot-extension in rewrite rules.
@
text
@d127 7
a133 7
  RewriteRule ^/project/([a-zA-Z0-9_]+)\$        /helm/TView?project=\$1&page=index.html [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*/)\$        /helm/TView?project=\$1&page=\$2/index.html [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.shtml)\$    /helm/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.html)\$    /helm/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.htm)\$    /helm/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*)\$        /helm/TView?project=\$1&page=\$2/index.html [PT]
  RewriteRule ^(.*/)\$                 /helm/TView?page=\$1/index.html [PT]
d135 4
a138 4
  RewriteRule ^(/.*\\.shtml)\$           /helm/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\\.html)\$           /helm/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\\.htm)\$           /helm/TView?page=\$1 [QSA,PT]
  RewriteRule ^/([A-Za-z0-9_]+)\$      /helm/\$1 [PT]
@


1.8
log
@"perfected" nonav rewrite rules
@
text
@d119 3
a121 1
  RewriteRule ^/nonav(/.*\.html)\$        \$1 [PT]
d129 3
a131 1
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*.html)\$    /helm/TView?project=\$1&page=\$2 [QSA,PT]
d134 4
a137 2
  RewriteRule ^(/.*\.html)\$           /helm/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\.js)\$             \$1 [PT]
d139 1
@


1.7
log
@added rewrite rules so non-vhost links work even if you are using one vhost already
@
text
@d115 1
a115 1
  RewriteRule ^/project/([a-zA-Z0-9_]+)/nonav/(.*)\$        /\$1/www/nonav/\$2 [PT]
a116 1
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*)/nonav/(.*)\$        /\$1/www/\$2/nonav/\$3 [PT]
d118 2
a119 1
  RewriteRule ^(/.*/nonav/.*)\$        \$1 [PT]
@


1.6
log
@extended logging
@
text
@d114 5
d125 4
@


1.5
log
@removed special case for project www home page
tigris.org looks great with the standard nav bar automatically applied
@
text
@d100 1
a100 1
CustomLog logs/project-$project-access.log common
@


1.4
log
@now directories named "api" will not have nav bar
@
text
@a113 10
EOF

                if ($project eq "www") {
                    print CONFIG <<"EOF";
  RewriteRule ^([/]*)\$                 \$1 [PT]
  RewriteRule ^(/index.html)\$          \$1 [PT]
EOF
}

                print CONFIG <<"EOF";
@


1.3
log
@Added tigris.org license
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@d125 1
@


1.2
log
@added code to generate rewriting rules
@
text
@d1 46
a46 1
# Copyright (c) 2000 Collab.Net, Inc.
@


1.1
log
@initial checkin
@
text
@d56 36
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@d1 1
a1 46
# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#

d54 2
a55 39
ErrorLog log/project-$project-error.log
CustomLog log/project-$project-access.log combined

EOF



                print CONFIG <<"EOF";
#
# rewrite rules
#
  <IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteLog log/rewrite_log
  RewriteLogLevel 0

  RewriteRule ^/project/([a-zA-Z0-9_]+)/nonav/(.*)\$      /\$1/www/\$2 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/api/(.*)\$        /\$1/www/api/\$2 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*)/api/(.*)\$   /\$1/www/\$2/api/\$3 [PT]
  RewriteRule ^/nonav(/.*)/\$          \$1/index.html [PT]
  RewriteRule ^/nonav(/.*)\$   \$1 [PT]
  RewriteRule ^(/.*/api/.*)\$          \$1 [PT]
  RewriteRule ^(/bugs)\$               \$1 [PT]
  RewriteRule ^(/(bugs|source|search)/.*)\$               \$1 [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)\$                 /servlets/TView?project=\$1&page=index.html [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*/)\$           /servlets/TView?project=\$1&page=\$2/index.html [PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.html?)\$    /servlets/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*\\.shtml)\$    /servlets/TView?project=\$1&page=\$2 [QSA,PT]
  RewriteRule ^/project/([a-zA-Z0-9_]+)/(.*)\$            /servlets/TView?project=\$1&page=\$2/index.html [PT]
  RewriteRule ^(.*/)\$                 /servlets/TView?page=\$1/index.html [PT]
  RewriteRule ^(/.*\\.html?)\$         /servlets/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\\.shtml)\$         /servlets/TView?page=\$1 [QSA,PT]
  RewriteRule ^(/.*\\.[a-zA-Z0-9]+)\$            \$1 [PT]
  RewriteRule ^/([A-Za-z0-9_]+)\$      /servlets/\$1 [PT]

</IfModule>

EOF
                print CONFIG <<"EOF";
@


