This repository has been archived by the owner on Aug 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apache.20.conf
63 lines (56 loc) · 1.7 KB
/
apache.20.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# @category: Vagrant
# @author: James Dryden <jsd24@kent.ac.uk>
# @license: Copyright KentProjects
# @link: http://kentprojects.com
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<VirtualHost *:80>
ServerName code.kentprojects.com
DocumentRoot /var/www/html
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /api http://localhost:4000
ProxyPassReverse /api http://localhost:4000
Alias /trac /usr/share/trac/htdocs
#You have to allow people to read the files in htdocs
<Directory "/usr/share/trac/htdocs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
WSGIScriptAliasMatch ^/([0-9]{4})/([^/]+) /home/trac/$1/$2/deploy/cgi-bin/trac.wsgi
<Directory /home/trac/*/*/>
WSGIApplicationGroup %{GLOBAL}
Options +Indexes +ExecCGI +SymLinksIfOwnerMatch
AllowOverride None
Require all granted
</Directory>
<Perl>
#!/usr/bin/perl
my $project_base = "/home/trac";
opendir(PROJECTS_ROOT, "$project_base") or die "Unable to open root directory ($project_base)";
while (my $year = readdir(PROJECTS_ROOT))
{
if (("$year" == ".") || ("$year" == ".."))
{
next;
}
opendir(PROJECTS_YEAR, "$project_base/$year") or die "Unable to open year directory ($project_base/$year)";
while (my $repo = readdir(PROJECTS_YEAR))
{
$Location{"/$year/$repo/login"} = {
AuthType => "Basic",
AuthName => "\"$year $repo Trac\"",
AuthUserFile => "/home/trac/$year/$repo/conf/passwd",
Require => "valid-user"
};
}
closedir(PROJECTS_YEAR);
}
closedir(PROJECTS_ROOT);
__END__
</Perl>
</VirtualHost>