svn+svnmanager build under Ubuntu14.04

apt-get update
apt-get -y upgrade
apt-get install apache2 subversion apache2-utils libapache2-svn -y
apt-get install mysql-server mysql-client
apt-get install php5 php5-mysql php5-sqlite php-pear
pear install VersionControl_SVN-0.3.4

Create a repository main folder
mkdir -p /svn/repos
Create a repository configuration folder
mkdir -p /svn/svnconfig

Add subversion group
groupadd subversion
Add www-data user to subversion group
gpasswd -a www-data subversion

create Password file and access control file
touch /svn/passwdfile /svn/accessfile

grant access to the file repository
chown -R www-data:subversion /svn
chmod -R g+rwx /svn

download svnmanager

wget http://prdownloads.sourceforge.net/svnmanager/svnmanager-1.09.tar.gz
tar -xvf svnmanager-1.09.tar.gz
mv svnmanager-1.09 /var/www/

配置apache支持svn

vim /etc/apache2/mods-available/dav_svn.conf 
#写入如下内容 
<Location /svn>   
    DAV svn                                                           
    SVNParentPath /svn/repos   
    AuthType Basic                                                     
    AuthName "SVN Repositories"                                        
    AuthUserFile /svn/passwdfile   
    AuthzSVNAccessFile /svn/accessfile          
    Require valid-user       
</Location>

配置mysql

#Create svnmanager database and add svnmanager user and password 123456 
mysql -u root -p   
mysql> CREATE DATABASE svnmanager;   
mysql> GRANT all privileges on svnmanager.* to 'svnmanager'@'localhost' identified by '123456';   
mysql> FLUSH PRIVILEGES ;   
mysql> exit  

configure svnmanager

cp /var/www/svnmanager/config.php.linux /var/www/svnmanager/config.php   
vim /var/www/svnmanager/config.php     #Modify
config.php as follows:   
$ lang = "en_US.utf8";   
$htpassword_cmd = "/usr/bin/htpasswd";   
$svn_cmd = "/usr/bin/svn";   
$svnadmin_cmd = "/usr/bin/svnadmin --config-dir /svn/ svnconfig";   
   
$svn_config_dir = "/svn/svnconfig";       
$svn_repos_loc   =      "/svn/repos";   
$svn_passwd_file =      "/svn/passwdfile";   
$svn_access_file =      "/svn/accessfile";   
   
$smtp_server = "smtp.163.com";   
$dsn  = "mysqli://svnmanager:123456@localhost/svnmanager"   
 
$admin_name  =  "admin";   
$admin_temp_password    =   "admin";
 

vim /etc/apache2/mods-available/dav_svn.load  添加
#LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
        #LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so
        LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
        LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so #Make the SVNManager web page support Chinese path 



 
configure Chinese path support
 

vim /usr/share/php/VersionControl/SVN.php    #Change
the line   
exec("{$this->prepend_cmd}$cmd 2>&1", $out, $ret_var); #to   
:   
exec("LANG=zh_CN .UTF-8; {$this->prepend_cmd}$cmd 2>&1", $out, $ret_var);


Configure svnmanager to access


vim /etc/apache2/sites-available/000-default.conf 
#Set svnmanager root directory 
DocumentRoot /var/www/

Restart apache

to log in with the user name admin and password admin;
when you first access, you will be prompted that there is no database, and then automatically create a table for you, and you can access the initial interface normally after accessing it again.

Note that this is a temporary account only Log in once, so the first thing after successful login is to add an administrator account; if you forget to create it, then you need to clear the database and re-visit the url to

add the svn user

  htpasswd /svn/passwdfile lz

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326351972&siteId=291194637