Install SVN integration Apache + SSL in CentOS 6.5

Source: Internet
Author: User
Tags install openssl

Install SVN integration Apache + SSL in CentOS 6.5

Finally, SVN (version 1.8) was initially set up on the server ).

Server System: 64-bit CentOS 6.5. During the setup process, all servers use the source code for compilation and installation (configure/make install). We recommend that you compile and install these servers.

To install the source code, install gcc first. If no compiling environment is available, install yum-y install gcc.

The downloaded source code is the latest, so there is no way. The old version of the source code of some software is really hard to find. You just need to use the latest version.

I am used to install software in/usr/local/source code and download it to/usr/local/src/. No special instructions are given below.

Follow these steps:

Operation with su root's direct root permission

1. Install Apr and Apr-util

Cd/usr/local/src
Http://mirror.bit.edu.cn/apache//apr/apr-1.5.1.tar.gz wget-c
Tar-zxvf apr-1.5.1.tar.gz
Chown-R root: root apr-1.5.1
Cd apr-1.5.1
./Configure -- prefix =/usr/local/apr
Make & make install

Next,

Http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gz wget-c
Tar-zxvf apr-util-1.5.4.tar.gz
Chown-R root: root apr-util-1.5.4
Cd apr-util-1.5.4
./Configure -- prefix =/usr/local/apu -- with-apr =/usr/local/apr/
Make & make install

Okay, verify it.

./Apr/bin/apr-1-config -- version
1.5.1
./Apu/bin/apu-1-config -- version
1.5.4

Ii. Install openssl

Http://www.openssl.org/source/openssl-1.0.1k.tar.gz wget-c

Tar-zxvf openssl-1.0.1k.tar.gz

Cd openssl-1.0.1k.tar.gz

./Config -- prefix =/usr/local/openssl-fPIC no-gost no-shared no-zlib

Make & make install

3. install apache httpd server

Http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.10.tar.gz wget-c

Tar-zxvf httpd-2.4.10.tar.gz
 
Cd httpd-2.4.10

There are many dependencies for installing httpd. Some parameters may be used in earlier versions./configure -- help
 
There are many compilation methods that can be viewed from the Internet as follows, and errors may occur: configure: error: pcre-config for libpcre not found.
./Configure -- prefix =/usr/local/apache -- with-apr =/usr/local/apr/-- with-apr-util =/usr/local/apu/
-- Enable-so -- enable-dav -- enable-maintainer-mode -- enable-rewrite
-- Enable-ssl -- with-ssl =/usr/local/openssl
 
So you have to install pcre (Regular Expression function library)
Download the version 8.36 from the official website.
Tar-zxvf pcre-8.36.tar.gz
Cd pcre-8.36
Mv pcre-8.36/usr/local/pcre copy directly to/usr/local
./Configure (compile and use gcc +. If not, install yum-y install gcc-c ++)
Make & make install

After the installation is complete, re-compile httpd and then OK.
./Configure -- prefix =/usr/local/apache -- with-apr =/usr/local/apr/-- with-apr-util =/usr/local/apu/
-- Enable-so -- enable-dav -- enable-maintainer-mode -- enable-rewrite
-- Enable-ssl -- with-ssl =/usr/local/openssl -- with-pcre =/usr/local/pcre-config

Then start make and make install (if-fPIC is not added before openssl is installed, an error may occur here ).
Some people may have problems in this step:

Exports. c: 1653: error: redefinition of 'ap _ hack_apr_version_string'
Exports. c: 1022: error: previous definition of 'ap _ hack_apr_version_string 'was here
This is. /server/exports. in the c file, many of the two identical constants imported from apr apu encoded are the same. I chose a stupid method to delete the extra constants and then make install. /configure has a parameter -- with-embedded ded-apr and the compilation is OK.

After installation, start/usr/local/apache/bin/apachectl-k start.
Open the browser and enter http: // 127.0.0.1
Page display: It works!

4. Install Zlib

Http://zlib.net/zlib-1.2.8.tar.gz wget-c

Tar-zxvf zlib-1.2.8.tar.gz

Chown-R root: root zlib-1.2.8

Music zlib-1.2.8 zlib

Mv zlib/usr/local/

Cd/usr/local/zlib

./Configure

Make & make install

5. Install Sqlite

Http://www.sqlite.org/2014/sqlite-autoconf-3080704.tar.gz wget-c

Tar-zxvf sqlite.autoconf-3080704.tar.gz

Chown-R root: root sqlite.autoconf-3080704.tar.gz

Mv sqlite. autoconf-3080704 sqlite

Mv sqlite/usr/local

Cd/usr/local/sqlite

./Configure

Make & make install

6. Install Subversion1.8

Http://mirrors.hust.edu.cn/apache/subversion/subversion-1.8.11.tar.gz wget-c

Tar-zxvf subversion-1.8.11.tar.gz

Cd subversion-1.8.11

