標籤:倉庫 軟體svnmanager
一、環境
CentOS 6.5x64 Apache/2.2.15 php-5.3.3 mysql-5.1.73
除了上面的軟體外,還有幾個包關係到後面的安裝:
php-mysql
php-pear
mod_dav_svn
直接用yum安裝
二、整合SVN和Apache
1.建立倉庫
[[email protected] ~]# mkdir -p /home/svn/repos[[email protected] ~]# svnadmin create /home/svn/repos/test[[email protected] ~]# chown -R apache:apache /home/svn
2.配置apache
在/etc/httpd/conf.d/subversion.conf目錄下查看
LoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so #svn使用,順序也要這樣
<Location /svn> DAV svn SVNParentPath /home/svn/repos SVNListParentPath on #這個是多版本特有的 ## # Limit write permission to list of valid users.# <LimitExcept GET PROPFIND OPTIONS REPORT># # Require SSL connection for password protection.# # SSLRequireSSL# AuthType Basic AuthName "subversion repository" AuthUserFile /home/svn/repos/passwdfile AuthzSVNAccessFile /home/svn/repos/accessfile Require valid-user# </LimitExcept></Location>
3.建立密碼檔案及訪問檔案
cd /home/svn/repos
touch passwdfile accessfile
chown apache:apache accessfile passwdfile
三、安裝和配置svnmanager
1.下載svnmanager
http://nchc.dl.sourceforge.net/sourceforge/svnmanager/svnmanager-1.03.tgz
解壓並放置到/var/www/html/下
[[email protected] ~]# tar xf svnmanager-1.03.tgz -C /var/www/html/
[[email protected] html]# ln -sv svnmanager-1.03/ svnmanager
2.安裝VersionControl_SVN
還記得我們最開始提到的php-pear包,安裝這個包後會有/usr/bin/pear命令,我們使用它來安裝VersionControl_SVN,最新的版本為0.3.1,輸入下面的命令:
#pear install --alldeps VersionControl_SVN-0.3.1
3.向http.conf檔案添加新內容
#vim /etc/httpd/conf/httpd.conf 添加如下內容是為了更安全:
<Directory "/var/www/html/svnmanager/"> AllowOverride None Order deny,allow Deny from all Allow from all</Directory>
4.建立svnmanager使用的mysql資料庫
mysql> create database svn;mysql> grant all privileges on svn.* to ‘svnmanager‘@‘localhost‘ identified by "123456";mysql> flush privileges;mysql> quit
5.更改svnmanager的設定檔
[[email protected] ~]# cd /var/www/html/svnmanager
[[email protected] svnmanager]# cp config.php.linux config.php
[[email protected] svnmanager]# vim config.php
<?php//// SVNManager config.php file for Linux based servers////Shell command‘s$htpassword_cmd = "/usr/bin/htpasswd";$svn_cmd = "/usr/bin/svn";$svnadmin_cmd = "/usr/bin/svnadmin";//Subversion locations$svn_repos_loc = "/home/svn/repos";$svn_passwd_file = "/home/svn/repos/passwdfile";$svn_access_file = "/home/svn/repos/accessfile";//If the following is set, removing a repository will cause it to be//moved to this location rather than being deleted.$svn_trash_loc = "";// If $svnserve_user_file is defined, then SVNManager will create a// user/password file suitable for use with SVNSERVE//// When not set, this feature isn‘t enabled.//// Warning: When enabled, this mode requires that passwords are stored in the database readable!// // Note: When is feature is enabled later, passwords need to be re-set before they are included in// the svnserve user file.////$svnserve_user_file = "/var/www/repos/svnserve_passwd_file"; $svnserve_user_file="";//SMTP Server for outgoing mail$smtp_server = "smtp.mailserver.net";//Data Source Name (only tested with mysql and sqlite!!)//// Use the createtables.sql script to build the tables in a mysql database//// An empty SQLite database will automatically be generated with the first// startup!////Please note that if you change the directory for a SQLite database that you//choose a location that is not accessible via web!!//$dsn = "mysqli://svnmanager:[email protected]/svn";//The following location is not readable from internet by means of an .htaccess file//$dsn = "sqlite://svnmanager/svnmanager.db"; //Administrator account$admin_name = "admin";$admin_temp_password = "admin";// If $post_create_script is defined, then this script / command will be// executed after a repository is created. // When the script/command is executed the one and only parameter will be// the physical location of the repository.// This might copy a default set of hooks or config files//// $post_create_script = "newrepo-script";?>
6.驗證
重啟apache,然後從瀏覽器裡輸入http://IP/svnmanager,
會自動建svn的資料表,在重新整理後輸入使用者名稱為admin,密碼為admin.
記得進入用建立一個管理員帳號,因為admin一次後失效。
四、漢化
漢化包我也沒有找到。這是已經漢化的版本
1.更改/etc/php.ini檔案,設定default_charset=‘gb2312‘ 或 default_charset=‘gbk‘
2.更改/etc/httpd/conf/httpd.conf檔案,設定AddDefaultCharset GB2312 或AddDefaultCharset GB2312
重啟apache之後就可以看到中文頁面了
本文出自 “營運學習之路” 部落格,請務必保留此出處http://cg831344.blog.51cto.com/6868324/1574071
CentOS 6.5x64 svnmanager 1.03安裝配置