linux Android php google nginx 开源 微软 Firefox linux命令 centos Windows Python shell java mysql wordpress Ubuntu apache 程序员 HTML5

ubuntu linux[server/64]安装svn及svnmanager

一、 lamp安装

sudo apt-get install apache2 php5 libapache2-mod-php5
sudo apt-get install mysql-server mysql-client php5-mysql

二、 SVN安装及配置

1、安装相关软件

sudo apt-get install subversion
sudo apt-get install libapache2-svn
sudo apt-get install PHP-pear
sudo pear install -a VersionControl_SVN-0.3.1

2、配置

创建SVN版本库的父目录

mkdir ~/svn
sudo chown -R www-data:www-data ~/svn
svnserve -d -r ~/svn

创建控制用户访问权限、验证用户密码的文件

cd /etc/apache2
sudo touch dav_svn.authz
sudo touch dav_svn.passwd

更改文件的读写权限

sudo chmod 666 dav_svn.authz dav_svn.passwd

Apache集成SVN配置

cd /etc/apache2/mods-available/
sudo vim dav_svn.conf

此文件内有注释,去掉相关行前面注释并配置大概如下内容:

<Location /svn>
DAV svn
#版本库父路径
SVNParentPath /home/yyp/svn
AuthType Basic
AuthName "Subversion Repository"
# SVN用户密码验证文件
AuthUserFile /etc/apache2/dav_svn.passwd
# SVN用户权限文件
AuthzSVNAccessFile /etc/apache2/dav_svn.authz
Require valid-user
</Location>
sudo vim dav_svn.load

检查该文件内是否有如下内容[默认已经有如下内容,若没有将其加上]:

# Depends: dav
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so

三、 Svnmanager安装配置

1、创建svnmanager库并配置用户及权限

mysql -uroot -p
>create database svnmanager;
>grant all privileges on svnmanager.* to 'svnmanager'@'localhost' identified by 'yoyosys';
>flush privileges;
>exit

2、下载Svnmanager并解压至相关位置

cd ~
wget http://prdownloads.sourceforge.net/svnmanager/svnmanager-1.09.tar.gz
tar -zxvf svnmanager-1.09.tar.gz
sudo mv svnmanager-1.09 /var/www/svnmanager

3、配置Svnmanager

cd /var/www/svnmanager
sudo cp config.php.Linux config.php
sudo vim config.php
<?php
$lang = "en_US.UTF-8";

//Shell command's
$htpassword_cmd = "/usr/bin/htpasswd";
$svn_cmd = "/usr/bin/svn";
$svnadmin_cmd = "/usr/bin/svnadmin";

//Subversion locations
$svn_config_dir = "/var/www/svnconfig";
$svn_repos_loc = "/home/yyp/svn/";
$svn_passwd_file = "/etc/apache2/dav_svn.passwd";
$svn_access_file = "/etc/apache2/dav_svn.authz";

$svn_trash_loc = "";

$svnserve_user_file ="";

$smtp_server = "smtp.mailserver.net";

//$svnserve_user_file = "/var/www/repos/svnserve_passwd_file"; 
$svnserve_user_file="";

$smtp_server = "smtp.mailserver.net";

$dsn ="mysqli://svnmanager:yoyosys@localhost/svnmanager";
$admin_name = "admin";
$admin_temp_password = "admin";
?>

4、增加svnmanager的访问的apache配置

sudo vim /etc/apache2/sites-enabled/000-default
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/svnmanager
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/svnmanager/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>

5、重启apache、mysql,访问svnmanager

sudo /etc/init.d/apache2 restart
sudo /etc/init.d/mysql restart

浏览器中输入:http://ip/即可访问,初始用户名密码均为admin,新建一个管理员用户,默认admin用户将被删除

四、 Svnmanager使用【可实现用户、组及仓库项目的管理-略】

延伸阅读

评论