安装svnmanager 时需要注意的问题

来源:互联网 发布:淘宝运营推广工具 编辑:程序博客网 时间:2024/05/01 20:54

我的操作系统是RHEL 5.3 或者说centos。原因是因为我安装的光盘是RHEL 5.1 但是因为没有升级用户和密码,虽有卸载原装的yum,安装拉yum-3.2.19-18.el5.centos,及其相关的rpm包。

比如:yum-downloadonly-1.1.16-13.el5.centos

         yum-metadata-parser-1.1.2-2.el5

         yum-updatesd-0.9-2.el5

         yum-fastestmirror-1.1.16-13.el5.centos

         yum-security-1.1.16-13.el5.centos

要保证更新,请在/etc/yum.repos.d 下配置:CentOS-Base.repo 文件。内容如下:

[base]

name=CentOS-5.3 - Base

baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://ftp.daum.net/centos/5/os/$basearch/

http://mirror.secuidc.com/centos/5/os/$basearch/

http://centos.ermly.com/centos/5/os/$basearch/

http://ftp.hostrino.com/pub/centos/5/os/$basearch/

gpgcheck=1

gpgkey=http://centos.ermly.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

#released updates

[updates]

name=CentOS-5.1 - Updates

baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/

#baseurl=http://mirror.tini4u.net/centos/5/os/$basearch/

http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://ftp.daum.net/centos/5/os/$basearch/

http://mirror.secuidc.com/centos/5/os/$basearch/

http://centos.ermly.com/centos/5/updates/$basearch/

http://ftp.hostrino.com/pub/centos/5/os/$basearch/

gpgcheck=1

gpgkey=http://centos.ermly.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released

[addons]

name=CentOS-5.3 - Addons

baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://ftp.daum.net/centos/5/os/$basearch/

http://mirror.secuidc.com/centos/5/os/$basearch/

http://centos.ermly.com/centos/5/addons/$basearch/

http://ftp.hostrino.com/pub/centos/5/os/$basearch/

gpgcheck=1

gpgkey=http://centos.ermly.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful

[extras]

name=CentOS-5.3 - Extras

baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://ftp.daum.net/centos/5.1/os/$basearch/

http://mirror.secuidc.com/centos/5/os/$basearch/

http://centos.ermly.com/centos/5/extras/$basearch/

http://ftp.hostrino.com/pub/centos/5/os/$basearch/

gpgcheck=1

gpgkey=http://centos.ermly.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-5.3 - Plus

baseurl=http://mirror.tini4u.net/centos/5/os/$basearch/

http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://ftp.daum.net/centos/5/os/$basearch/

http://mirror.secuidc.com/centos/5/os/$basearch/

http://centos.ermly.com/centos/5/centosplus/$basearch/

http://ftp.hostrino.com/pub/centos/5/os/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://centos.ermly.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users

[contrib]

name=CentOS-5.3 - Contrib

baseurl=http://mirror.tini4u.net/centos/5/os/$basearch/

http://centos.ustc.edu.cn/centos/5/os/$basearch/

http://ftp.daum.net/centos/5/os/$basearch/

http://mirror.secuidc.com/centos/5/os/$basearch/

http://centos.ermly.com/centos/5/contrib/$basearch/

http://ftp.hostrino.com/pub/centos/5/os/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://centos.ermly.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

如果你有更快的centos 的升级镜像服务器,也可以进来。

第一次启动yum,需要导入RPM-GPG-KEY-CentOS-5。

rpm --import RPM-GPG-KEY-CentOS-5

RPM-GPG-KEY-CentOS-5 的来源,请从http://centos.ermly.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5 下载。

同时安装:rpmforge-release-0.3.6-1.el5.rf 用来安装其他的开源包,一些非redhat 提供的包,可以通过安装rpmforge-release找到。

我安装的 svnmanager 为1.06。安装svnmanager 需要安装php。我安装的php版本是操作系统自带的。

php-5.1.6-23.el5

php-mysql-5.1.6-23.el5

php-pear-1.4.9-4.el5.1

mysql 为:

mysql-5.0.45-7.el5

mysql-connector-odbc-3.51.12-2.2

mysql-devel-5.0.45-7.el5

mysql-server-5.0.45-7.el5

perl-DBD-mysql-4.012-1.el5.rf

mysql-bench-5.0.45-7.el5

mod_auth_mysql-3.0.0-3.1

安装完mysql 后,需要到/etc下设置my.cnf

我设置的my.cnf 内容如下:

[mysqld]

default-character-set=gbk  #设置字符集为gbk

