今天将SVN目录配置成了raid1
所以需要重新弄下SVN
首先安装 subversion
yum install subversion
然后建立代码库
svnadmin create /svn/miophp
svnadmin create /svn/miodevelop
svnadmin create /svn/blog
修改配置文件
vi /svn/blog/conf/svnserve.conf
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit http://subversion.tigris.org/ for more information.
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = none
auth-access = write
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
realm=blog
[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
建立账号
vi /svn/blog/conf/passwd
[users]
xxx=xxx
设置权限
vi /svn/blog/conf/authz
[/]
xxx=rw
*=
然后去改apache的配置文件 建几个虚拟主机
vi /etc/httpd/conf/httpd.comf
<VirtualHost *:80>
ServerAdmin admin@miophp.com
DocumentRoot /var/www/html/
ServerName www.mx1985.com
ErrorLog logs/mx1985.com_errlog
CustomLog logs/mx1985.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@miophp.com
DocumentRoot /var/miophp/
ServerName www.miophp.org
ErrorLog logs/miophp.org_errlog
CustomLog logs/miophp.org-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@miophp.com
DocumentRoot /var/miotest/
ServerName www.mio.com
ErrorLog logs/mio.com_errlog
CustomLog logs/mio.com-access_log common
</VirtualHost>
设置apache的上下文
chcon -R -t httpd_sys_content_t /xxx
chown -r apache /xxx
然后分别检出SVN
svn co svn://192.168.1.253/blog
然后设置钩子程序 自动把代码拉到apache目录
mv post-commit.tmpl post-commit
vi post-commit
svn update /var/www/html/ --username --password
chmod a+x post-commit
搞定!
上一篇:memcache_connect Permission denied 下一篇:快递查询API