Deploying the APACHE+SVN server on CENTOS6

Source: Internet
Author: User
Tags sqlite sqlite database svn client

First, prepare the environment

1. SELinux and Iptables settings

1) Turn off SELinux

# temporarily close SELinux:

Setenforce 0

# Disable SELinux:

Vim/etc/sysconfig/selinux

# change selinux=enforcing to selinux=disabled and reboot to take effect.

2) Firewall settings

# Modify the firewall policy, open the required ports, in order to facilitate operation, you can also shut down the firewall, temporarily regardless of security issues

# Temporarily shut down the firewall:

Service Iptables Stop

# Permanently shut down the firewall:

Chkconfig iptables off

2. Yum Install dependent packages

Yum install gcc gcc-++ make pcre-devel zlib-devel expat-devel-y

3. Install APR (Apache Portable Runtime Library)

# download

wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gz

# Unzip

TAR-ZXVF apr-1.6.3.tar.gz

# Switch to Directory

CD apr-1.6.3

# Configuration

./configure--PREFIX=/USR/LOCAL/APR

# Compile and install

Make && make install

4, Installation Apr-util

wget http://mirrors.shuosc.org/apache//apr/apr-util-1.6.1.tar.gz

TAR-ZXVF apr-util-1.6.1.tar.gz

CD apr-util-1.6.1

./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR

Make && make install


Second, install Apache

wget https://mirrors.cnnic.cn/apache/httpd/httpd-2.4.28.tar.bz2

TAR-JXVF httpd-2.4.28.tar.bz2

CD httpd-2.4.28

./configure--prefix=/usr/local/apache--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util/-- With-included-apr

Make && make install

# Set the host name and port number used by the server for identification

Sed-i ' s/#ServerName. */servername 192.16.8.103:80/'/usr/local/apache/conf/httpd.conf


Third, install SVN

1,SVN needs to need to support SQLite database, first install SQLite

wget http://www.sqlite.org/2017/sqlite-autoconf-3210000.tar.gz

./configure

Make && make install

2. SVN installation Configuration

Mkdir-p/DATA/SVN

wget http://mirrors.shuosc.org/apache/subversion/subversion-1.8.19.tar.gz

CD subversion-1.8.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-zlib

Make && make install


3. SVN startup settings

1) Add Environment variables

echo "path= $PATH/:/usr/local/subversion/bin" >>/etc/profile

# effective immediately

Source/etc/profile


2) start svn

Svnserve-d-r/usr/local/subversion/


3) View SVN version

Svnserve--version


4) do a soft link to the default startup directory

Ln-s/usr/local/subversion/bin/svnserve/usr/local/bin/svnserve


5) set boot start

Vim/etc/init.d/svnserve

#!/bin/bash

# Chkconfig:-85 15

# DESCRIPTION:SVN Server

Svn_home=/data/svn

if [!-F "/usr/bin/svnserve"]

Then

echo "Svnserver startup:cannot start"

Exit

Fi

Case "$" in

Start

echo "Starting Svnserve ..."

/usr/local/subversion/bin/svnserve-d--listen-port 3690-r $SVN _home

;;

Stop

echo "stoping svnserve ..."

Killall Svnserve

;;

Restart

$ stop

$ start

;;

*)

echo "USAGE:SVN {start | Stop | Restart} "

Exit 1

Esac

5) Add executable permissions

chmod +/etc/init.d/svnserve

6) Verify the restart

/etc/init.d/svnserver restart

Iv. integration of Apache and SVN


1. Create groups and users and set User01 password

Groupadd SVN

Useradd-g svn-s/sbin/nologin SVN

Useradd User01

passwd User01


2. loading SVN library

cp/usr/local/src/subversion-1.8.19/subversion/mod_dav_svn/.libs/mod_dav_svn.so/usr/local/apache/modules/

cp/usr/local/src/subversion-1.8.19/subversion/mod_authz_svn/.libs/mod_authz_svn.so/usr/local/apache/modules/

3, configuration Web/dav

# Modify Apache configuration file

Vim/usr/local/apache/conf/httpd.conf

User SVN

Group SVN

# Remove the comments from the following 2 lines

LoadModule Dav_module modules/mod_dav.so

LoadModule Dav_fs_module modules/mod_dav_fs.so

# Add the following 2 lines at all LoadModule ends

LoadModule Dav_svn_module modules/mod_dav_svn.so

LoadModule Authz_svn_module modules/mod_authz_svn.so

4. Create a Directory

Mkdir-p/DATA/SVN

# Create SVN repository

Svnadmin Create/data/svn/sre

Vim/usr/local/apache/conf/httpd.conf

<Location/svn>

DAV SVN

Svnpath/data/svn/sre

AuthType Basic

AuthName "Pleaselogin"

authuserfile/usr/local/apache/.passwd

Require Valid-user

</Location>

5. Generate passwd file

/usr/local/apache/bin/htpasswd-c-m/usr/local/apache/.passwd User01

Chown-r svn.svn/usr/local/apache/.passwd

Chown-r SVN.SVN/DATA/SVN

/ETC/INIT.D/HTTPD restart


6. access Http://192.168.8.103/svn with a browser

or download SVN client to perform SVN Checkout, input url:http://192.168.8.103/svn,checkout to local PC



Deploying the APACHE+SVN server on CENTOS6

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.