1 | 1 | simandl | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
2 | | | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
3 | | | <head> |
4 | | | <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
5 | | | <meta http-equiv="content-script-type" content="text/javascript" /> |
6 | | | <meta http-equiv="content-style-type" content="text/css" /> |
7 | | | <title>WebSVN Installation Guide</title> |
8 | | | <link rel="stylesheet" type="text/css" href="style.css" /> |
9 | | | </head> |
10 | | | |
11 | | | <body> |
12 | | | |
13 | | | <h1>WebSVN Installation Guide</h1> |
14 | | | |
15 | | | <div class="misc"> |
16 | | | <h2><a name="content"></a>Content</h2> |
17 | | | <ul> |
18 | | | <li><a href="#why">Why WebSVN?</a></li> |
19 | | | <li><a href="#installation">Installation</a></li> |
20 | | | <li><a href="#accentedchars">Accented characters</a></li> |
21 | | | <li><a href="#colourisation">Colourisation</a></li> |
22 | | | <li><a href="#multiviews">Mulitviews</a></li> |
23 | | | <li><a href="#multiviewsexample">Mulitviews example</a></li> |
24 | | | <li><a href="#authentication">Access rights and authentication</a></li> |
25 | | | <li><a href="#problems">Common problems</a></li> |
26 | | | <li><a href="#license">License</a></li> |
27 | | | </ul> |
28 | | | </div> |
29 | | | |
30 | | | <div class="content"> |
31 | | | <h2><a name="why"></a>Why WebSVN?</h2> |
32 | | | |
33 | | | <p>WebSVN offers a view onto your subversion repositories that's been designed |
34 | | | to reflect the Subversion methodology. You can view the log of any file or |
35 | | | directory and see a list of all the files changed, added or deleted in any |
36 | | | given revision. You can also view the differences between 2 versions of a |
37 | | | file so as to see exactly what was changed in a particular revision.</p> |
38 | | | |
39 | | | <p>WebSVN offers the following features:</p> |
40 | | | |
41 | | | <ul> |
42 | | | <li>Easy to use interface</li> |
43 | | | <li>Highly customisable templating system</li> |
44 | | | <li>Colourisation of file listings</li> |
45 | | | <li>Blame view</li> |
46 | | | <li>Log message searching</li> |
47 | | | <li>Apache MultiViews support</li> |
48 | | | <li>RSS feed support</li> |
49 | | | <li>Support for bugtraq: properties</li> |
50 | | | </ul> |
51 | | | |
52 | | | <p>Since it's written using PHP, WebSVN is also very portable and easy to install.</p> |
53 | | | |
54 | | | <h2><a name="installation"></a>Installation</h2> |
55 | | | |
56 | | | <p>Grab the source and stick it somewhere that your server can get to. You |
57 | | | obviously need to have <strong>PHP 4.3.0</strong> or greater installed and working. Also note that WebSVN |
58 | | | won't currently work in safe mode, due to the need to call svnlook.</p> |
59 | | | |
60 | | | <p>If it isn't already, make sure to chmod the cache directory to 0777. This is |
61 | | | used to cache RSS files.</p> |
62 | | | |
63 | | | <p>You'll also need diff (preferably the GNU version; for Windows users I'd |
64 | | | recommend the Cygwin version) and svnlook available.</p> |
65 | | | |
66 | | | <p>Rename distconfig.php as config.php (found in the includes directory) and then |
67 | | | edit it as directed in the file itself.</p> |
68 | | | |
69 | | | <p>If everything has gone well, you should be able to view your projects by |
70 | | | pointing your browser at the index.php file.</p> |
71 | | | |
72 | | | <p>For those of you wishing to customise the look and feel a little, you should |
73 | | | read templates.txt, which explains the highly configurable template system.</p> |
74 | | | |
75 | | | <p><b>Windows users:</b> Note that some of the features offered by WebSVN, when |
76 | | | enabled, require the use of various external programs. They can be downloaded |
77 | | | from these locations:</p> |
78 | | | |
79 | | | <p>Diff/Sed/Gzip/Tar: <a href="http://www.cygwin.com/">http://www.cygwin.com/</a><br /> |
80 | | | Enscript: <a href="http://people.ssh.com/mtr/genscript/">http://people.ssh.com/mtr/genscript/</a></p> |
81 | | | |
82 | | | <h2><a name="accentedchars"></a>Accented characters</h2> |
83 | | | |
84 | | | <p>WebSVN is designed to worked with accented characters. To do this, it uses |
85 | | | the iconv function. This may not be installed on your system. If you aren't |
86 | | | getting the characters that you expect, make sure that the iconv module is |
87 | | | being loaded in php.ini. Windows users will need to copy the appropriate |
88 | | | DLLs to the system directory (from the PHP installation directory).</p> |
89 | | | |
90 | | | <h2><a name="colourisation"></a>Colourisation</h2> |
91 | | | |
92 | | | <p>Per default WebSVN uses the Generic Syntax Highlighter GeSHi which is bundle with WebSVN.</p> |
93 | | | |
94 | | | <p>Alternatively, if you have Enscript 1.6 or higher installed on your system, |
95 | | | you can use that to view files with syntax colouring. You'll also need Sed.</p> |
96 | | | |
97 | | | <p>Simply set the paths in the config file and then uncomment the line:</p> |
98 | | | |
99 | | | <pre class="code"> |
100 | | | $config->useEnscript(); |
101 | | | </pre> |
102 | | | |
103 | | | <p>and comment the line:</p> |
104 | | | |
105 | | | <p>Alternatively you can use GeSHi which is bundle with WebSVN.</p> |
106 | | | |
107 | | | <p>Simply uncomment the line:</p> |
108 | | | |
109 | | | <pre class="code"> |
110 | | | $config->useGeshi(); |
111 | | | </pre> |
112 | | | |
113 | | | |
114 | | | <h2><a name="multiviews"></a>Multiviews</h2> |
115 | | | |
116 | | | <p>You may choose to configure access to your repository via Apache's MultiView |
117 | | | system. This will enable you to access a respositoy using a url such as:</p> |
118 | | | |
119 | | | <p>http://servername/wsvn/repname/path/in/repository</p> |
120 | | | |
121 | | | <p>To do this you must:</p> |
122 | | | |
123 | | | <ul> |
124 | | | <li>Place wsvn.php where you want to. Normally you place it such that it's accessible straight after the servername, as shown above.</li> |
125 | | | <li>Configure the parent directory of wsvn.php to use MultiViews (see Apache docs).</li> |
126 | | | <li>Change config.php to include the line $config->useMultiViews();</li> |
127 | | | <li>Change the path configured at the beginning of the wsvn.php script.</li> |
128 | | | </ul> |
129 | | | |
130 | | | <p>Now go to http://servername/wsvn/ and make sure that you get the index page.</p> |
131 | | | |
132 | | | <p>The repname part of the URL is the name given to it in the config.php file. |
133 | | | For this reason you may wish to avoid putting spaces in the name.</p> |
134 | | | |
135 | | | |
136 | | | <h2><a name="multiviewsexample"></a>Multiviews example</h2> |
137 | | | |
138 | | | <p>First, you must get the Multiviews option working. In my set up, my Apache |
139 | | | directory root is set to a location on my harddrive:</p> |
140 | | | |
141 | | | <pre class="code"> |
142 | | | DocumentRoot "D:/svnpage" |
143 | | | </pre> |
144 | | | |
145 | | | <p>In that directory, I have WebSVN installed in a directory called websvn. |
146 | | | Normally WebSVN would be accessed by http://servername/websvn</p> |
147 | | | |
148 | | | <p>wsvn.php is then copied from the WebSVN installation to the document root |
149 | | | directory and the variable at the beginning of the script configured as |
150 | | | follows (based on your own directory location, obviously):</p> |
151 | | | |
152 | | | <pre class="code"> |
153 | | | // Location of websvn directory via HTTP |
154 | | | // |
155 | | | // e.g. For http://servername/websvn use /websvn |
156 | | | // |
157 | | | // Note that wsvn.php need not be in the /websvn directory (and normally isn't). |
158 | | | $locwebsvnhttp = "/websvn"; |
159 | | | </pre> |
160 | | | |
161 | | | <p>Next, turn on Multiviews in the WebSVN config.php file:</p> |
162 | | | |
163 | | | <pre class="code"> |
164 | | | $config->useMultiViews(); |
165 | | | </pre> |
166 | | | |
167 | | | <p>Finally, Apache needs to know that you want to enable MultiViews for the root |
168 | | | directory. This can be done by including this line in the directory's |
169 | | | .htaccess file (assuming that the appropriate AllowOverrides directive is set |
170 | | | up):</p> |
171 | | | |
172 | | | <pre class="code"> |
173 | | | Options MultiViews |
174 | | | </pre> |
175 | | | |
176 | | | <p>If all has gone well, repositories should now by accessible by |
177 | | | <code>http://servername/wsvn/repname</code></p> |
178 | | | |
179 | | | <p>Note the index page can be accessed through http://servername/wsvn |
180 | | | If you want to view the index page by <code>http://servername/</code> you need to |
181 | | | add another directive to the .htaccess file:</p> |
182 | | | |
183 | | | <pre class="code"> |
184 | | | DirectoryIndex wsvn.php |
185 | | | </pre> |
186 | | | |
187 | | | |
188 | | | <h2><a name="authentication"></a>Access rights and authentication</h2> |
189 | | | |
190 | | | <p>You may wish to provide an authentication mechanism for WebSVN. One obvious |
191 | | | solution is to protect the entire WebSVN directory with some form of Apache |
192 | | | authentication mechanism, but that doesn't allow for per repository |
193 | | | authentication.</p> |
194 | | | |
195 | | | <p>WebSVN provides and access rights mechanism that uses your SVN access file to |
196 | | | control read access to the repository. This means that you only have to |
197 | | | maintain one file to define both Subversion and WebSVN access rights.</p> |
198 | | | |
199 | | | <p>For this to work, you need to configure your authentication method to the /WebSVN/ |
200 | | | (or /wsvn/) directory. This should be the same authentication as you use for |
201 | | | the svn repositories themselves. Here's an example using SSPI:</p> |
202 | | | |
203 | | | <pre class="code"> |
204 | | | <Location /WebSVN/> |
205 | | | AuthType SSPI |
206 | | | SSPIAuth On |
207 | | | SSPIAuthoritative On |
208 | | | SSPIDomain IMAJEMAIL |
209 | | | SSPIOfferBasic On |
210 | | | Require valid-user |
211 | | | </Location> |
212 | | | </pre> |
213 | | | |
214 | | | <p>Note the use of the / after <code>/WebSVN/</code> in the location directive. If you use |
215 | | | <Location /WebSVN> then you won't be able to access the index.</p> |
216 | | | |
217 | | | <p>You should change <code>/WebSVN/</code> to <code>/wsvn/</code> if you're using multiviews.</p> |
218 | | | |
219 | | | <p>Also note that you shouldn't use the AuthzSVNAccessFile command to define the |
220 | | | access file.</p> |
221 | | | |
222 | | | <p>Now that you've defined your authentication, you'll be asked for your user name |
223 | | | and password in order to access the WebSVN directory. All that's left is to |
224 | | | configure WebSVN to use your Subversion access file to control access. Add this |
225 | | | line to your config.php file:</p> |
226 | | | |
227 | | | <pre class="code"> |
228 | | | $config->useAuthenticationFile("/path/to/accessfile"); |
229 | | | </pre> |
230 | | | |
231 | | | <p>Note that if your access file gives read access to, for example, path <code>/a/b/c/</code> but |
232 | | | not to <code>/a/b/</code>, then the user will be given restricted access to <code>/a/b/</code> in order to |
233 | | | reach <code>/a/b/c/</code>. The user will not be able to see any other files or directories in |
234 | | | <code>/a</code> or <code>/a/b/</code>.</p> |
235 | | | |
236 | | | <p>You should read the <a href="http://svnbook.red-bean.com/">Subversion book</a> for information on the access file format.</p> |
237 | | | |
238 | | | |
239 | | | <h2><a name="problems"></a>Common problems</h2> |
240 | | | |
241 | | | <ol> |
242 | | | <li> |
243 | | | On a Windows machine, this error is reported:<br /> |
244 | | | Warning: shell_exec(): Unable to execute<br /> |
245 | | | If you experience this problem, you need to give IUSR_<machinename> execute |
246 | | | permissions on %systemroot%\system32\cmd.exe. Under most systems, the file will |
247 | | | be C:\WINDOWS\system32\cmd.exe.<br /> |
248 | | | |
249 | | | Right-click on the file, choose properties, and on the security tab click |
250 | | | the "Add" button. Add the IUSR_<machinename> user, and then select the |
251 | | | "read" and "read & execute" boxes. |
252 | | | </li> |
253 | | | </ol> |
254 | | | |
255 | | | |
256 | | | <h2><a name="license"></a>License</h2> |
257 | | | |
258 | | | <p><a href="http://www.fsf.org/licensing/licenses/gpl.html">GNU Public licence</a>.</p> |
259 | | | |
260 | | | </div> |
261 | | | |
262 | | | </body> |
263 | | | </html> |