Mkdir-p./sqlite-amalgamation (Here we copy the sqlite3.c file in the installed sqlite to this)

Cp/usr/local/sqlite/sqlite3.c./sqlite-amalgamation/

./Configure -- prefix =/usr/local/subversion -- with-apxs =/usr/local/apache/bin/apxs -- with-apr =/usr/local/apr/
-- With-apr-util =/usr/local/apu/-- with-zlib -- enable-maintainer-mode

Make & make instal
Okay, let's verify it.
/Usr/local/subversion/bin/svnserve -- version
Svnserve, version 1.8.11 (r1643975)
Compiled Jan 12 2015, 18:58:04 on x86_64-unknown-linux-gnu
.
.
.
Check whether the/usr/local/subversion/libexec/directory exists.
Mod_authz_svn.so
Mod_dav_svn.so

VII. Integration of Subversion and Apache

(1) Configure Subversion

Create SVN version Library
Mkdir-p/opt/svn/data/repos

/Usr/local/subversion/bin/svnadmin create/opt/svn/data/repos

Cd/usr/local/data

By default, the access permission of apache is daemon. Therefore,

Chown-R daemon/opt/svn/data/repos

Next, generate the access control file
Apache provides a generation tool that can be directly generated using the htpasswd command.

/Usr/local/apache/bin/htpasswd-c/opt/svn/data/repos/conf/passwd admin (-c new file)
/Usr/local/apache/bin/htpasswd/opt/svn/data/repos/conf/passwd username

After the user is created, edit authz (/opt/svn/data/repos/conf/authz). The corresponding template example is also provided.
[Groups] (Group)
Boss = admin // group name = user, user, user ...... (Separated by commas)
Boys = username
......
[Repos:/]
@ Boss = rw
@ Boys = r
* =
For details about how to configure it, go to the documents page. R read w write

(2) Configure Apache

Cd/usr/local/apache/

Copy two files in subversion to./modules/
Cp/usr/local/subversion/libexec/mod_authz_svn.so./modules/

Cp/usr/local/subversion/libexec/mod_dav_svn.so./modules

Next, edit httpd. conf.

Vi./conf/httpd. conf

First, add
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

Add
<Location/repos>
DAV svn
SVNParentPath/opt/svn/data/# parent directory of the SVN Repository
SVNListParentPath On
SVNAutoversioning On
SVNReposName "repos"
AuthzSVNAccessFile/opt/svn/data/repos/conf/authz # The previously generated access control file
AuthType Basic
AuthName "hello, welcome to my repos! "
AuthUserFile/opt/svn/data/repos/conf/passwd # User File
Require valid-user
</Location>

After integration, restart apache.

./Bin/apachectl-k restart

You can enter http: // 127.0.0.1/repos in the browser to enter the account password.

8. Configure Https

(1) first generate the certificate Private Key

Cd/usr/local/apache/conf/# directly stored in the conf directory

/Usr/local/openssl/bin/openssl genrsa 1024> server. key
Output prompt:
Generating RSA private key, 1024 bit long modulus
... ++
...
E is 65537 (0x10001)
The server. key file is generated in conf.

(2) Fill in necessary information for the credential

/Usr/local/openssl/bin/openssl req-new-key server. key> server. csr

You are about to be asked to enter information that will be ininitialized
Into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]: CN
State or Province Name (full name) [Some-State]: Guangdong
Locality Name (eg, city) []: Shenzhen
Organization Name (eg, company) [Internet Widgits Pty Ltd]: xxxxx
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []: xxxxxxx
Email Address []: xxxxxxx

Please enter the following 'extra 'attributes
To be sent with your certificate request
A challenge password []: xxxxxxx
An optional company name []: xxxxxxx

Fill in the information to generate server. csr

(3) generate a certificate

/Usr/local/openssl/bin/openssl req-x509-days 1024-key server. key-in server. csr> server. crt #-days indicates the validity period

(4) editing the configuration file httpd. conf httpd-ssl.conf

Vi httpd. conf

# Include conf/extra/httpd-ssl.conf
Remove '#' from the front
Include conf/extra/httpd-ssl.conf

Vi./extra/httpd-ssl.conf

Add
SSLCertificateFile "/usr/local/apache/conf/server. crt"
SSLCertificateKeyFile "/usr/local/apache/conf/server. key"

(5) require https access/repos

In httpd. conf
<Location/repos>
SSLRequireSSL
.
.
.
.
.
</Location

(6)

Restart Apache.

-------------------------------------- Split line --------------------------------------

Subversion configuration instances in Linux

CentOS 6.2 SVN setup (YUM installation)

Deploy Apache + SVN in CentOS 6.5

Build an SVN server using Apache + SVN

Set up and use the SVN server in Windows + reset the password on the client

Install SVN in Ubuntu Server 12.04 and migrate Virtual SVN data

Install the svn service and migration method on Ubuntu Server

Build SVN server with online storage

-------------------------------------- Split line --------------------------------------

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.