Chinaunix首页 | 论坛 | 博客
  • 博客访问: 396402
  • 博文数量: 58
  • 博客积分: 2096
  • 博客等级: 大尉
  • 技术积分: 608
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-29 16:09
个人简介

专注于数据库技术研究和实践,目前就职于互联网金融企业,提供Oracle数据库技术支持和维护。 联系电话:18616803656

文章分类

全部博文(58)

文章存档

2020年(1)

2019年(4)

2018年(1)

2017年(3)

2015年(4)

2014年(7)

2012年(1)

2011年(27)

2010年(8)

2009年(2)

我的朋友

分类: LINUX

2009-12-09 15:53:16

I. Install Environment and Software Version

1. Centos 5.4

2. db-4.3.29.tar.gz

3. openldap-2.3.32.tgz

4. apr-1.2.8.tar.bz2

5. apr-util-1.2.8.tar.gz

6. openssl-0.9.8a.tar.gz

7. httpd-2.2.8.tar.gz

8. subversion-1.4.6.tar.bz2

9. subversion-deps-1.4.6.tar.bz2

 

II.Install Process

1. Install BDB 4.3.29

cd build_unix

../dist/configure

make

make install

2. Install openldap 2.3.32

CPPFLAGS="-I/usr/local/BerkeleyDB.4.3/include" LDFLAGS="-L/usr/local/BerkeleyDB.4.3/lib" ./configure -prefix=/usr/local/openldap -enable-ldbm

make depend

make

make test

make install

3. Install openssl0.9.8a

./config --prefix=/usr/local/openssl zlib

make

make install

4. Install apr 1.2.8

./configure --prefix=/usr/local/apr --with-berkeley-db=/usr/local/BerkeleyDB.4.3/

make

make install

5. Install apr-util 1.2.8

 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-ldap --with-ldap-include=/usr/local/openldap/include/ --with-ldap-lib=/usr/local/openldap/lib --with-berkeley-db=/usr/local/BerkeleyDB.4.3

