52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
<font color="#a52a2a">15 </font> chown root:root <font color="#a020f0">$DESTINATION</font><br>
<font color="#a52a2a">16 </font> <font color="#a52a2a"><b>chmod</b></font> <font color="#ff00ff">755</font> <font color="#a020f0">$DESTINATION</font><br>
<font color="#a52a2a">17 </font> <font color="#a52a2a"><b>done</b></font><br>
<font color="#a52a2a">18 </font><font color="#a52a2a"><b>else</b></font><br>
<font color="#a52a2a">19 </font> sudo <font color="#a020f0">$0</font> <font color="#a020f0">$*</font><br>
<font color="#a52a2a">20 </font><font color="#a52a2a"><b>fi</b></font><br>
</font></nowiki>
The following <cite>apache2</cite> configuration can be used to run the root of a URL with fossil, but still allow other services / documents to be reached via specific URLs. Replace "code.autonomo.us" with your site's name and "dclark@pobox.com" with your email.
<verbatim>
NameVirtualHost *:80
<VirtualHost *:80>
ServerName code.autonomo.us
ServerAdmin dclark@pobox.com
ErrorLog /var/log/apache2/code.autonomo.us-error.log
LogLevel warn
CustomLog /var/log/apache2/code.autonomo.us-access.log combined
ServerSignature On
DocumentRoot /var/www/
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
# Fossil SCM at root of web site (http://example.com) configuration...
RewriteEngine On
# RewriteCond - One for every URL we don't want Fossil SCM to serve. In the
# example, requests that go to the /var/www/tmp directory and
# the /usr/lib/cgi-bin directoty are ignored by Fossil SCM.
RewriteCond %{REQUEST_URI} !^/tmp/.*$
RewriteCond %{REQUEST_URI} !^/cgi-bin/.*$
RewriteRule ^(.*)$ /usr/lib/cgi-bin/code.autonomo.us/$1 [T=application/x-httpd-cgi]
</VirtualHost>
</verbatim>
/usr/lib/cgi-bin/code.autonomo.us is just a standard fossil CGI file; it looks like this:
<verbatim>
#!/usr/bin/fossil
repository: /srv/fossil-scm/code.autonomo.us.fossil-scm
</verbatim>
<h4>Windows</h4>
<p>While it is far from a perfect set of instructions.. here are some quick notes that should help windows users along the way...</p>
<ul>
<li>you need fossil.exe accessible by your web server or on your path.. easiest is to just chuck it in \%SYSTEM_ROOT%\ (usually c:\windows\) </li>
<li>assuming you are running apache, you need to either add the ExecCGI to the options on your DocumentRoot, or make sure the ScriptAlias directive is set and put your .cgi files in that folder..</li>
<li>the contents of your cgi file needs to essentially the same as above.. however paths needs to be windows friendly.. i have made sure that all folders on my test box are free of spaces, and as such this file works for me (obviously your paths may differ)
|