首页 > 代码库 > CentOS 6.5x64 svnmanager 1.03安装配置
CentOS 6.5x64 svnmanager 1.03安装配置
一、环境
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.创建仓库
[root@CentOSx64 ~]# mkdir -p /home/svn/repos [root@CentOSx64 ~]# svnadmin create /home/svn/repos/test [root@CentOSx64 ~]# chown -R apache:apache /home/svn
2.配置apache
在/etc/httpd/conf.d/subversion.conf目录下查看
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule 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/下
[root@CentOSx64 ~]# tar xf svnmanager-1.03.tgz -C /var/www/html/
[root@CentOSx64 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的配置文件
[root@CentOSx64 ~]# cd /var/www/html/svnmanager
[root@CentOSx64 svnmanager]# cp config.php.linux config.php
[root@CentOSx64 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:123456@localhost/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安装配置