ubuntu安装部署SVN+SVNManager
一、SVN 安装配置
1、更新系统:
apt-get update apt-get upgrade -y
apt-get install apache2 subversion libapache2-svn
sudo a2enmod dav_svn
#创建仓库文件夹 mkdir -p /srv/svn/repos #将www-data用户加入subversion组 groupadd subversion gpasswd -a www-data subversion #赋于文件仓库的访问权限 chown -R www-data:subversion /srv/svn/repos chmod -R g+rws /srv/svn/repos #创建密码文件和访问控制文件并赋权(这两个文件由SVNManager维护) touch /srv/svn/passwdfile /srv/svn/accessfile chown www-data:subversion /srv/svn/passwdfile /srv/svn/accessfile a2enmod dav_svn authz_svn
<Location /svn> DAV svn SVNParentPath /srv/svn/repos AuthType Basic AuthName "SVN Repositories" AuthUserFile /srv/svn/passwdfile# <IfModule mod_authz_svn.c> AuthzSVNAccessFile /srv/svn/accessfile# </IfModule> # <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user # </LimitExcept> </Location>
service apache2 restart
apt-get install mysql-server mysql-client
mysql -u root -proot1234mysql> CREATE DATABASE svnmanager;mysql> GRANT all privileges on svnmanager.* to 'svnmanager'@'localhost' identified by 'root1234';mysql> FLUSH PRIVILEGES;mysql> exit
apt-get install php5 php5-mysql php5-sqlite php-pear
pear install VersionControl_SVN-0.3.4
wget http://prdownloads.sourceforge.net/svnmanager/svnmanager-1.09.tar.gz
tar zxvf svnmanager-1.09.tar.gz -C /var/wwwln -s /var/www/svnmanager-1.09 /var/www/svnmanager
mkdir -p /srv/svn/svnconfigchown -R www-data:subversion /srv/svn chmod -R g+rws /srv/svn
cp /var/www/svnmanager/config.php.linux /var/www/svnmanager/config.php vi /var/www/svnmanager/config.php修改config.php如下配置项:$lang = "en_US.utf8";$htpassword_cmd = "/usr/bin/htpasswd";$svn_cmd = "/usr/bin/svn";$svnadmin_cmd = "/usr/bin/svnadmin --config-dir /srv/svn/svnconfig";$svn_config_dir ="/srv/svn/svnconfig";$svn_repos_loc = "/srv/svn/repos";$svn_passwd_file = "/srv/svn/passwdfile";$svn_access_file = "/srv/svn/accessfile";$smtp_server = "smtp.163.com";$dsn = "mysqli://root:root1234@localhost/svnmanager"$admin_name ="admin";$admin_temp_password="admin";
vi /usr/share/php/VersionControl/SVN.php将下行exec("{$this->prepend_cmd}$cmd 2>&1", $out, $ret_var);改为:exec("LANG=zh_CN.UTF-8; {$this->prepend_cmd}$cmd 2>&1", $out, $ret_var);
service apache2 restart