make

      Note: If you use 64bit OS, it could report this error. Because the libexpat.so is 32bit.

      /usr/lib/libexpat.so: could not read symbols: File in wrong format

      collect2: ld returned 1 exit status

      make[1]: *** [libaprutil-1.la] Error 1

      make[1]: Leaving directory `/home/omni/tools/httpd-2.2.8/srclib/apr-util'

      make: *** [all-recursive] Error 1

      Solution:  rm -fr  /usr/lib/libexpat.so

                      ln -s /lib64/libexpat.so.0.5.0 /usr/lib/libexpat.so

    Then, re-run

    make

    make install

6. Install neon

./configure --with-apr=/usr/local/apr/ --with-ssl --with-libs=/usr/local/openssl

make

make install

/usr/bin/ld: /home/omni/tools/subversion-1.4.6/neon/src/.libs/libneon.a(ne_request.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

/home/omni/tools/subversion-1.4.6/neon/src/.libs/libneon.a: could not read symbols: Bad value

collect2: ld returned 1 exit status

make: *** [subversion/libsvn_ra_dav/libsvn_ra_dav-1.la] Error 1

Modify neon/src/Makefile:

CFLAGS = -fPIC -g -O2

7. Install zlib

CFLAGS="-O3 -fPIC" ./configure

make

make install

/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

/usr/local/lib/libz.a: could not read symbols: Bad value

8. Install Apache

./buildconf

./configure -enable-lib64 -libdir=/usr/lib64 --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-dav --enable-dav-fs --enable-dav-lock --enable-ldap --enable-authnz-ldap --enable-mods-shared=most --enable-ssl --enable-module=shared --enable-maintainer-mode

Install successful, please use this command /usr/local/apache2/bin/apachectl -k start to start Apache server, and test it: http://IP_ADDRESS:PORT

9. Install Subversion

./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config  --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-ssl --enable-maintainer --with-berkeley-db=/usr/local/BerkeleyDB.4.3


 

III. Configure the environment variable

     Install these software ok, you need to configure the environment variable, add the SVN bin path to $PATH.

    export SVN_HOME=/usr/local/subversion

    export APACHE_HOME=/usr/local/apache2

    export PATH=$APACHE_HOME\bin:$SVN_HOME/bin:$PATH

    Add these three lines to end of the /etc/profile.

    Then, run command:

    # source /etc/profile

 

IV: Create and Configure SVN Repository

1. Create SVN repository

# svnadmin create WealthManagement

2. Configure Apache and SVN

Modify the file /usr/local/apache2/conf/httpd.conf, check if it contained the follow two lines:

LoadModule dav_svn_module     modules/mod_dav_svn.so

LoadModule authz_svn_module   modules/mod_authz_svn.so

Then modify the port, ServerName, ServerAdmin or other configuration if you need, and add the content to the end of this file:

  DAV svn

  SVNListParentPath on

//*SVN repository path

  SVNParentPath /svnpath/docrepos

 #  SVNPath /docrepos

  SVNIndexXSLT "/svnindex.xsl"

  AuthType Basic

#Provide ldap and file authorization

  AuthBasicProvider ldap file

#Authorization name

  AuthName "Document SVN Server"

# Specify the ldap path 使用LDAPBrowser查看你的域信息

 AuthLDAPURL "ldap://domain_name:389/OU=Users,OU=Shanghai,OU=Organization,DC=chinaunix,DC=com,DC=cn?sAMAccountName?sub?(objectClass=*)"

# Specify the ldap username and password有读权限的域用户和密码

  AuthLDAPBindDN "admin@chinaunix.com"

  AuthLDAPBindPassword 12345678

  AuthzLDAPAuthoritative off

# Specify authorization files认证文件welpwd和访问权限控制文件svnaccessfile

  AuthUserFile /svnpath/conf/welpwd

  AuthzSVNAccessFile /svnpath/conf/svnaccessfile

  SVNPathAuthz on

  Require valid-user

# Specify the LOG file

CustomLog logs/rep_svn_logfile.log "%t %u %{SVN-ACTION}e" env=SVN-ACTION

3. Test

Test configure file:

#/usr/local/apache2/bin/httpd -t -f /usr/local/apache2/conf/httpd.conf

If the configure file is ok, start apache server

/usr/local/apache2/bin/apachectl -k restart

Type http:// IP_ADDRESS:PORT/svn/Repository_Name to your IE.

If you look the page, it’s successful. Congratulations!

 

If you need to use https protocol, please continue, otherwise it has ended.

V. Configure the SSL module

1. Generate SSL certificate

   1). Generate private key server.key

/usr/local/openssl/bin/openssl genrsa -des3 -out server.key 1024

/usr/local/openssl/bin/openssl rsa -in server.key -out server.key

     2). Generate server.csr

           /usr/local/openssl/bin/openssl req -new -key server.key -out server.csr

         Input some information:

          Country Name (2 letter code) [AU]:
          State or Province Name (full name) [Some-State]:
          Locality Name (eg, city) []:
          Organization Name (eg, company) [Internet Widgits Pty Ltd]:
          Organizational Unit Name (eg, section) []:
          Common Name (eg, YOUR name) []:
          Email Address []:

     3). Generate server.crt

           /usr/local/openssl/bin/openssl x509 -req -days 365 -in server.csr -signkey server.key -out  server.crt

 

2. Modify the httpd.conf file

1).Check the configure file contained the follow content , if not, please add it:

LoadModule ssl_module modules/mod_ssl.so

2).Then find the line of #Include conf/extra/httpd-ssl.conf, and remove the “#”

3).Modify the follow lines in the https-ssl.conf

Listen 8080

# General setup for the virtual host

DocumentRoot "/opt/apache2/htdocs"

ServerName IP_ADDRESS:8080

ServerAdmin

ErrorLog "/usr/local/apache2/logs/error_log"

TransferLog "/usr/local /apache2/logs/access_log"

SSLEngine on

SSLCertificateFile "/usr/local /apache2/conf/ssl.crt/server.crt"

SSLCertificateKeyFile "/usr/local /apache2/conf/ssl.key/server.key"

Put the certificates to the right directory based on the configure file.

3. Start the apache server to test

/usr/local/apache2/bin/apachectl -k restart

Type https:// IP_ADDRESS:PORT/svn/Repository_Name to your IE.

 

SVNIndexXSLT "/svnindex.xsl" file, unzip it to htdocs directory.

文件: htdocs.zip
大小: 9KB
下载: 下载

仅做参考,环境不同,可能有一些出入。

阅读(3620) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:Linux SVN Full Backup and Incremental Backup

给主人留下些什么吧!~~