WebSVN 以 PHP 撰寫,提供 Subversion (SVN) 倉庫的瀏覽、版本比對、日誌查詢、RSS 訂閱等 Web 介面。本文在 CentOS 7.0 示範從下載、解壓、PHP 安裝、配置 config.php 到啟動 Apache 的完整流程。
yum install subversion)。sudo -s
cd /var/www/html
wget https://websvn.tigris.org/files/documents/1380/49057/websvn-2.3.3.zip

unzip websvn-2.3.3.zip
mv websvn-2.3.3 websvn

yum install php

config.phpcd /var/www/html/websvn/include
cp distconfig.php config.php
nano config.php
關鍵修改(依實際路徑調整):
$config->setSVNCommandPath('/usr/bin');
$config->setDiffPath('/usr/bin');
$config->setEnscriptPath('/usr/bin');
$config->setSedPath('/bin');
$config->setTarPath('/bin');
$config->setGZipPath('/bin');
$config->parentPath('/svn/'); # SVN 倉庫根目錄
# 語法高亮副檔名對應
$extEnscript[".pl"] = "perl";
$extEnscript[".py"] = "python";
$extEnscript[".sql"] = "sql";
$extEnscript[".java"] = "java";
$extEnscript[".html"] = "html";
$extEnscript[".xml"] = "html";
$extEnscript[".sh"] = "bash";

systemctl restart httpd.service
瀏覽器開啟 https://<伺服器IP>/websvn 或 https://localhost/websvn,即可看到倉庫列表。

錯誤:
Unable to find "enscript" tool at location "/usr/bin/enscript"解決:
yum install enscript後重整頁面。
本教學同樣適用於 RHEL 7、Scientific Linux 7 等相容發行版。
WebSVN 輕量、無資料庫相依、模板可客製,是中小團隊快速上線 SVN 瀏覽介面的最佳選擇。配合 Apache 基礎認證或 LDAP 整合,即可構建安全的版本控管入口。