51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1502|回复: 0
打印 上一主题 下一主题

Bugzilla | SVN 升级记录

[复制链接]
  • TA的每日心情
    无聊
    昨天 09:08
  • 签到天数: 531 天

    连续签到: 1 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2018-12-20 14:00:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    为了修复安全问题,升级OS由REDHAT 5.4到5.11

    1 下载安装apr-1.5.2.tar和apr-util-1.5.4.tar
    1. [root@svnsubv apr-1.5.2]# ./configure --prefix=/usr/local/apr
    2. 省略
    3. [root@svnsubv apr-1.5.2]# make
    4. [root@svnsubv apr-1.5.2]# make install

    5. [root@svnsubv apr-1.5.2]# /usr/local/apr/bin/apr-1-config --version
    6. 1.5.2
    7. [root@svnsubv apr-1.5.2]#
    8. [root@svnsubv apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
    9. [root@svnsubv apr-util-1.5.4]# make
    10. [root@svnsubv apr-util-1.5.4]# make install

    11. [root@svnsubv apr-util-1.5.4]# /usr/local/apr-util/bin/apu-1-config --version
    12. 1.5.4
    13. [root@svnsubv apr-util-1.5.4]#
    复制代码

    2 安装OpenSSL,版本openssl-1.0.2h。
    保留旧版本的OpenSSL。
    1. config运行后有make depend的提示,所以增加了make depend的操作,之后再做make | make install
    2. ./config shared zlib --prefix=/usr/local/openssl
    3. make depend
    4. make
    5. make install
    复制代码

    这里注意umask需要设置为0022。我安装时没注意是0077,安装后OpenSSL的文件权限有问题,改之。
    安装在/usr/local/openssl/bin/openssl,而/usr/bin/openssl是老的版本,将老版本替换为新版本。
    1. cp /usr/local/openssl/bin/openssl /usr/bin/openssl
    复制代码

    这里在config后提示做make depend操作。在Linux下编译安装软件的命令执行顺序是:
    config -> make depend -> make -> make install
    这里有个问题,第一次安装时使用的如下命令:
    1. ./config --prefix=/usr/local --openssldir=/usr/local/openssl
    复制代码

    这个的结果是导致安装HTTPD时,发生如下错误。尝试很多方案都无法修复。所以重新安装OpenSSL,不再使用--openssldir参数。

    3 安装HTTPD。
    首先设置环境变量:
    export LDFLAGS=-ldl


    然后开始编译安装:
    1. ./configure --prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd/ --with-included-apr --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config --enable-dav --enable-so --enable-maintainer-mode --enable-ssl=static --with-ssl=/usr/local/openssl
    2. make
    3. make install
    复制代码

    4 安装Subversion。

    两种报错:

    <1> 在httpd中找不到libssl.so.1.0.0和libcrypto.so.1.0.0
    1. checking for unistd.h... yes
    2. configure: serf library configuration via pkg-config
    3. checking for serf-2 library... no
    4. checking for serf-1 library... no
    5. checking was serf enabled... no
    复制代码
    1. An appropriate version of serf could not be found, so libsvn_ra_serf
    2. will not be built.  If you want to build libsvn_ra_serf, please
    3. install serf 1.3.4 or newer.
    复制代码
    1. configure: looking for apr_memcache as part of apr-util
    2. checking apr_memcache.h usability... yes
    3. checking apr_memcache.h presence... yes
    4. checking for apr_memcache.h... yes
    5. checking for apr_memcache_create in -laprutil-1... yes
    6. checking for Apache module support via DSO through APXS... /usr/local/apache2//bin/httpd: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
    7. apxs:Error: Sorry, no shared object support for Apache.
    8. apxs:Error: available under your platform. Make sure.
    9. apxs:Error: the Apache module mod_so is compiled into.
    10. apxs:Error: your server binary `/usr/local/apache2//bin/httpd'..
    11. configure: error: no - APXS refers to an old version of Apache
    12. Unable to locate /mod_dav.h
    复制代码

    解决方法:
    1. [root@svnsubv lib]# pwd
    2. /usr/local/apache2/lib
    3. [root@svnsubv lib]# ln -s /usr/local/openssl/lib/libssl.so.1.0.0 libssl.so.1.0.0
    4. [root@svnsubv lib]# ln -s /usr/local/openssl/lib/libcrypto.so.1.0.0 libcrypto.so.1.0.0
    5. <2> 报缺少SQLite,其实是SQLite版本太低。
    6. checking sqlite3.h presence... yes
    7. checking for sqlite3.h... yes
    8. checking sqlite library version (via header)... unsupported SQLite version
    9. checking sqlite library version (via pkg-config)... none or unsupported 3.3
    10. no

    11. An appropriate version of sqlite could not be found.  We recommmend
    12. 3.7.15.1, but require at least 3.7.12.
    13. Please either install a newer sqlite on this system

    14. or

    15. get the sqlite 3.7.15.1 amalgamation from:
    16. http://www.sqlite.org/sqlite-amalgamation-3071501.zip
    17. unpack the archive using unzip and rename the resulting
    18. directory to:
    19. /root/subversion-1.9.4/sqlite-amalgamation

    20. configure: error: Subversion requires SQLite


    21. [root@svnsubv lib]# rpm -qa|grep -i SQLite
    22. sqlite-3.3.6-7
    23. sqlite-devel-3.3.6-7
    24. python-sqlite-1.1.7-1.2.1
    25. sqlite-3.3.6-7
    26. [root@svnsubv lib]#
    复制代码

    安装sqlite:
    ./configure --prefix=/usr/local/sqlite
    make
    make install

    再次安装subversion:
    ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs  --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-sqlite=/usr/local/sqlite --with-openssl
    make
    make install

    5 升级Bugzilla到4.4.12
    进入/opt/bugzilla-4.4.12。
    1. [root@svnsubv bugzilla-4.4.12]# ./checksetup.pl
    2. Can't locate version.pm in @INC (@INC contains: . lib /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8) at Bugzilla/Install/Requirements.pm line 17.
    3. BEGIN failed--compilation aborted at Bugzilla/Install/Requirements.pm line 17.
    4. Compilation failed in require at ./checksetup.pl line 26.
    5. BEGIN failed--compilation aborted at ./checksetup.pl line 26.
    6. [root@svnsubv bugzilla-4.4.12]#
    复制代码

    解决:
    1. [root@svnsubv bugzilla-4.4.12]# cpan
    2. Terminal does not support AddHistory.

    3. cpan shell -- CPAN exploration and modules installation (v1.7602)
    4. ReadLine support available (try 'install Bundle::CPAN')

    5. cpan>o conf http_proxy http://10.99.93.33:8080/

    6. #省略......

    7. cpan> install version
    8. CPAN: Storable loaded ok
    9. Going to read /root/.cpan/Metadata
    10. Database was generated on Wed, 03 Feb 2016 03:53:49 GMT
    11. CPAN: LWP::UserAgent loaded ok
    12. Fetching with LWP:

    13. #省略......

    14. Installing /usr/share/man/man3/version.3pm
    15. Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/version/.packlist
    16. Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
    17. /usr/bin/make install  -- OK

    18. cpan>
    复制代码

    再次运行./checkout.pl。
    或者运行:perl install-module.pl --all

    注意可能需要在cpan中设置代理。
    接下来修改localconfig(两个属性),然后再跑checksetup.pl。

    下面几个与AD有关:
    • 'LDAPBaseDN' => 'OU=User Accounts,DC=lenovo,DC=com',
    • 'LDAPbinddn' => 'CN=adplm,OU=Service Accounts,DC=lenovo,DC=com:ZpGf-5494',
    • 'LDAPserver' => 'ldap://lenovo.com:389',
    • 'LDAPuidattribute' => 'cn',
    • 'user_verify_class' => 'LDAP',
    (这时可以修改CollabnetSubversion的配置文件)

    6 升级svnmanager到1.10。
    解压,然后将老版本的config.php文件复制到新版本下。
    修改http的配置。
    修改svnmanager/MainModule/StartPage.tpl模板文件,这是Jun Li写的介绍。

    7 升级PHP到最新的5.6.22。
    1. ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --enable-embedded-mysqli --with-zlib --with-pear --enable-mbstring
    2. make
    3. make install
    复制代码

    8 配置HTTPD的参数。
    /etc/httpd/conf/httpd.conf。
    1. LoadModule  php5_module  modules/libphp5.so
    2. User csvn
    3. Group csvn
    4. <IfModule dir_module>
    5. DirectoryIndex index.php index.cgi index.html
    6. </IfModule>
    7. AddType application/x-httpd-php .php .phtml
    8. <Directory "/opt/bugzilla-4.4.12">
    9. AddHandler cgi-script .cgi
    10. Options Indexes ExecCGI FollowSymLinks
    11. #    SetEnv PERL5LIB /opt/bugzilla-4.4.11:/opt/bugzilla-4.4.11/lib
    12. DirectoryIndex index.cgi
    13. AllowOverride None
    14. Order allow,deny
    15. Allow from all
    16. </Directory>
    17. Include /etc/httpd/extra/httpd-vhosts.conf
    18. Include /etc/httpd/extra/httpd-ssl.conf
    19. Include /etc/httpd/subversion.conf
    20. Include /etc/httpd/svnmanager.conf
    21. extra/httpd-vhosts.conf
    22. <VirtualHost *:80>
    23. RewriteEngine On
    24. RewriteCond %{SERVER_PORT} !^443$
    25. RewriteRule ^(.*)?$ https://%{SERVER_NAME}$1 [L,R]
    26. # RewriteBase /
    27. # RewriteCond %{SERVER_PORT} 443
    28. # RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
    29. </VirtualHost>
    30. extra/httpd-ssl.conf
    31. SSLCertificateFile "/etc/httpd/extra/server.crt"
    32. SSLCertificateKeyFile "/etc/httpd/extra/server.key"
    33. SSLCertificateChainFile "/etc/httpd/extra/server.crt"
    34. subversion.conf
    35. <Location /svn>
    36. DAV svn
    37. SVNParentPath /data/svn/svnroot/
    38. AuthType Basic
    39. AuthName "Subversion repository"
    40. AuthUserFile /data/svn/svnauth/svn_auth_file
    41. AuthzSVNAccessFile /data/svn/svnauth/svn_access_file
    42. Satisfy Any
    43. Require valid-user
    44. #SSLRequireSSL
    45. </Location>
    46. svnmanager.conf
    47. Alias /svnmanager/ "/opt/svnmanager-1.10/"

    48. <Directory "/opt/svnmanager-1.10/">
    49. AllowOverride none
    50. #   Options Indexes FollowSymLinks
    51. Order allow,deny
    52. Allow from all
    53. </Directory>
    54. HTTPD运行报错:
    55. [root@svnsubv bin]# ./apachectl start
    56. httpd: Syntax error on line 58 of /etc/httpd/httpd.conf: Cannot load /usr/local/subversion/libexec/mod_dav_svn.so into server: /usr/local/subversion/lib/libsvn_subr-1.so.0: undefined symbol: sqlite3_clear_bindings
    57. [root@svnsubv bin]# ll /usr/local/subversion/libexec/mod_dav_svn.so
    58. -rwxr-xr-x 1 root root 804628 May 27 16:22 /usr/local/subversion/libexec/mod_dav_svn.so
    59. [root@svnsubv bin]#
    复制代码

    出现这个问题的原因是因为sqlite3的包是旧的,用新的替换即可。




    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-27 00:31 , Processed in 0.074246 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表