init_connect='SET NAMES gbk' #设置字符集为gbk

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Default to using old password format for compatibility with mysql 3.x

# clients (those using the mysqlclient10 compatibility package).

old_passwords=1

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

[client]

default-character-set=gbk #设置字符集为gbk

在/etc/init.d 下执行:./mysqld start 启动mysql。

然后执行:mysql -u root 登录数据库:

执行 show variables like 'character%'; 查看数据库的字符集。

+--------------------------+----------------------------+

| Variable_name                 | Value                    |

+--------------------------+----------------------------+

| character_set_client         | gbk                       |

| character_set_connection | gbk                       |

| character_set_database    | gbk                       |

| character_set_filesystem  | binary                   |

| character_set_results       | gbk                        |

| character_set_server       | gbk                        |

| character_set_system      | utf8                        |

| character_sets_dir           | /usr/share/mysql/charsets/ |

+--------------------------+----------------------------+

8 rows in set (0.00 sec)

执行: create database svnmanager; 创建 svnmanager的管理数据库。

执行:grant all privileges on svnmanager.* to 'svnmanager'@'localhost' identified by 'passwd'; 创建用户并赋给权限。

执行:flush privileges; 让权限生效。

安装svnmanager需要安装:VersionControl_SVN 及XML_Parser 。可以在线安装:

执行:pear install --alldeps XML_Parser 及pear install --alldeps VersionControl_SVN  或者下载后安装:

pear install --alldeps XML_Parser-1.3.2.tgz

pear install --alldeps VersionControl_SVN-0.3.1.tgz

注意安装的时候如果没有写全名,将失败。

我安装的apache 版本为:httpd-2.2.11 下载的是src.rpm 包:httpd-2.2.11-2.el5s2.src.rpm  需要在执行:rpm -ivh httpd-2.2.11-2.el5s2.src.rpm  后,到:/usr/src/redhat/SPECS 下执行:rpmbuild -bb httpd.spec  生成 rpm 包,然后到:/usr/src/redhat/RPMS/x86_64

安装:httpd-2.2.11-2.x86_64.rpm   httpd-devel-2.2.11-2.x86_64.rpm。

安装完成apache 后,如果你的svnmanager计划使用中文,请在:/etc/httpd/conf 下的httpd.conf  中增加:AddDefaultCharset GB18030

之所以不是:gb2312 或gbk 是因为GB18030包含拉前面两个字符集。

现在解压:svnmanager-1.06.tar.gz 然后配置:config.php.linux 文件。 windows系统请配置:config.php.win。

$lang =  "zh_CN.gbk"; 而不是:$lang = "utf8";

之所以不用utf8是因为我配置成这个后,进入Repository Admin 菜单的时候会报:skip setlocale() failed, unicode characters might fail!

其余的根据实际情况配置就可以拉。

<?php

//

//  SVNManager config.php file for Linux based servers

//

//You can find the available localizations in a linux shell by typing: locale -a

//

//Warning: Please set this correct if you want to support exotic repository names

//$lang                                         = "en_US.UTF-8";

$lang                                           = "zh_CN.gbk";

//Shell command's

$htpassword_cmd                         =       "/usr/bin/htpasswd";

$svn_cmd                                =       "/usr/bin/svn";

$svnadmin_cmd                           =       "/usr/bin/svnadmin";

//Subversion locations

//$svn_repos_loc                        =       "/var/www/repos";

$svn_repos_loc                          =       "/data/svnroot/repository";

//$svn_passwd_file                      =       "/var/www/repos/passwdfile";

$svn_passwd_file                        =       "/etc/httpd/conf.d/svn_auth_file";

//$svn_access_file                      =       "/var/www/repos/accessfile";

$svn_access_file                        =       "/etc/httpd/conf.d/svn_access_file";

//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!!)

//

//A database will be automatically created when SVNManager is first started, if you

//make sure that the credentials have database creation rights!

//

//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:passwd@localhost/svnmanager";

//The following location for SQLite is not readable from internet by means of an .htaccess file

//$dsn                  =       "sqlite://svnmanager/svnmanager.db";

//Administrator account (only for first time use, when you create an admin user this account will be unusable)

$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";

?>

 配置好 config.php.linux 后,修改文件名为config.php。然后将这个目录移到:/var/www/html/下,或者其他指定的目录。

然后在/etc/init.d 下执行:httpd start 启动apache 。

然后在浏览器中输入:http:ip/svnmanager 访问svnmanager。 首次登陆用户名密码:admin/admin 请建立一个管理用户。因为admin 用户首次登陆后将失败。

至此安装完成。

 

 

 

 

 

原创粉丝点击