centos svn
安装说明
系统环境:CentOS-6.3
安装方式:yum install (源码安装容易产生版本兼容的问题)
安装软件:系统自动下载SVN软件
检查已安装版本
#检查是否安装了低版本的SVN
[root@localhost /]# rpm -qa subversion
#卸载旧版本SVN
[root@localhost modules]# yum remove subversion
安装SVN
[root@localhost modules]# yum install mod_dav_svn subversion
确认已安装了svn模块
[root@localhost /]# cd /etc/httpd/modules
[root@localhost modules]# ls | grep svn
mod_authz_svn.so
mod_dav_svn.so
验证安装
检验已经安装的SVN版本信息
[root@localhost modules]# svnserve --version
svnserve,版本 1.6.11 (r934486)
编译于 Jun 23 2012,00:44:03
版权所有 (C) 2000-2009 CollabNet。
Subversion 是开放源代码软件,请参阅 http://subversion.tigris.org/ 站点。
此产品包含由 CollabNet(http://www.Collab.Net/) 开发的软件。
下列版本库后端(FS) 模块可用:
* fs_base : 模块只能操作BDB版本库。
* fs_fs : 模块与文本文件(FSFS)版本库一起工作。
Cyrus SASL 认证可用。
代码库创建
一 需求
开发服务器搭建好SVN服务器,不可能只管理一个工程项目,如何做到不在一个项目中的开发人员不能访问其它项目中的代码,做好技术保密工作。
代码仓库有三个仓库:project1,project2,project3
假设人员有6个人:eg1,eg2,eg3,eg4,eg5,eg6
eg1,eg2,只能访问project1;
eg3,eg4,只能访问project2;
eg5,eg6,只能访问project3;
二 实现
在你的仓库路径下:假如是/home/sv
cd /home/svn
//创建三个代码仓库
svnadmin create project1
svnadmin create project2
svnadmin create project3
//把两个权限配置文件复制到SVN
//根路径下,统一管理所有代码仓库
cd/projcet1/conf
cp authz passwd /home/svn
//打开配置文件
vi svnserve.conf
修改成如下:
anon-access = none //禁止匿名访问
auth-access = write
password-db = /home/svn/passwd //统一使用密码文件
authz-db = /home/svn/authz
realm = project1 //权限域名,很重要,写你的工程名
分别修改project2的svnserve.conf
和上面一样,最后一行分别写
anon-access = none //禁止匿名访问
auth-access = write
password-db = /home/svn/passwd //统一使用密码文件
authz-db = /home/svn/authz
realm = project2 //权限域名,很重要,写你的工程名
分别修改project3的svnserve.conf
和上面一样,最后一行分别写
anon-access = none //禁止匿名访问
auth-access = write
password-db = /home/svn/passwd //统一使用密码文件
authz-db = /home/svn/authz
realm = project3 //权限域名,很重要,写你的工程名
修改两个权限管理文件:
passwd
//用户名 = 密码
[users]
eg1 = 123
eg2 = 123
eg3 = 123
eg4 = 123
eg5 = 123
eg6 = 123
authz
[groups] //分组
admin = eg1,eg2
guest = eg3,eg4
guset1 = eg5,eg6
[/] //管理者拥有所有读写权限
* =
@admin = rw
[project1:/] //工程1的访问控制,guest1,2无法访问
@admin = rw
或
eg1 = rw
eg2 = rw
[project2:/]
@guest = rw
或
eg3 = rw
eg4 = rw
[project3:/]
@guest1 = rw
或
eg5 = rw
eg6 = rw
三 重启
1
svnserve -d -r /home/svn
停止命令
1
killall svnserve
vi /etc/rc.d/rc.local
添加一行 svnserve -d -r /var/svn/repositories
自动更新网站根目录
hook/post-commit
#!/bin/sh
cd /home/wwwroot/xfrfenxiao/
/usr/bin/svn cleanup
/usr/bin/svn up /home/wwwroot/xfrfenxiao --username "lzq" --password "123456"
http://52tec.cn/post-7.html
[root@VM_69_141_centos wwwroot]# dirdefault xfrfenxiao[root@VM_69_141_centos wwwroot]# dirdefault xfrfenxiao[root@VM_69_141_centos wwwroot]# cd ../[root@VM_69_141_centos home]# dirlost+found svn www wwwlogs wwwroot[root@VM_69_141_centos home]# cd www[root@VM_69_141_centos www]# dir[root@VM_69_141_centos www]# dir[root@VM_69_141_centos www]# cd ../wwwroot/[root@VM_69_141_centos wwwroot]# dirdefault xfrfenxiao[root@VM_69_141_centos wwwroot]# ping xfrfenxiao.sdxiaofeiren.comPING xfrfenxiao.sdxiaofeiren.com (115.159.111.242) 56(84) bytes of data.64 bytes from 115.159.111.242: icmp_seq=1 ttl=63 time=0.354 ms64 bytes from 115.159.111.242: icmp_seq=2 ttl=63 time=0.347 ms64 bytes from 115.159.111.242: icmp_seq=3 ttl=63 time=0.395 ms^C--- xfrfenxiao.sdxiaofeiren.com ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2447msrtt min/avg/max/mdev = 0.347/0.365/0.395/0.026 ms[root@VM_69_141_centos wwwroot]# lnmp vhost list+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+Apache Virtualhost list:xfrfenxiao.sdxiaofeiren.com[root@VM_69_141_centos wwwroot]# lnmp restart+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+Stoping LAMP...Stopping httpd: [ OK ]Shutting down MySQL. SUCCESS! Starting LAMP...Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ OK ]Starting MySQL.. SUCCESS! [root@VM_69_141_centos wwwroot]# lnmp vhost list+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+Apache Virtualhost list:xfrfenxiao.sdxiaofeiren.com[root@VM_69_141_centos wwwroot]# ^C[root@VM_69_141_centos wwwroot]# lnmp vhost del+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+=======================================Current Virtualhost:Apache Virtualhost list:xfrfenxiao.sdxiaofeiren.com=======================================Please enter domain you want to delete: xfr.^H^C[root@VM_69_141_centos wwwroot]# lnmp vhost del+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+=======================================Current Virtualhost:Apache Virtualhost list:xfrfenxiao.sdxiaofeiren.com=======================================Please enter domain you want to delete: xff==========================================Domain: xff was not exist!==========================================[root@VM_69_141_centos wwwroot]# lnmp vhost del+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+=======================================Current Virtualhost:Apache Virtualhost list:xfrfenxiao.sdxiaofeiren.com=======================================Please enter domain you want to delete: xfrfenxiao.sdxiaofeiren.com========================================================Domain: xfrfenxiao.sdxiaofeiren.com has been deleted.Website files will not be deleted for security reasons.You need to manually delete the website files.========================================================[root@VM_69_141_centos wwwroot]# lnmp vhost list+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+Apache Virtualhost list:[root@VM_69_141_centos wwwroot]# lnmp vhost add+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+Please enter domain(example: www.lnmp.org): xfrfenxiao.sdxiaofeiren.com====================================== Your domain: xfrfenxiao.sdxiaofeiren.com======================================Do you want to add more domain name? (y/n) nPlease enter the directory for the domain: xfrfenxiao.sdxiaofeiren.com(Default directory: /home/wwwroot/xfrfenxiao.sdxiaofeiren.com):/home/wwwroot/xfrfenxiao/Virtual Host Directory: /home/wwwroot/xfrfenxiao/===========================Allow access_log? (y/n)===========================nPlease enter Administrator Email Address:Administrator Email Address will set to webmaster@example.com!======================================================Create database and MySQL user with same name (y/n)======================================================n
Press any key to start create virtul host...
Create Virtul Host directory......set permissions of Virtual Host directory......Test Apache configure file...httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerNameSyntax OKRestart Apache...Stopping httpd: [ OK ]Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ OK ]================================================Virtualhost infomation:Your domain: xfrfenxiao.sdxiaofeiren.comHome Directory: /home/wwwroot/xfrfenxiao/Enable log: noCreate database: noCreate ftp account: no================================================[root@VM_69_141_centos wwwroot]# reboot[root@VM_69_141_centos wwwroot]# Broadcast message from root@VM_69_141_centos(/dev/pts/0) at 14:30 ...
The system is going down for reboot NOW!
Connection closed by foreign host.
Disconnected from remote host(my腾讯云) at 14:30:27.
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Tue Nov 10 14:07:52 2015 from 113.128.97.32[root@VM_69_141_centos ~]# cd /usr/local/apache/conf/vhost/[root@VM_69_141_centos vhost]# dirxfrfenxiao.sdxiaofeiren.com.conf[root@VM_69_141_centos vhost]# vi xfrfenxiao.sdxiaofeiren.com.conf [root@VM_69_141_centos vhost]# cd /home/wwwroot/xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# dirinstall.php[root@VM_69_141_centos xfrfenxiao]# vi index.html[root@VM_69_141_centos xfrfenxiao]# vi xfrfenxiao.sdxiaofeiren.com.conf [root@VM_69_141_centos xfrfenxiao]# lnmp vhost Broadcast message from root@VM_69_141_centos(unknown) at 14:37 ...
The system is going down for halt NOW!
Connection closed by foreign host.
Disconnected from remote host(my腾讯云) at 14:37:16.
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...Could not connect to '115.159.111.242' (port 22): Connection failed.
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.
[root@VM_69_141_centos ~]# diranaconda-ks.cfg install.log.syslog lnmp1.2-fullinstall.log lnmp-install.log lnmp1.2-full.tar.gz[root@VM_69_141_centos ~]#cd /home/wwwr-bash: 碤: command not found[root@VM_69_141_centos ~]# cd /home[root@VM_69_141_centos home]# dir[root@VM_69_141_centos home]# lltotal 0[root@VM_69_141_centos home]# fdisk -l
Disk /dev/vda: 8589 MB, 8589934592 bytes255 heads, 63 sectors/track, 1044 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000a8f0f
Device Boot Start End Blocks Id System/dev/vda1 * 1 1045 8387584 83 LinuxNote: sector size is 4096 (not 512)
Disk /dev/vdb: 53.7 GB, 53687091200 bytes16 heads, 56 sectors/track, 14628 cylindersUnits = cylinders of 896 * 4096 = 3670016 bytesSector size (logical/physical): 4096 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk identifier: 0x0058cf30
Device Boot Start End Blocks Id System/dev/vdb1 1 14628 52426528 83 Linux
Disk /dev/vdc: 2147 MB, 2147483648 bytes16 heads, 63 sectors/track, 4161 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000
[root@VM_69_141_centos home]# vi /etc/fstab [root@VM_69_141_centos home]# vi /etc/fstab [root@VM_69_141_centos home]# reboot[root@VM_69_141_centos home]# Broadcast message from root@VM_69_141_centos(/dev/pts/0) at 14:48 ...
The system is going down for reboot NOW!
Connection closed by foreign host.
Disconnected from remote host(my腾讯云) at 14:48:16.
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Tue Nov 10 14:45:51 2015 from 113.128.97.32[root@VM_69_141_centos ~]# cd /home/wwwroot/[root@VM_69_141_centos wwwroot]# dirdefault xfrfenxiao[root@VM_69_141_centos wwwroot]# lnmp vhost list+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+Apache Virtualhost list:[root@VM_69_141_centos wwwroot]# dir default xfrfenxiao[root@VM_69_141_centos wwwroot]# rm -rf xfrfenxiao/[root@VM_69_141_centos wwwroot]# dirdefault[root@VM_69_141_centos wwwroot]# lnmp vhost add+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+Please enter domain(example: www.lnmp.org): xfrfenxiao.sdxiaofeiren.com====================================== Your domain: xfrfenxiao.sdxiaofeiren.com======================================Do you want to add more domain name? (y/n) nPlease enter the directory for the domain: xfrfenxiao.sdxiaofeiren.com(Default directory: /home/wwwroot/xfrfenxiao.sdxiaofeiren.com):xfrfenxi^H^H^H^H^H^H^H^H^H^H^C[root@VM_69_141_centos wwwroot]# lnmp vhost add+-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| http://lnmp.org |+-------------------------------------------+Please enter domain(example: www.lnmp.org): xfrfenxiao.sdxiaofeiren.com====================================== Your domain: xfrfenxiao.sdxiaofeiren.com======================================Do you want to add more domain name? (y/n) nPlease enter the directory for the domain: xfrfenxiao.sdxiaofeiren.com(Default directory: /home/wwwroot/xfrfenxiao.sdxiaofeiren.com):/home/wwwroot/xfrfenxiaoVirtual Host Directory: /home/wwwroot/xfrfenxiao===========================Allow access_log? (y/n)===========================nPlease enter Administrator Email Address:Administrator Email Address will set to webmaster@example.com!======================================================Create database and MySQL user with same name (y/n)======================================================n
Press any key to start create virtul host...
Create Virtul Host directory......set permissions of Virtual Host directory......Test Apache configure file...test apache configure... Syntax OK doneRestart Apache...restart apache... done================================================Virtualhost infomation:Your domain: xfrfenxiao.sdxiaofeiren.comHome Directory: /home/wwwroot/xfrfenxiaoEnable log: noCreate database: noCreate ftp account: no================================================[root@VM_69_141_centos wwwroot]# cd xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# dir[root@VM_69_141_centos xfrfenxiao]# vi index.html[root@VM_69_141_centos xfrfenxiao]# yum install subversionLoaded plugins: fastestmirror, securityDetermining fastest mirrorscentosplus | 3.4 kB 00:00 centosplus/primary_db | 1.1 MB 00:00 contrib | 2.9 kB 00:00 contrib/primary_db | 1.2 kB 00:00 cr | 3.3 kB 00:00 cr/primary_db | 1.2 kB 00:00 epel | 4.3 kB 00:00 epel/primary_db | 4.9 MB 00:00 extras | 3.4 kB 00:00 extras/primary_db | 30 kB 00:00 fasttrack | 3.3 kB 00:00 fasttrack/primary_db | 1.2 kB 00:00 os | 3.7 kB 00:00 os/primary_db | 3.6 MB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 1.9 MB 00:00 Setting up Install ProcessResolving Dependencies--> Running transaction check---> Package subversion.i686 0:1.6.11-15.el6_7 will be installed--> Processing Dependency: perl(URI) >= 1.17 for package: subversion-1.6.11-15.el6_7.i686--> Processing Dependency: apr >= 1.3.0 for package: subversion-1.6.11-15.el6_7.i686--> Processing Dependency: libneon.so.27 for package: subversion-1.6.11-15.el6_7.i686--> Processing Dependency: libaprutil-1.so.0 for package: subversion-1.6.11-15.el6_7.i686--> Processing Dependency: libapr-1.so.0 for package: subversion-1.6.11-15.el6_7.i686--> Running transaction check---> Package apr.i686 0:1.3.9-5.el6_2 will be installed---> Package apr-util.i686 0:1.3.9-3.el6_0.1 will be installed---> Package neon.i686 0:0.29.3-3.el6_4 will be installed--> Processing Dependency: libpakchois.so.0 for package: neon-0.29.3-3.el6_4.i686---> Package perl-URI.noarch 0:1.40-2.el6 will be installed--> Running transaction check---> Package pakchois.i686 0:0.4-3.2.el6 will be installed--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================== Package Arch Version Repository Size========================================================================================Installing: subversion i686 1.6.11-15.el6_7 updates 2.2 MInstalling for dependencies: apr i686 1.3.9-5.el6_2 os 129 k apr-util i686 1.3.9-3.el6_0.1 os 89 k neon i686 0.29.3-3.el6_4 os 120 k pakchois i686 0.4-3.2.el6 os 21 k perl-URI noarch 1.40-2.el6 os 117 k
Transaction Summary========================================================================================Install 6 Package(s)
Total download size: 2.7 MInstalled size: 12 MIs this ok [y/N]: yDownloading Packages:(1/6): apr-1.3.9-5.el6_2.i686.rpm | 129 kB 00:00 (2/6): apr-util-1.3.9-3.el6_0.1.i686.rpm | 89 kB 00:00 (3/6): neon-0.29.3-3.el6_4.i686.rpm | 120 kB 00:00 (4/6): pakchois-0.4-3.2.el6.i686.rpm | 21 kB 00:00 (5/6): perl-URI-1.40-2.el6.noarch.rpm | 117 kB 00:00 (6/6): subversion-1.6.11-15.el6_7.i686.rpm | 2.2 MB 00:00 ----------------------------------------------------------------------------------------Total 20 MB/s | 2.7 MB 00:00 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : apr-1.3.9-5.el6_2.i686 1/6 Installing : perl-URI-1.40-2.el6.noarch 2/6 Installing : apr-util-1.3.9-3.el6_0.1.i686 3/6 Installing : pakchois-0.4-3.2.el6.i686 4/6 Installing : neon-0.29.3-3.el6_4.i686 5/6 Installing : subversion-1.6.11-15.el6_7.i686 6/6 Verifying : apr-util-1.3.9-3.el6_0.1.i686 1/6 Verifying : apr-1.3.9-5.el6_2.i686 2/6 Verifying : subversion-1.6.11-15.el6_7.i686 3/6 Verifying : neon-0.29.3-3.el6_4.i686 4/6 Verifying : perl-URI-1.40-2.el6.noarch 5/6 Verifying : pakchois-0.4-3.2.el6.i686 6/6
Installed: subversion.i686 0:1.6.11-15.el6_7
Dependency Installed: apr.i686 0:1.3.9-5.el6_2 apr-util.i686 0:1.3.9-3.el6_0.1 neon.i686 0:0.29.3-3.el6_4 pakchois.i686 0:0.4-3.2.el6 perl-URI.noarch 0:1.40-2.el6
Complete![root@VM_69_141_centos xfrfenxiao]# cd /home [root@VM_69_141_centos home]# dirlost+found svn www wwwlogs wwwroot[root@VM_69_141_centos home]# rm -rf svn[root@VM_69_141_centos home]# mkdir vn[root@VM_69_141_centos home]# rm -rf vn/[root@VM_69_141_centos home]# mkdir svn[root@VM_69_141_centos home]# dirlost+found svn www wwwlogs wwwroot[root@VM_69_141_centos home]# cd svn[root@VM_69_141_centos svn]# dir[root@VM_69_141_centos svn]# mkdir xfrfenxiao[root@VM_69_141_centos svn]# svnadmin ./xfrfenxiao/Unknown command: './xfrfenxiao/'Type 'svnadmin help' for usage.[root@VM_69_141_centos svn]# yum install subversionLoaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfileSetting up Install ProcessPackage subversion-1.6.11-15.el6_7.i686 already installed and latest versionNothing to do[root@VM_69_141_centos svn]# svnadminType 'svnadmin help' for usage.[root@VM_69_141_centos svn]# reboot[root@VM_69_141_centos svn]# Broadcast message from root@VM_69_141_centos(/dev/pts/0) at 14:53 ...
The system is going down for reboot NOW!
Connection closed by foreign host.
Disconnected from remote host(my腾讯云) at 14:53:55.
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Tue Nov 10 14:48:40 2015 from 113.128.97.32[root@VM_69_141_centos ~]# subversion -v-bash: subversion: command not found[root@VM_69_141_centos ~]# subversion -v-bash: subversion: command not found[root@VM_69_141_centos ~]# yum install subversionLoaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfileSetting up Install ProcessPackage subversion-1.6.11-15.el6_7.i686 already installed and latest versionNothing to do[root@VM_69_141_centos ~]# subversion -v-bash: subversion: command not found[root@VM_69_141_centos ~]# yum remove subversionLoaded plugins: fastestmirror, securitySetting up Remove ProcessResolving Dependencies--> Running transaction check---> Package subversion.i686 0:1.6.11-15.el6_7 will be erased--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================== Package Arch Version Repository Size========================================================================================Removing: subversion i686 1.6.11-15.el6_7 @updates 11 M
Transaction Summary========================================================================================Remove 1 Package(s)
Installed size: 11 MIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Erasing : subversion-1.6.11-15.el6_7.i686 1/1 Verifying : subversion-1.6.11-15.el6_7.i686 1/1
Removed: subversion.i686 0:1.6.11-15.el6_7
Complete![root@VM_69_141_centos ~]# yum install subversionLoaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfileSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package subversion.i686 0:1.6.11-15.el6_7 will be installed--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================== Package Arch Version Repository Size========================================================================================Installing: subversion i686 1.6.11-15.el6_7 updates 2.2 M
Transaction Summary========================================================================================Install 1 Package(s)
Total download size: 2.2 MInstalled size: 11 MIs this ok [y/N]: yDownloading Packages:subversion-1.6.11-15.el6_7.i686.rpm | 2.2 MB 00:00 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : subversion-1.6.11-15.el6_7.i686 1/1 Verifying : subversion-1.6.11-15.el6_7.i686 1/1
Installed: subversion.i686 0:1.6.11-15.el6_7
Complete![root@VM_69_141_centos ~]# subversion -v-bash: subversion: command not found[root@VM_69_141_centos ~]# rpm -qa subversionsubversion-1.6.11-15.el6_7.i686[root@VM_69_141_centos ~]# yum remove subversionLoaded plugins: fastestmirror, securitySetting up Remove ProcessResolving Dependencies--> Running transaction check---> Package subversion.i686 0:1.6.11-15.el6_7 will be erased--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================== Package Arch Version Repository Size========================================================================================Removing: subversion i686 1.6.11-15.el6_7 @updates 11 M
Transaction Summary========================================================================================Remove 1 Package(s)
Installed size: 11 MIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Erasing : subversion-1.6.11-15.el6_7.i686 1/1 Verifying : subversion-1.6.11-15.el6_7.i686 1/1
Removed: subversion.i686 0:1.6.11-15.el6_7
Complete![root@VM_69_141_centos ~]# rpm -qa subversion[root@VM_69_141_centos ~]# yum install mod_dav_svn subversion Loaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfileSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package mod_dav_svn.i686 0:1.6.11-15.el6_7 will be installed--> Processing Dependency: httpd-mmn = 20051115 for package: mod_dav_svn-1.6.11-15.el6_7.i686---> Package subversion.i686 0:1.6.11-15.el6_7 will be installed--> Running transaction check---> Package httpd.i686 0:2.2.15-47.el6.centos will be installed--> Processing Dependency: httpd-tools = 2.2.15-47.el6.centos for package: httpd-2.2.15-47.el6.centos.i686--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-47.el6.centos.i686--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-47.el6.centos.i686--> Running transaction check---> Package apr-util-ldap.i686 0:1.3.9-3.el6_0.1 will be installed---> Package httpd-tools.i686 0:2.2.15-47.el6.centos will be installed---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================== Package Arch Version Repository Size========================================================================================Installing: mod_dav_svn i686 1.6.11-15.el6_7 updates 81 k subversion i686 1.6.11-15.el6_7 updates 2.2 MInstalling for dependencies: apr-util-ldap i686 1.3.9-3.el6_0.1 os 15 k httpd i686 2.2.15-47.el6.centos updates 829 k httpd-tools i686 2.2.15-47.el6.centos updates 77 k mailcap noarch 2.1.31-2.el6 os 27 k
Transaction Summary========================================================================================Install 6 Package(s)
Total download size: 3.2 MInstalled size: 14 MIs this ok [y/N]: yDownloading Packages:(1/6): apr-util-ldap-1.3.9-3.el6_0.1.i686.rpm | 15 kB 00:00 (2/6): httpd-2.2.15-47.el6.centos.i686.rpm | 829 kB 00:00 (3/6): httpd-tools-2.2.15-47.el6.centos.i686.rpm | 77 kB 00:00 (4/6): mailcap-2.1.31-2.el6.noarch.rpm | 27 kB 00:00 (5/6): mod_dav_svn-1.6.11-15.el6_7.i686.rpm | 81 kB 00:00 (6/6): subversion-1.6.11-15.el6_7.i686.rpm | 2.2 MB 00:00 ----------------------------------------------------------------------------------------Total 19 MB/s | 3.2 MB 00:00 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : mailcap-2.1.31-2.el6.noarch 1/6 Installing : httpd-tools-2.2.15-47.el6.centos.i686 2/6 Installing : apr-util-ldap-1.3.9-3.el6_0.1.i686 3/6 Installing : httpd-2.2.15-47.el6.centos.i686 4/6 Installing : subversion-1.6.11-15.el6_7.i686 5/6 Installing : mod_dav_svn-1.6.11-15.el6_7.i686 6/6 Verifying : subversion-1.6.11-15.el6_7.i686 1/6 Verifying : apr-util-ldap-1.3.9-3.el6_0.1.i686 2/6 Verifying : httpd-2.2.15-47.el6.centos.i686 3/6 Verifying : httpd-tools-2.2.15-47.el6.centos.i686 4/6 Verifying : mailcap-2.1.31-2.el6.noarch 5/6 Verifying : mod_dav_svn-1.6.11-15.el6_7.i686 6/6
Installed: mod_dav_svn.i686 0:1.6.11-15.el6_7 subversion.i686 0:1.6.11-15.el6_7
Dependency Installed: apr-util-ldap.i686 0:1.3.9-3.el6_0.1 httpd.i686 0:2.2.15-47.el6.centos httpd-tools.i686 0:2.2.15-47.el6.centos mailcap.noarch 0:2.1.31-2.el6
Complete![root@VM_69_141_centos ~]# subversion -v-bash: subversion: command not found[root@VM_69_141_centos ~]# subversion -v-bash: subversion: command not found[root@VM_69_141_centos ~]# cd /etc/httpd/modules/[root@VM_69_141_centos modules]# dirmod_actions.somod_authz_svn.so mod_ext_filter.so mod_proxy_ftp.somod_alias.somod_authz_user.so mod_filter.so mod_proxy_http.somod_asis.somod_autoindex.so mod_headers.so mod_proxy_scgi.somod_auth_basic.somod_cache.so mod_ident.so mod_reqtimeout.somod_auth_digest.somod_cern_meta.so mod_include.so mod_rewrite.somod_authn_alias.somod_cgi.so mod_info.so mod_setenvif.somod_authn_anon.somod_cgid.so mod_ldap.so mod_speling.somod_authn_dbd.somod_dav.so mod_log_config.so mod_status.somod_authn_dbm.somod_dav_fs.so mod_log_forensic.so mod_substitute.somod_authn_default.somod_dav_svn.so mod_logio.so mod_suexec.somod_authn_file.somod_dbd.so mod_mime.so mod_unique_id.somod_authnz_ldap.somod_deflate.so mod_mime_magic.so mod_userdir.somod_authz_dbm.somod_dir.so mod_negotiation.so mod_usertrack.somod_authz_default.somod_disk_cache.so mod_proxy.so mod_version.somod_authz_groupfile.somod_dumpio.so mod_proxy_ajp.so mod_vhost_alias.somod_authz_host.somod_env.so mod_proxy_balancer.somod_authz_owner.somod_expires.so mod_proxy_connect.so[root@VM_69_141_centos modules]# ls mod_amod_actions.so mod_authn_dbd.so mod_authz_groupfile.somod_alias.so mod_authn_dbm.so mod_authz_host.somod_asis.so mod_authn_default.so mod_authz_owner.somod_auth_basic.so mod_authn_file.so mod_authz_svn.somod_auth_digest.so mod_authnz_ldap.so mod_authz_user.somod_authn_alias.so mod_authz_dbm.so mod_autoindex.somod_authn_anon.so mod_authz_default.so [root@VM_69_141_centos modules]# ls mod_amod_actions.so mod_authn_dbd.so mod_authz_groupfile.somod_alias.so mod_authn_dbm.so mod_authz_host.somod_asis.so mod_authn_default.so mod_authz_owner.somod_auth_basic.so mod_authn_file.so mod_authz_svn.somod_auth_digest.so mod_authnz_ldap.so mod_authz_user.somod_authn_alias.so mod_authz_dbm.so mod_autoindex.somod_authn_anon.so mod_authz_default.so [root@VM_69_141_centos modules]# ls mod_d mod_dav.so mod_dav_svn.so mod_deflate.so mod_disk_cache.somod_dav_fs.so mod_dbd.so mod_dir.so mod_dumpio.so[root@VM_69_141_centos modules]# svnserve --versionsvnserve, version 1.6.11 (r934486) compiled Aug 17 2015, 08:21:51
Copyright (C) 2000-2009 CollabNet.Subversion is open source software, see http://subversion.tigris.org/This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository back-end (FS) modules are available:
* fs_base : Module for working with a Berkeley DB repository.* fs_fs : Module for working with a plain file (FSFS) repository.
Cyrus SASL authentication is available.
[root@VM_69_141_centos modules]# svnadminType 'svnadmin help' for usage.[root@VM_69_141_centos modules]# cd /[root@VM_69_141_centos /]# dirbin cron.tmp.1 dataetc lib media opt root selinux sys usrboot cron.tmp.2 devhome lost+found mnt proc sbin srv tmp var[root@VM_69_141_centos /]# cd /home/wwwroot/[root@VM_69_141_centos wwwroot]# dirdefault xfrfenxiao[root@VM_69_141_centos wwwroot]# cd xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# dirindex.html[root@VM_69_141_centos xfrfenxiao]# cd /home/svn[root@VM_69_141_centos svn]# dirxfrfenxiao[root@VM_69_141_centos svn]# svnadmin create ./xfrfenxiao/[root@VM_69_141_centos svn]# dirxfrfenxiao[root@VM_69_141_centos svn]# cd xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# dirREADME.txt conf db format hooks locks[root@VM_69_141_centos xfrfenxiao]# vi /etc/sysconfig/rc.local [root@VM_69_141_centos xfrfenxiao]# reboot[root@VM_69_141_centos xfrfenxiao]# Broadcast message from root@VM_69_141_centos(/dev/pts/0) at 16:24 ...
The system is going down for reboot NOW!
Connection closed by foreign host.
Disconnected from remote host(my腾讯云) at 16:24:13.
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Tue Nov 10 14:54:34 2015 from 113.128.97.32[root@VM_69_141_centos ~]# ps -ef|grep svnserveroot 1447 1412 0 16:25 pts/0 00:00:00 grep svnserve[root@VM_69_141_centos ~]# vi /etc/rc.d/rc.local [root@VM_69_141_centos ~]# reboot[root@VM_69_141_centos ~]# Broadcast message from root@VM_69_141_centos(/dev/pts/0) at 16:27 ...
The system is going down for reboot NOW!
Connection closed by foreign host.
Disconnected from remote host(my腾讯云) at 16:27:46.
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Tue Nov 10 16:24:48 2015 from 113.128.97.32[root@VM_69_141_centos ~]# cd /etc/sysconfig/[root@VM_69_141_centos sysconfig]# diratd initmodules readonly-rootauditd ip6tablesnetconsole rsyslogauthconfig ip6tables-confignetwork sandboxcbq ip6tables.oldnetwork-scripts saslauthdclock iptablesnetworking selinuxconsole iptables-configntpd sshdfirstboot iptables.oldntpdate system-config-firewallgrub iptables.saveprelink system-config-firewall.oldhtcacheclean irqbalancequota_nld udevhttpd kernelrc.locali18n keyboardreadahead[root@VM_69_141_centos sysconfig]# lltotal 164-rw-r--r--. 1 root root 403 Jan 30 2012 atd-rw-r-----. 1 root root 647 Jun 22 2012 auditd-rw-r--r--. 1 root root 397 Dec 26 2014 authconfigdrwxr-xr-x. 2 root root 4096 Dec 26 2014 cbq-rw-r--r--. 1 root root 21 Dec 26 2014 clockdrwxr-xr-x. 2 root root 4096 Nov 23 2013 console-rw-r--r--. 1 root root 16 Dec 26 2014 firstboot-rw-r--r--. 1 root root 25 Dec 26 2014 grub-rw-r--r-- 1 root root 529 Aug 18 13:57 htcacheclean-rw-r--r-- 1 root root 947 Aug 18 13:57 httpd-rw-r--r--. 1 root root 37 Dec 26 2014 i18n-rw-r--r--. 1 root root 1154 Nov 23 2013 init-rw-------. 1 root root 481 Dec 26 2014 ip6tables-rw-------. 1 root root 1988 Nov 23 2013 ip6tables-config-rw-------. 1 root root 481 Dec 26 2014 ip6tables.old-rw------- 1 root root 420 Nov 9 23:37 iptables-rw-------. 1 root root 1974 Nov 23 2013 iptables-config-rw-------. 1 root root 476 Dec 26 2014 iptables.old-rw------- 1 root root 482 Nov 9 23:37 iptables.save-rw-r--r--. 1 root root 903 Aug 23 2013 irqbalance-rw-r--r--. 1 root root 180 Dec 26 2014 kernel-rw-r--r--. 1 root root 63 Dec 26 2014 keyboarddrwxr-xr-x. 2 root root 4096 Nov 23 2013 modules-rw-r--r--. 1 root root 634 Nov 23 2013 netconsole-rw-r--r--. 1 root root 41 Nov 10 14:45 networkdrwxr-xr-x. 2 root root 4096 Nov 10 14:45 network-scriptsdrwxr-xr-x. 4 root root 4096 Dec 26 2014 networking-rw-r--r-- 1 root root 85 Oct 16 16:55 ntpd-rw-r--r-- 1 root root 167 Oct 16 16:55 ntpdate-rw-r--r--. 1 root root 1477 Dec 26 2014 prelink-rw-r--r--. 1 root root 178 Jun 13 2013 quota_nld-rw-r--r-- 1 root root 36 Nov 10 16:24 rc.local-rw-r--r--. 1 root root 549 Nov 23 2013 readahead-rw-r--r--. 1 root root 659 Nov 23 2013 readonly-root-rw-r--r--. 1 root root 200 Aug 15 2013 rsyslog-rw-r--r--. 1 root root 136 Nov 23 2013 sandbox-rw-r--r--. 1 root root 553 Nov 20 2012 saslauthdlrwxrwxrwx. 1 root root 17 Jan 13 2015 selinux -> ../selinux/config-rw-r-----. 1 root root 438 Nov 23 2013 sshd-rw-------. 1 root root 73 Dec 26 2014 system-config-firewall-rw-------. 1 root root 71 Dec 26 2014 system-config-firewall.old-rw-r--r--. 1 root root 183 Nov 23 2013 udev[root@VM_69_141_centos sysconfig]# rm rc.local rm: remove regular file `rc.local'? y[root@VM_69_141_centos sysconfig]# cd /home/wwwroot/[root@VM_69_141_centos wwwroot]# dirdefault xfrfenxiao[root@VM_69_141_centos wwwroot]# cd xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# dirindex.html[root@VM_69_141_centos xfrfenxiao]# cd ../[root@VM_69_141_centos wwwroot]# rm -rf xfrfenxiao/[root@VM_69_141_centos wwwroot]# svn co svn://127.0.0.1/xfrfenxiao ./xfrfenxiaoAuthentication realm: <svn://127.0.0.1:3690> xfrfenxiaoPassword for 'root': Authentication realm: <svn://127.0.0.1:3690> xfrfenxiaoUsername: lzqPassword for 'lzq':
-----------------------------------------------------------------------ATTENTION! Your password for authentication realm:
<svn://127.0.0.1:3690> xfrfenxiao
can only be stored to disk unencrypted! You are advised to configureyour system so that Subversion can store passwords encrypted, ifpossible. See the documentation for details.
You can avoid future appearances of this warning by setting the valueof the 'store-plaintext-passwords' option to either 'yes' or 'no' in'/root/.subversion/servers'.-----------------------------------------------------------------------Store password unencrypted (yes/no)? yesA xfrfenxiao/install.phpChecked out revision 1.[root@VM_69_141_centos wwwroot]# ls default xfrfenxiao[root@VM_69_141_centos wwwroot]# cd xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# dirinstall.php[root@VM_69_141_centos xfrfenxiao]# cd /home/svn/[root@VM_69_141_centos svn]# dirxfrfenxiao[root@VM_69_141_centos svn]# cd xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# dirREADME.txt conf db format hooks locks[root@VM_69_141_centos xfrfenxiao]# cd hooks/[root@VM_69_141_centos hooks]# dirpost-commit.tmpl post-unlock.tmpl pre-revprop-change.tmplpost-lock.tmpl pre-commit.tmpl pre-unlock.tmplpost-revprop-change.tmpl pre-lock.tmpl start-commit.tmpl[root@VM_69_141_centos hooks]# vi post-commit.tmpl [root@VM_69_141_centos hooks]# vi post-commit [root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# rm post-commitrm: remove regular file `post-commit'? y[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# reboot[root@VM_69_141_centos hooks]# Broadcast message from root@VM_69_141_centos(/dev/pts/1) at 17:10 ...
The system is going down for reboot NOW!
Connection closed by foreign host.
Disconnected from remote host(my腾讯云) at 17:10:30.
Type `help' to learn how to use Xshell prompt.[c:\~]$
Connecting to 115.159.111.242:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Tue Nov 10 16:45:28 2015 from 113.128.97.32[root@VM_69_141_centos ~]# cd /home/svn/xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# dirREADME.txt conf db format hooks locks[root@VM_69_141_centos xfrfenxiao]# cd hooks/[root@VM_69_141_centos hooks]# dirpost-commit post-revprop-change.tmpl pre-lock.tmpl start-commit.tmplpost-commit.tmpl post-unlock.tmpl pre-revprop-change.tmplpost-lock.tmpl pre-commit.tmpl pre-unlock.tmpl[root@VM_69_141_centos hooks]# chmod 0777 post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# chmod 0777 ./post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# ./post-commit A 1.txtUpdated to revision 18.[root@VM_69_141_centos hooks]# cd /home/wwwroot/[root@VM_69_141_centos wwwroot]# dirdefault xfrfenxiao[root@VM_69_141_centos wwwroot]# chmod -r 0777 ./xfrfenxiao/chmod: cannot access `0777': No such file or directory[root@VM_69_141_centos wwwroot]# chmod -R 0777 ./xfrfenxiao/[root@VM_69_141_centos wwwroot]# cd ../[root@VM_69_141_centos home]# dirlost+found svn www wwwlogs wwwroot[root@VM_69_141_centos home]# cd wwwroot/[root@VM_69_141_centos wwwroot]# dirdefault xfrfenxiao[root@VM_69_141_centos wwwroot]# chmod -R 0777 ./xfrfenxiao/[root@VM_69_141_centos wwwroot]# cd /home/svn/xfrfenxiao/[root@VM_69_141_centos xfrfenxiao]# cd /home/[root@VM_69_141_centos home]# cd /home/svn/xfrfenxiao/hooks/[root@VM_69_141_centos hooks]# ls post-commit post-revprop-change.tmpl pre-lock.tmpl start-commit.tmplpost-commit.tmpl post-unlock.tmpl pre-revprop-change.tmplpost-lock.tmpl pre-commit.tmpl pre-unlock.tmpl[root@VM_69_141_centos hooks]# ./ post-commit-bash: ./: is a directory[root@VM_69_141_centos hooks]# . post-commitD 1.txtA 1.txtUpdated to revision 20.[root@VM_69_141_centos xfrfenxiao]# dir 1.txt install.php[root@VM_69_141_centos xfrfenxiao]# cd /home/svn/xfrfenxiao/hooks/[root@VM_69_141_centos hooks]# dirpost-commit post-revprop-change.tmpl pre-lock.tmpl start-commit.tmplpost-commit.tmpl post-unlock.tmpl pre-revprop-change.tmplpost-lock.tmpl pre-commit.tmpl pre-unlock.tmpl[root@VM_69_141_centos hooks]# chmod 0777 ./ post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# rm post-commitrm: remove regular file `post-commit'? [root@VM_69_141_centos hooks]# rm post-commitrm: remove regular file `post-commit'? y[root@VM_69_141_centos hooks]# lspost-commit.tmpl post-unlock.tmpl pre-revprop-change.tmplpost-lock.tmpl pre-commit.tmpl pre-unlock.tmplpost-revprop-change.tmpl pre-lock.tmpl start-commit.tmpl[root@VM_69_141_centos hooks]# vi post-commit [root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# chmod 0777 ./post-commit[root@VM_69_141_centos hooks]# . post-commitD 1.txtA 1.txtUpdated to revision 22.[root@VM_69_141_centos xfrfenxiao]# dir1.txt install.php[root@VM_69_141_centos xfrfenxiao]# cd /home/svn/xfrfenxiao/hooks/[root@VM_69_141_centos hooks]# . post-commitD 1.txtA 1.txtUpdated to revision 24.[root@VM_69_141_centos xfrfenxiao]# dir1.txt install.php[root@VM_69_141_centos xfrfenxiao]# cd /home/svn/xfrfenxiao/hooks/[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# chmod 0777 ./post-commit[root@VM_69_141_centos hooks]# vi post-commit[root@VM_69_141_centos hooks]# vi post-commit
#!/bin/shcd /home/wwwroot/xfrfenxiao//usr/bin/svn cleanup/usr/bin/svn up /home/wwwroot/xfrfenxiao --username "lzq" --password "123456"~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "post-commit" 4L, 138C

浙公网安备 33010602011771号