linux svn客户端通过 https访问windows VisualSVN Server Manager

时间:2022-05-27 20:11:28

1)需求:

已经在阿里云windwos系统 下面安装了VisualSVN Server Manager 做为svn服务器;

现在要在腾讯云源码安装新版本客户端

2)开始源码编译安装TortoiseSVN:

1)卸载当前自动安装的svn

             yum remove subversion

2 )下载依赖包 如下:

1、subversion-1.10.0.zip(http://subversion.apache.org/download/

2、apr-1.6.3.tar.bz2 (http://apr.apache.org/download.cgi)隐藏操作系统细节共享库

3、apr-util-1.6.1.tar.bz2 (http://apr.apache.org/download.cgi

4、serf   (http://serf.apache.org/download)subversion1.8.0之前都是用neon来支持http/https,之后都是用serf来支持的;

5、scons  (https://www.scons.org/pages/download.html)注意:类似于cmake (这个源码安装不好装 直接yum install scons就行了 反正版本差别不大就行)

6、sqlite 3.8.2 (http://www.sqlite.org/download.html)( 这里要是版本号,注意)

7、httpd 2.4.7  (http://httpd.apache.org/)

命令history

3030 2018-06-29 07:41:48 wget http://mirrors.hust.edu.cn/apache/subversion/subversion-1.10.0.tar.gz 
3038 2018-06-29 07:46:20 wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.bz2
3040 2018-06-29 07:55:16 wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.bz2
3044 2018-06-29 08:17:31 wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.33.tar.gz
3047 2018-06-29 08:20:57 wget https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2
3049 2018-06-29 08:23:31 wget https://jaist.dl.sourceforge.net/project/scons/scons/3.0.0/scons-3.0.0.tar.gz
3052 2018-06-29 08:27:14 wget https://www.sqlite.org/2018/sqlite-autoconf-3240000.tar.gz

安装基本的库和工具

yum install gcc gcc-++ make pcre-develzlib-devel openssl openssl-devel pcre pcre-devel -y (因为我己经安装了 gcc g++ make openssl 所以跳过这步)

3)解压下载的包

3056 2018-06-29 08:35:42 tar -jxvf apr-1.6.3.tar.bz2  
3058 2018-06-29 08:35:54 tar -jxvf apr-util-1.6.1.tar.bz2  
3062 2018-06-29 08:36:37 tar -zxvf httpd-2.4.33.tar.gz  
3064 2018-06-29 08:36:54 tar -jxvf serf-1.3.9.tar.bz2  
3066 2018-06-29 08:37:13 tar -zvxf sqlite-autoconf-3240000.tar.gz

4)开始安装

安装 sqlite apr   apr-util

3068 2018-06-29 08:37:57 cd apr-1.6.3/ 
3070 2018-06-29 08:38:02 ./configure --prefix=/usr/local/apr
3071 2018-06-29 08:38:46 make && make install
3075 2018-06-29 08:39:38 cd apr-util-1.6.1/
3076 2018-06-29 08:39:45 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
3077 2018-06-29 08:39:57 make && make install  
在CentOS7最小安装版下,编译安装apr-util时报错:

fatal error: expat.h: No such file or directory

解决办法:yum install expat-devel

3080 2018-06-29 08:42:25 yum install expat-devel
3081 2018-06-29 08:42:37 make && make install

安装 sqlite

3099 2018-06-29 08:48:37 cd sqlite-autoconf-3240000/
3100 2018-06-29 08:48:39 ./configure
3101 2018-06-29 08:49:36 make && make install

 安装 scons

3107  2018-06-29 08:55:28 yum install scons

编译安装serf

3116 2018-06-29 09:01:21 cd serf-1.3.9/
3117 2018-06-29 09:01:35 scons APR=/usr/local/apr APU=/usr/local/apr-util OPENSSL=/usr/bin PREFIX=/usr/local/ser
3118 2018-06-29 09:01:53 scons install

编译安装httpd

./configure --prefix=/usr/local/apache --enable-dav --enable-so-nable-rewrite --enable-maintainer-mode --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

make && make install

今天编译安装apache 2.2 时,到了make后出现如下错误,

make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/usr/local/directadmin/custombuild/httpd-2.0.63/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/directadmin/custombuild/httpd-2.0.63/support'
make: *** [all-recursive] Error 1

解决办法

#mv /usr/lib/libm.a /usr/lib/libm.a.bak 这句 
#ln -s /usr/lib64/libm.a /usr/lib/libm.a 这句

分析

由于我的CENTOS 是 64bit的,在编译配置中并没有指定 --with-included-apr的具体引用路径,导致找不到相应的库文件,而 --with-included-apr 默认是查找/usr/lib下的库文件,而,正确的引用应该是/usr/lib64下的。这类情况在64bit下非常常见,请L友们注意了!

搞不清楚,还是有错,

然后回滚了一下。。。

3122 2018-06-29 09:04:17 ./configure --prefix=/usr/local/apache --enable-dav --enable-so-nable-rewrite --enable-maintainer-mode --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
3123 2018-06-29 09:04:40 make && make install
3124 2018-06-29 09:07:57 mv /usr/lib/libm.a /usr/lib/libm.a.bak 
3128 2018-06-29 09:08:37 ln -s /usr/lib64/libm.a /usr/lib/libm.a
3129 2018-06-29 09:08:47 make && make install  
3133 2018-06-29 09:10:49 mv /usr/lib/libm.a.bak /usr/lib/libm.a
3134 2018-06-29 09:11:22 make && make install

不知什么情况遇到下面情况,因为我的apr版本是1.6 会有这个问题是少库

/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetEntityDeclHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ParserCreate'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetCharacterDataHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ParserFree'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetUserData'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_StopParser'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_Parse'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ErrorString'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetElementHandler'
collect2: error: ld returned 1 exit status
make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/usr/local/httpd-2.4.26/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/httpd-2.4.26/support'
make: *** [all-recursive] Error 1
 
于是乎

3140 2018-06-29 09:16:09 yum install -y libxml2-devel
3141 2018-06-29 09:16:27 cd ..

//删掉己装的/apr-util
3143 2018-06-29 09:16:42 rm -rf /usr/local/apr-util
3144 2018-06-29 09:17:27 cd apr-util-1.6.1/

重新装一遍/apr-util
3145 2018-06-29 09:17:29 make clean
3146 2018-06-29 09:17:48 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
3147 2018-06-29 09:17:58 make && make install

再试试 httpd-2.4.33/
3150 2018-06-29 09:18:32 cd httpd-2.4.33/
3151 2018-06-29 09:18:55 ./configure --prefix=/usr/local/apache --enable-dav --enable-so-nable-rewrite --enable-maintainer-mode --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
3152 2018-06-29 09:19:26 make && make install

httpd-2.4.33 ok了 没报错

接下来安装    subversion   

2955 2018-06-29 09:48:48 tar -zvxf subversion-1.10.0.tar.gz  
2957 2018-06-29 09:48:52 cd subversion-1.10.0/ 
2959 2018-06-29 09:49:20 ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-openssl --with-serf=/usr/local/serf
2960 2018-06-29 09:49:36 make && make install

报错需要先安装 serf-1.3.9
2963 2018-06-29 09:50:47 cd serf-1.3.9/ 
2965 2018-06-29 09:51:11 scons APR=/usr/local/apr APU=/usr/local/apr-util OPENSSL=/usr/bin PREFIX=/usr/local/serf
2966 2018-06-29 09:51:49 scons install

再试 subversion 报错
2970 2018-06-29 09:52:35 cd subversion-1.10.0/  
2986 2018-06-29 09:55:19 ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-openssl --with-serf=/usr/local/serf
2987 2018-06-29 09:55:33 make && make install

报错原因是没有 --with-lz4库 要手动指定一下选项  --with-lz4=internal 再试 subversion 
2989 2018-06-29 09:56:07 make clean 
2991 2018-06-29 10:00:46 ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-openssl --with-serf=/usr/local/serf --with-lz4=internal
2992 2018-06-29 10:01:15 make && make install

报错原因是没有 --with-utf8proc库 要手动指定一下选项  ---with-utf8proc=internal  ( with-utf8proc=internal:如果您安装了可选的依赖关系,请将其删除。) 再试 subversion 
2993 2018-06-29 10:01:24 ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-openssl --with-serf=/usr/local/serf --with-lz4=internal
2994 2018-06-29 10:05:06 yum install utf8proc  也没用 必须 internal

3050 2018-06-29 18:01:20 ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-openssl=/usr/local/ssl --with-serf=/usr/local/serf --with-lz4=internal --with-utf8proc=internal
3053 2018-06-29 18:01:55 make clean
3054 2018-06-29 18:01:58 make
3055 2018-06-29 18:07:54 make install

subversion 安装成功

拷贝依赖的动态库

3059 2018-06-29 18:08:51 cd serf-1.3.9/ 
3061 2018-06-29 18:09:51 cp libserf-1.so.1 /usr/local/subversion/lib/

添加环境变量
3062 2018-06-29 18:10:10 vim /etc/profile 行尾加上

export PATH=/usr/local/subversion/bin/:${PATH}

立即生效

.  /etc/profile

svn -version 

成功看到输出信息

[root@VM_162_1_centos subversion]# svn --version
svn, version 1.10.0 (r1827917)
compiled Jun 29 2018, 18:02:41 on x86_64-unknown-linux-gnu

Copyright (C) 2018 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
- using serf 1.3.9 (compiled with 1.3.9)
- handles 'http' scheme
- handles 'https' scheme

The following authentication credential caches are available:

* Plaintext cache in /root/.subversion
* GPG-Agent

[root@VM_162_1_centos subversion]#

到这就源码安装完成了

 
 
3)发现在centos 7.5 下面 sqlite3 是低版本的,通过源码安装之后 再运行 报错了
                  SQLite compiled for 3.24.0, but running with 3.7.17
         自己编译安装的是 3.24 以前自带的是 3.7 
         而编译subversion 的时候己经源码安装了 3.24.0 引用的是 3.24.0的头文
      但是不知道是 sqlite3 源码安装错了还是怎么回事(没有报错,但是sqlite3都没有拷到 use/bin目录,是我手动拷的,拷完还是不行)
      拷完之后执行 sqlite3 --version 版本就变正确了但还是报          SQLite compiled for 3.24.0, but running with 3.7.17 重启也不行
      也许是环境变量的问题?有可能是之前某个地方用到了原来的 3.7.17 的东西,再到 /etc/profile 或者说没 依赖/etc/profile。
 
    最后还是没有解决
 
4 最后还是不要用源码安装了 
       不用源码安装  用默认的版本 yum install svn  
       svn --version 
 

[root@VM_162_1_centos svntest]# svn --version
svn, version 1.7.14 (r1542130)
compiled Apr 11 2018, 02:40:28

Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme

[root@VM_162_1_centos svntest]#

好吧,测试了 yum install 出来的 1.7.14,能用。

3010 2018-06-29 21:07:29 svn co https://(公网ip):443/svn/myCode/branches/game . --username usss 
3015 2018-06-29 21:08:43 ll >> info 
3017 2018-06-29 21:09:15 svn add info  
3027 2018-06-29 21:13:46 svn update 
3033 2018-06-29 21:15:36 svn ci info -m"test"

弄了半天是白拆腾

原来之前就是可以用的 只不过提示 接受https 证书时提示不安全要求输入p继续。然后就可以了。。。不过好像  httpd 2.4.7 装了是有用的。不管它了,现在svn 能工作就行了。