TA的每日心情 | 无聊 昨天 09:08 |
---|
签到天数: 531 天 连续签到: 1 天 [LV.9]测试副司令
|
为了修复安全问题,升级OS由REDHAT 5.4到5.11
1 下载安装apr-1.5.2.tar和apr-util-1.5.4.tar- [root@svnsubv apr-1.5.2]# ./configure --prefix=/usr/local/apr
- 省略
- [root@svnsubv apr-1.5.2]# make
- [root@svnsubv apr-1.5.2]# make install
- [root@svnsubv apr-1.5.2]# /usr/local/apr/bin/apr-1-config --version
- 1.5.2
- [root@svnsubv apr-1.5.2]#
- [root@svnsubv apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
- [root@svnsubv apr-util-1.5.4]# make
- [root@svnsubv apr-util-1.5.4]# make install
- [root@svnsubv apr-util-1.5.4]# /usr/local/apr-util/bin/apu-1-config --version
- 1.5.4
- [root@svnsubv apr-util-1.5.4]#
复制代码
2 安装OpenSSL,版本openssl-1.0.2h。
保留旧版本的OpenSSL。
- config运行后有make depend的提示,所以增加了make depend的操作,之后再做make | make install
- ./config shared zlib --prefix=/usr/local/openssl
- make depend
- make
- make install
复制代码
这里注意umask需要设置为0022。我安装时没注意是0077,安装后OpenSSL的文件权限有问题,改之。
安装在/usr/local/openssl/bin/openssl,而/usr/bin/openssl是老的版本,将老版本替换为新版本。
- cp /usr/local/openssl/bin/openssl /usr/bin/openssl
复制代码
这里在config后提示做make depend操作。在Linux下编译安装软件的命令执行顺序是:
config -> make depend -> make -> make install
这里有个问题,第一次安装时使用的如下命令:
- ./config --prefix=/usr/local --openssldir=/usr/local/openssl
复制代码
这个的结果是导致安装HTTPD时,发生如下错误。尝试很多方案都无法修复。所以重新安装OpenSSL,不再使用--openssldir参数。
3 安装HTTPD。
首先设置环境变量:
export LDFLAGS=-ldl
然后开始编译安装:
- ./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
- make
- make install
复制代码
4 安装Subversion。
两种报错:
<1> 在httpd中找不到libssl.so.1.0.0和libcrypto.so.1.0.0
- checking for unistd.h... yes
- configure: serf library configuration via pkg-config
- checking for serf-2 library... no
- checking for serf-1 library... no
- checking was serf enabled... no
复制代码- An appropriate version of serf could not be found, so libsvn_ra_serf
- will not be built. If you want to build libsvn_ra_serf, please
- install serf 1.3.4 or newer.
复制代码- configure: looking for apr_memcache as part of apr-util
- checking apr_memcache.h usability... yes
- checking apr_memcache.h presence... yes
- checking for apr_memcache.h... yes
- checking for apr_memcache_create in -laprutil-1... yes
- 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
- apxs:Error: Sorry, no shared object support for Apache.
- apxs:Error: available under your platform. Make sure.
- apxs:Error: the Apache module mod_so is compiled into.
- apxs:Error: your server binary `/usr/local/apache2//bin/httpd'..
- configure: error: no - APXS refers to an old version of Apache
- Unable to locate /mod_dav.h
复制代码
解决方法:
- [root@svnsubv lib]# pwd
- /usr/local/apache2/lib
- [root@svnsubv lib]# ln -s /usr/local/openssl/lib/libssl.so.1.0.0 libssl.so.1.0.0
- [root@svnsubv lib]# ln -s /usr/local/openssl/lib/libcrypto.so.1.0.0 libcrypto.so.1.0.0
- <2> 报缺少SQLite,其实是SQLite版本太低。
- checking sqlite3.h presence... yes
- checking for sqlite3.h... yes
- checking sqlite library version (via header)... unsupported SQLite version
- checking sqlite library version (via pkg-config)... none or unsupported 3.3
- no
- An appropriate version of sqlite could not be found. We recommmend
- 3.7.15.1, but require at least 3.7.12.
- Please either install a newer sqlite on this system
- or
- get the sqlite 3.7.15.1 amalgamation from:
- http://www.sqlite.org/sqlite-amalgamation-3071501.zip
- unpack the archive using unzip and rename the resulting
- directory to:
- /root/subversion-1.9.4/sqlite-amalgamation
- configure: error: Subversion requires SQLite
- [root@svnsubv lib]# rpm -qa|grep -i SQLite
- sqlite-3.3.6-7
- sqlite-devel-3.3.6-7
- python-sqlite-1.1.7-1.2.1
- sqlite-3.3.6-7
- [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。
- [root@svnsubv bugzilla-4.4.12]# ./checksetup.pl
- 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.
- BEGIN failed--compilation aborted at Bugzilla/Install/Requirements.pm line 17.
- Compilation failed in require at ./checksetup.pl line 26.
- BEGIN failed--compilation aborted at ./checksetup.pl line 26.
- [root@svnsubv bugzilla-4.4.12]#
复制代码
解决:
- [root@svnsubv bugzilla-4.4.12]# cpan
- Terminal does not support AddHistory.
- cpan shell -- CPAN exploration and modules installation (v1.7602)
- ReadLine support available (try 'install Bundle::CPAN')
- cpan>o conf http_proxy http://10.99.93.33:8080/
- #省略......
- cpan> install version
- CPAN: Storable loaded ok
- Going to read /root/.cpan/Metadata
- Database was generated on Wed, 03 Feb 2016 03:53:49 GMT
- CPAN: LWP::UserAgent loaded ok
- Fetching with LWP:
- #省略......
- Installing /usr/share/man/man3/version.3pm
- Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/version/.packlist
- Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
- /usr/bin/make install -- OK
- 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。
- ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --enable-embedded-mysqli --with-zlib --with-pear --enable-mbstring
- make
- make install
复制代码
8 配置HTTPD的参数。
/etc/httpd/conf/httpd.conf。
- LoadModule php5_module modules/libphp5.so
- User csvn
- Group csvn
- <IfModule dir_module>
- DirectoryIndex index.php index.cgi index.html
- </IfModule>
- AddType application/x-httpd-php .php .phtml
- <Directory "/opt/bugzilla-4.4.12">
- AddHandler cgi-script .cgi
- Options Indexes ExecCGI FollowSymLinks
- # SetEnv PERL5LIB /opt/bugzilla-4.4.11:/opt/bugzilla-4.4.11/lib
- DirectoryIndex index.cgi
- AllowOverride None
- Order allow,deny
- Allow from all
- </Directory>
- Include /etc/httpd/extra/httpd-vhosts.conf
- Include /etc/httpd/extra/httpd-ssl.conf
- Include /etc/httpd/subversion.conf
- Include /etc/httpd/svnmanager.conf
- extra/httpd-vhosts.conf
- <VirtualHost *:80>
- RewriteEngine On
- RewriteCond %{SERVER_PORT} !^443$
- RewriteRule ^(.*)?$ https://%{SERVER_NAME}$1 [L,R]
- # RewriteBase /
- # RewriteCond %{SERVER_PORT} 443
- # RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
- </VirtualHost>
- extra/httpd-ssl.conf
- SSLCertificateFile "/etc/httpd/extra/server.crt"
- SSLCertificateKeyFile "/etc/httpd/extra/server.key"
- SSLCertificateChainFile "/etc/httpd/extra/server.crt"
- subversion.conf
- <Location /svn>
- DAV svn
- SVNParentPath /data/svn/svnroot/
- AuthType Basic
- AuthName "Subversion repository"
- AuthUserFile /data/svn/svnauth/svn_auth_file
- AuthzSVNAccessFile /data/svn/svnauth/svn_access_file
- Satisfy Any
- Require valid-user
- #SSLRequireSSL
- </Location>
- svnmanager.conf
- Alias /svnmanager/ "/opt/svnmanager-1.10/"
- <Directory "/opt/svnmanager-1.10/">
- AllowOverride none
- # Options Indexes FollowSymLinks
- Order allow,deny
- Allow from all
- </Directory>
- HTTPD运行报错:
- [root@svnsubv bin]# ./apachectl start
- 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
- [root@svnsubv bin]# ll /usr/local/subversion/libexec/mod_dav_svn.so
- -rwxr-xr-x 1 root root 804628 May 27 16:22 /usr/local/subversion/libexec/mod_dav_svn.so
- [root@svnsubv bin]#
复制代码
出现这个问题的原因是因为sqlite3的包是旧的,用新的替换即可。
|
|