先记下, 公司现在用的是svn服务器. 我也搭一个.
资料:
官方下载:
更多客户端和工具可以看下表或者到官方网站察看:http://subversion.tigris.org/links.zh.html#clients
download url:
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74
source code:
http://subversion.tigris.org/downloads/subversion-1.6.16.tar.bz2
搭建资料:
http://blogold.chinaunix.net/u/13177/showart_507636.html
svn 源码编译需要支持软件 svn-dep
http://anynote.org/index.php/archives/141
安装db-5.1.25.tar.gz
http://blogold.chinaunix.net/u4/120903/showart_2383378.html
安装svn完整过程
http://www.ws-school.cn/blog/37.html(基本按照这个攻略来)
http://bbs.iusesvn.com/viewthread.php?tid=4899
subversion-1.6.16搭配最新的/BerkeleyDB.5.1不行, 支持到DB4.7.25.
BerkeleyDB历史版本下载索引
http://www.siutung.org/post/480/
DB4.7.25的下载点:
http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz
安装httpd-2.2.17之前,先卸掉centos中自带的httpd
svn安装后的配置:
http://blog.51yip.com/server/901.html
<2011_0611>
svn安装程序
http://subversion.apache.org/packages.html
CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz (for CentOS 5)
Linux下安装jdk.
http://flyer2010.iteye.com/blog/658064
svnServer搭建完成, 管理UI操作很方便.
CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
jdk-6u20-linux-i586-rpm.bin
Python-2.6.tar.bz2
Python 2.4 ~ 2.6
改变SSH字符集为中文
export LANG=zh_CN
用<SSH Secure Shell Client>把安装文件传到/usr/local/src
python –V /**< 查看python版本 */
[root@ls src]# python -V
Python 2.4.3
[root@ls src]# tar -xvfPython-2.6.tar.bz2
[root@ls src]# cdPython-2.6
[root@ls Python-2.6]#./configure
[root@ls Python-2.6]#make install
[root@ls Python-2.6]#python
Python 2.4.3 (#1, May 242008, 13:47:28)
[GCC 4.1.2 20070626 (RedHat 4.1.2-14)] on linux2
Type "help","copyright", "credits" or "license" for moreinformation.
>>>
[root@ls Python-2.6]#
[root@ls bin]# ll |greppython
-rwxr-xr-x 2 rootroot 5632 2008-05-25 python
lrwxrwxrwx 1 rootroot 6 03-05 17:11 python2-> python
-rwxr-xr-x 2 rootroot 5632 2008-05-25 python2.4
[root@ls bin]# rm -rfpython
再查看python时, 已经看不到python了
[root@ls bin]# python
-bash: /usr/bin/python: 没有那个文件或目录
[root@ls bin]# ln -s/usr/local/src/Python-2.6/python ./python
现在已经升级到python2.6
[root@ls bin]# python -V
Python 2.6
[root@ls bin]# python
Python 2.6 (r26:66714,Jun 12 2011, 06:34:32)
[GCC 4.1.2 20071124 (RedHat 4.1.2-42)] on linux2
Type "help","copyright", "credits" or "license" for moreinformation.
>>>
[root@ls bin]#
卸载OS自带的java
whereis python
[root@ls src]# whereispython
python:/usr/bin/python2.4 /usr/bin/python /usr/lib/python2.4 /usr/local/bin/python2.6/usr/local/bin/python2.6-config /usr/local/bin/python /usr/local/lib/python2.6/usr/include/python2.4 /usr/share/man/man1/python.1.gz
Yum用的python版本是2.4
#vim /usr/bin/yum
修改第一行
#!/usr/bin/python
为
#!/usr/bin/python2.4
yum remove jdk
[root@ls ~]# yum removejdk
Setting up Remove Process
Resolving Dependencies
--> Runningtransaction check
---> Package jdk.i5862000:1.6.0_20-fcs set to be erased
--> FinishedDependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
jdk i586 2000:1.6.0_20-fcs installed 141 M
Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 1 Package(s)
Is this ok [y/N]:
改变安装文件属性为可执行
[root@ls src]# chmod 777./jdk-6u20-linux-i586-rpm.bin
[root@ls src]#./jdk-6u20-linux-i586-rpm.bin
Please enter"yes" or "no".
Do you agree to the abovelicense terms? [yes or no]
Y
[root@ls src]# ls
CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
jdk-6u20-linux-i586.rpm
jdk-6u20-linux-i586-rpm.bin
Python-2.6
Python-2.6.tar.bz2
sun-javadb-client-10.5.3-0.2.i386.rpm
sun-javadb-common-10.5.3-0.2.i386.rpm
sun-javadb-core-10.5.3-0.2.i386.rpm
sun-javadb-demo-10.5.3-0.2.i386.rpm
sun-javadb-docs-10.5.3-0.2.i386.rpm
sun-javadb-javadoc-10.5.3-0.2.i386.rpm
改变解压后的jdk的rpm为可执行
[root@ls src]# chmod 777jdk-6u20-linux-i586.rpm
安装jdk的rpm
[root@ls src]# rpm -ivh./jdk-6u20-linux-i586.rpm
[root@ls src]# java-version
java version"1.6.0_20"
Java(TM) SE RuntimeEnvironment (build 1.6.0_20-b02)
Java HotSpot(TM) ClientVM (build 16.3-b01, mixed mode, sharing)
[root@ls java]# whereisjava
java: /usr/bin/java/usr/share/java
[root@ls java]# ll/usr/bin/java
lrwxrwxrwx 1 root root 26Jun 12 07:40 /usr/bin/java -> /usr/java/default/bin/java
[root@ls java]# ls/usr/java/
default jdk1.6.0_20 latest /**< java 被安装到/usr/java中 */
JAVA_HOME的路径
[root@ls default]# pwd
/usr/java/default
[root@ls default]# vim/etc/profile
在文件末尾添加java_home环境变量
exportJAVA_HOME='/usr/java/default'
让配置文件立刻生效
[root@lsbin]# source /etc/profile
测试环境变量
[root@lsbin]# $JAVA_HOME
-bash:/usr/java/default: is a directory
$JAVA_HOME/bin/java -version
[root@ls src]# tar -xvf./CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
改变目录到/usr/local/src/csvn/bin
[root@ls bin]# pwd
/usr/local/src/csvn/bin
[root@ls bin]# vi../data/conf/csvn.conf
安装svn server
[root@ls bin]# ./csvninstall
启动svn server
[root@ls bin]# ./csvnstart
重新启动svn server所在的计算机
访问svn server管理页, 所有操作都有GUI
http://IP:3343/csvn
用户名:admin
口令: admin
进入后,更改Svn Server链接方式为https.
安装Python
http://linux.chinaunix.net/techdoc/system/2008/08/29/1028631.shtml
安装jdk
http://flyer2010.iteye.com/blog/658064
http://28680360-qq-com.iteye.com/blog/764499
修改yum的python配置
http://hi.baidu.com/2311/blog/item/e7f8972fc235bc361f3089b0.html
安装CollabNetSubVersion
http://blog.csdn.net/robertkun/archive/2010/10/20/5954977.aspx
让/etc/profile文件修改后立即生效
http://uyghur.xjkunlun.gov.cn/10016/10023/10081/10001/2010/1250831.htm
PDF版本的svnServer搭建文档上传在:
http://download.csdn.net/source/3359243
<2011_0612>
更改为https之后的管理页url:
https://IP:4434/csvn/server/index
<2011_0622>
终于配置成功了, 过程有些乱,还没整理。
不过我相信,我下次按照这个说明,能很快的搭建一个能用的svnServer.
CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
jdk-6u20-linux-i586-rpm.bin
Python-2.6.tar.bz2
Python 2.4 ~ 2.6
改变SSH字符集为中文
export LANG=zh_CN
用<SSH Secure Shell Client>把安装文件传到/usr/local/src
python –V /**< 查看python版本 */
[root@ls src]# python -V
Python 2.4.3
[root@ls src]# tar -xvfPython-2.6.tar.bz2
[root@ls src]# cdPython-2.6
[svnroot@ls Python-2.6]$ ./configure --help|grep share
--sharedstatedir=DIR modifiable architecture-independent data[PREFIX/com]
--datarootdir=DIR read-only arch.-independent data root[PREFIX/share]
--enable-shared disable/enable building shared pythonlibrary
[svnroot@ls Python-2.6]$sudo -u root ./configure --enable-shared
[svnroot@ls Python-2.6]$sudo -u root make
[svnroot@ls Python-2.6]$sudo -u root make install
安装完毕后,可以看到 /usr/local/lib/libpython2.6.so.1.0
[root@ls Python-2.6]#python
Python 2.4.3 (#1, May 242008, 13:47:28)
[GCC 4.1.2 20070626 (RedHat 4.1.2-14)] on linux2
Type "help","copyright", "credits" or "license" for moreinformation.
>>>
[root@ls Python-2.6]#
[root@ls bin]# ll |greppython
-rwxr-xr-x 2 rootroot 5632 2008-05-25 python
lrwxrwxrwx 1 rootroot 6 03-05 17:11 python2-> python
-rwxr-xr-x 2 root root 5632 2008-05-25 python2.4
[root@ls bin]# rm -rfpython
再查看python时, 已经看不到python了
[root@ls bin]# python
-bash: /usr/bin/python: 没有那个文件或目录
[root@ls bin]# ln -s/usr/local/src/Python-2.6/python ./python
现在已经升级到python2.6
[root@ls bin]# python -V
Python 2.6
[root@ls bin]# python
Python 2.6 (r26:66714,Jun 12 2011, 06:34:32)
[GCC 4.1.2 20071124 (RedHat 4.1.2-42)] on linux2
Type "help","copyright", "credits" or "license" for moreinformation.
>>>
[root@ls bin]#
卸载OS自带的java
whereis python
[root@ls src]# whereispython
python:/usr/bin/python2.4 /usr/bin/python /usr/lib/python2.4 /usr/local/bin/python2.6/usr/local/bin/python2.6-config /usr/local/bin/python /usr/local/lib/python2.6/usr/include/python2.4 /usr/share/man/man1/python.1.gz
Yum用的python版本是2.4
#vim /usr/bin/yum
修改第一行
#!/usr/bin/python
为
#!/usr/bin/python2.4
yum remove jdk
[root@ls ~]# yum removejdk
Setting up Remove Process
Resolving Dependencies
--> Runningtransaction check
---> Package jdk.i5862000:1.6.0_20-fcs set to be erased
--> FinishedDependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
jdk i586 2000:1.6.0_20-fcs installed 141 M
Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 1 Package(s)
Is this ok [y/N]:
改变安装文件属性为可执行
[root@ls src]# chmod 777./jdk-6u20-linux-i586-rpm.bin
[root@ls src]#./jdk-6u20-linux-i586-rpm.bin
Please enter"yes" or "no".
Do you agree to the abovelicense terms? [yes or no]
Y
[root@ls src]# ls
CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
jdk-6u20-linux-i586.rpm
jdk-6u20-linux-i586-rpm.bin
Python-2.6
Python-2.6.tar.bz2
sun-javadb-client-10.5.3-0.2.i386.rpm
sun-javadb-common-10.5.3-0.2.i386.rpm
sun-javadb-core-10.5.3-0.2.i386.rpm
sun-javadb-demo-10.5.3-0.2.i386.rpm
sun-javadb-docs-10.5.3-0.2.i386.rpm
sun-javadb-javadoc-10.5.3-0.2.i386.rpm
改变解压后的jdk的rpm为可执行
[root@ls src]# chmod 777jdk-6u20-linux-i586.rpm
安装jdk的rpm
[root@ls src]# rpm -ivh./jdk-6u20-linux-i586.rpm
[root@ls src]# java-version
java version"1.6.0_20"
Java(TM) SE RuntimeEnvironment (build 1.6.0_20-b02)
Java HotSpot(TM) ClientVM (build 16.3-b01, mixed mode, sharing)
[root@ls java]# whereisjava
java: /usr/bin/java/usr/share/java
[root@ls java]# ll/usr/bin/java
lrwxrwxrwx 1 root root 26Jun 12 07:40 /usr/bin/java -> /usr/java/default/bin/java
[root@ls java]# ls/usr/java/
default jdk1.6.0_20 latest /**< java 被安装到/usr/java中 */
JAVA_HOME的路径
[root@ls default]# pwd
/usr/java/default
[root@ls default]# vim/etc/profile
在文件末尾添加java_home环境变量
export JAVA_HOME='/usr/java/default'
让配置文件立刻生效
[root@ls bin]#source /etc/profile
测试环境变量
[root@ls bin]#$JAVA_HOME
-bash:/usr/java/default: is a directory
$JAVA_HOME/bin/java -version
[root@ls src]# tar -xvf ./CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
改变目录到/usr/local/src/csvn/bin
[root@ls bin]# pwd
/usr/local/src/csvn/bin
[root@ls bin]# vi../data/conf/csvn.conf
安装svn server
[root@ls bin]# ./csvninstall
启动svn server
[root@ls bin]# ./csvnstart
重新启动svn server所在的计算机
访问svn server管理页, 所有操作都有GUI
http://IP:3343/csvn
用户名:admin
口令: admin
进入后,更改Svn Server链接方式为https.
忘了口令,可以在服务器端重设口令.
[root@ls bin]# htpasswd-n admin
New password:
Re-type new password:
admin:MB7uQ2BNMvpw6
[root@ls ~]# useraddsvnroot
[root@ls ~]# passwdsvnroot
口令设置成svnroot
[root@ls bin]# su –svnroot
[svnroot@ls src]$ chown svnroot:svnroot./CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
[root@ls src]# chmod 777./CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
[svnroot@ls src]$ cp./CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz /home/svnroot/
[svnroot@ls src]$ cd/home/svnroot/
[svnroot@ls ~]$ ll
-rwxrwxr-x 1 svnrootsvnroot 74252962 Jun 21 16:55 CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
[svnroot@ls ~]$ tar -xzvf./CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
[svnroot@ls ~]$ ll
total 72596
-rwxrwxr-x 1 svnroot svnroot 74252962 Jun 21 16:55CollabNetSubversionEdge-1.3.3_linux-x86.tar.gz
drwxrwxr-x 11 svnrootsvnroot 4096 Jun 1 02:52 csvn
[svnroot@ls conf]$ vi./csvn-wrapper.conf
切换到root用户下, 改变/opt权限到svnroot
[svnroot@ls csvn]$ sudo-e bin/csvn install
Svn 用户加入sudo组
首需要切换到root身份
$su -
(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)
然后
$visudo //切记,此处没有vi和sudo之间没有空格
1、移动光标,到最后一行
2、按a,进入append模式
3、输入
your_user_name ALL=(ALL) ALL
4、按Esc
5、输入“:w”(保存文件)
6、输入“:q”(退出)
这样就把自己加入了sudo组,可以使用sudo命令了。
在svnroot下以root权限安装csvn
[svnroot@ls csvn]$ sudo-u root bin/csvn install
[root@ls ~]# chown root:svnroot/home/svnroot/csvn/lib/httpd_bind/httpd_bind
[root@ls ~]# chmod 777/home/svnroot/csvn/lib/httpd_bind/httpd_bind
[root@ls ~]# su – svnroot
[svnroot@ls csvn]$ pwd
/home/svnroot/csvn
[svnroot@ls csvn]$bin/csvn start
Starting CSVNConsole.....
CSVN Console started
Waiting for applicationto initialize (this may take a minute).................................................
CSVN Console is ready at http://localhost:3343/csvn
[root@ls ~]# find / -name'mod_python.so*'
/home/svnroot/csvn/lib/modules/mod_python.so.2.5
/home/svnroot/csvn/lib/modules/mod_python.so.2.6
/home/svnroot/csvn/lib/modules/mod_python.so.2.4
/home/svnroot/csvn/lib/modules/mod_python.so.2.7
[root@ls modules]# cp./mod_python.so.2.6 mod_python.so
[root@ls modules]# chownsvnroot:svnroot mod_python.so
Apache的网页管理程序无法启动csvn服务端, 卸载csvn, 安装csvn-httpd
[svnroot@ls bin]$ sudo -uroot ./csvn remove
Password:
Sorry, try again.
Password:
Stopping CSVN Console...
Stopped CSVN Console.
Detected RHEL or Fedora:
Removing CSVN Console daemon...
[svnroot@ls bin]$ sudo -uroot ./csvn-httpd install
[svnroot@ls src]$ sudo -u root ln -s/usr/local/src/Python-2.6/libpython2.6.so.1.0 /usr/lib/libpython2.6.so
[svnroot@ls bin]$ sudo-u root ./csvn-httpd start
[svnroot@ls bin]$sudo -u root ./csvn-httpd start
Starting SubversionEdge Apache Server: [ OK ]
[svnroot@ls bin]$sudo -u root ./csvn install
[svnroot@ls bin]$sudo -u root ./csvn start
http://192.168.1.201:3343/csvn/
这回能看到svn库了~
安装包自带的readme和网上找到的资料,与自己搭建细节上有很多不同,有些细节在文档上根本不曾提及。比如说:要启动csvn-httpd.
不花钱的东西没有服务,很闹心. 不过通过多次实验弄成能用的版本,也很开心.
下一步整理文档, 进行权限控制.
最主要的参考资料:
CollabNetSubversionEdge在Linux操作系统下安装
http://www.linuxidc.com/Linux/2011-04/33979.htm
安装Python
http://linux.chinaunix.net/techdoc/system/2008/08/29/1028631.shtml
安装jdk
http://flyer2010.iteye.com/blog/658064
http://28680360-qq-com.iteye.com/blog/764499
修改yum的python配置
http://hi.baidu.com/2311/blog/item/e7f8972fc235bc361f3089b0.html
安装CollabNetSubVersion
http://blog.csdn.net/robertkun/archive/2010/10/20/5954977.aspx
让/etc/profile文件修改后立即生效
http://uyghur.xjkunlun.gov.cn/10016/10023/10081/10001/2010/1250831.htm
linux下用useradd建立用户的命令格式
http://blogold.chinaunix.net/u1/59646/showart_465892.html
找不到libpython2.6.so的处理方法
http://hi.baidu.com/hiweirdo/blog/item/50dbfe13ed9393c3c2fd782c.html
服务器配置python时一些问题的处理方法
http://blog.csdn.net/Bluesky_Leon/archive/2011/02/22/6200119.aspx
<2011_0703>
有时输入 http://192.168.1.201:3343/csvn/, 不能正常访问. 此时, 客户端已经可以正常从库内迁入迁出.
[svnroot@ls bin]$ sudo -u root ./csvn-httpd restart
重启动csvn-httpd, 显示重启动成功, 也不能正常访问,
重新安装csvn-httpd, 也不能正常访问。 怀疑是CollabNetSubversionEdge的Bug.
尝试访问以前见过的库列表URL, 可以重新访问csvn管理页面.
http://192.168.1.201:3343/csvn/repo/list