52 52 <font color="#a52a2a">15 </font> chown root:root <font color="#a020f0">$DESTINATION</font><br>
53 53 <font color="#a52a2a">16 </font> <font color="#a52a2a"><b>chmod</b></font> <font color="#ff00ff">755</font> <font color="#a020f0">$DESTINATION</font><br>
54 54 <font color="#a52a2a">17 </font> <font color="#a52a2a"><b>done</b></font><br>
55 55 <font color="#a52a2a">18 </font><font color="#a52a2a"><b>else</b></font><br>
56 56 <font color="#a52a2a">19 </font> sudo <font color="#a020f0">$0</font> <font color="#a020f0">$*</font><br>
57 57 <font color="#a52a2a">20 </font><font color="#a52a2a"><b>fi</b></font><br>
58 58 </font></nowiki>
59 +
60 +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.
61 +
62 +<verbatim>
63 +NameVirtualHost *:80
64 +<VirtualHost *:80>
65 + ServerName code.autonomo.us
66 + ServerAdmin dclark@pobox.com
67 + ErrorLog /var/log/apache2/code.autonomo.us-error.log
68 + LogLevel warn
69 + CustomLog /var/log/apache2/code.autonomo.us-access.log combined
70 + ServerSignature On
71 +
72 + DocumentRoot /var/www/
73 +
74 + ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
75 + <Directory "/usr/lib/cgi-bin">
76 + AllowOverride None
77 + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
78 + Order allow,deny
79 + Allow from all
80 + </Directory>
81 +
82 + # Fossil SCM at root of web site (http://example.com) configuration...
83 + RewriteEngine On
84 + # RewriteCond - One for every URL we don't want Fossil SCM to serve. In the
85 + # example, requests that go to the /var/www/tmp directory and
86 + # the /usr/lib/cgi-bin directoty are ignored by Fossil SCM.
87 + RewriteCond %{REQUEST_URI} !^/tmp/.*$
88 + RewriteCond %{REQUEST_URI} !^/cgi-bin/.*$
89 + RewriteRule ^(.*)$ /usr/lib/cgi-bin/code.autonomo.us/$1 [T=application/x-httpd-cgi]
90 +</VirtualHost>
91 +</verbatim>
92 +
93 +/usr/lib/cgi-bin/code.autonomo.us is just a standard fossil CGI file; it looks like this:
94 +
95 +<verbatim>
96 +#!/usr/bin/fossil
97 +repository: /srv/fossil-scm/code.autonomo.us.fossil-scm
98 +</verbatim>
59 99
60 100 <h4>Windows</h4>
61 101 <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>
62 102 <ul>
63 103 <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>
64 104 <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>
65 105 <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)