1.安装需要的包
yum install gcc
yum install httpd
yum install httpd-devel
yum install apr-devel (httpd-devel装了这个就不用装了)
yum install apr-util-devel (httpd-devel装了这个就不用装了)
yum install sqlite-devel
yum install zlib-devel
yum install openssl-devel
2.安装neon
tar -xzvf neon-0.29.6.tar.gz
cd neon-0.29.6
./configure --prefix=/usr/local/neon --with-ssl
make
make install
3.安装subversion
cd /workstation/soft/
tar -xjvf subversion-1.3.1.tar.bz2
cd subversion-1.3.1
./configure --with-apxs=/usr/sbin/apxs --prefix=/usr/local/subversion --with-apr=/usr/ --with-apr-util=/usr/ --with-ssl --with-zlib --with-neon=/usr/local/neon --enable-maintainer-mode
make
make install
4.创建仓库"test"
mkdir -p /workstation/svnroot/repository/test
/usr/local/subversion/bin/svnadmin create /workstation/svnroot/repository/test
5.提交修订版本
mkdir /workstation/app
vim /workstation/app/hello.php
/usr/local/subversion/bin/svn import /workstation/app/ file:///workstation/svnroot/repository/test -m "1.0版本"
6.修改httpd.conf
vim /etc/httpd/conf/httpd.conf
在最后添加下面的内容:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /workstation/svnroot/repository/
AuthzSVNAccessFile /workstation/svnroot/repository/authz.conf
AuthType Basic
AuthName "Subversion.zoneyump"
AuthUserFile /workstation/svnroot/repository/authfile
Require valid-user
</Location>
7.创建密码
这时候因为还没用户,浏览器访问只能看到一个输入用户名和密码的对话框
htpasswd -c /workstation/svnroot/repository/authfile sai
8.权限配置
vim /workstation/svnroot/repository/authz.conf
[test:/]
sai = rw
9.改权限
由于RHEL5中引入了SELinux来加安全控制,因此还需要对该路径进行赋权
如果不赋权,会出现 Permission denied: Could not open password file: /web/svn/svnconf/svn-pwd-file 这样的错误
chcon -h -t httpd_sys_content_t /workstation/svnroot/repository/
chcon -R -h -t httpd_sys_content_t /workstation/svnroot/repository/
10.重启apache服务器
11.打开浏览器访问http://localhost/svn/test/ 如果有东西显示就说明成功
12.配置环境变量
vim /etc/profile
在最后添加这么一行:
export PATH=$PATH:/usr/local/subversion/bin
保存退出
source /etc/profile
13.在桌面新建一个名为testSVN
cd testSVN
svn co http://192.168.1.110/svn/test
14.简单使用
当我们修改过hello.php,需要提交,就执行svn commit -m ""
要更新就 svn udpate
想新增文件也很简单,在这个test目录下,新建一个world.php,里面随便添加内容
执行svn add world.php,之后svn commit,提交成功
-------------------------------------------------------------------------------------------------------------------------------------
只安装客户端
1.安装编译需要的包
yum install gcc
yum install zlib-devel
yum install openssl-devel
yum install apr-devel
yum install apr-util-devel
yum install sqlite-devel
2.安装neon
tar -xzvf neon-0.29.6.tar.gz
cd neon-0.29.6
./configure --prefix=/usr/local/neon --with-ssl
make
make install
3.安装svn
tar -xjvf subversion-1.3.1.tar.bz2
cd subversion-1.3.1
./configure --prefix=/usr/local/subversion --with-neon=/usr/local/neon
make
make install