subversion+Apache部署

 

 

  • 软件环境

操作系统:  Centos7.5

软件版本:  subversion-1.10.0   httpd-2.4.33  openssl-1.0.2o  apr-1.6.3  apr-iconv-1.2.2  apr-util-1.6.1  scons-3.0.0  serf-1.3.9 sqlite-amalgamation-3160200

  • 安装包路径

#cd /mnt

  • 安装路径

#cd /usr/local/ apr-1.6.3

#cd /usr/local/apr-iconv-1.2.2

#cd /usr/local/apr-util-1.6.1

#cd /usr/local/scons-3.0.0

#cd /usr/local/serf-1.3.9

#cd /mnt/subversion-1.10.0/sqlite-amalgamation

#cd /usr/local/apache2.4.33

#cd /usr/local/subversion-1.10.0

 

  • 日志路径

# cd /usr/local/apache2.4.33/logs

 

  • 程序运行用户

chown –R svn.svn  /usr/local/subversion-1.10.0

chown –R svn.svn  /usr/local/apache2.4.33

 

  • 系统优化
  • 增加SWAP

dd if=/dev/zero of=/data/swap bs=1GB count=8

mkswap /data/swap

swapon /data/swap

echo "/data/swap swap swap  defaults  0  0" >> /etc/fstab

vi /etc/sysctl.conf

vm.swappiness=16

sysctl –p

  • 安装编译所需要的依赖环境

# yum -y install openssl-devel zlib-devel expat-devel

#yum -y install apr-devel gcc make

#yum -y install lz4-devel

#yum -y install epel-release perl

#yum -y install utf8proc utf8proc-devel

# yum install -y pcre-devel lua-devel libxml2-devel

  • 解锁用户和密码存储文件

# chattr -i /etc/gshadow

# chattr -i /etc/shadow

# chattr -i /etc/group

# chattr -i /etc/passwd

  • 添加用户和组

# groupadd svn

# useradd -M -g svn svn

  • 重新加锁用户和密码存储文件

# chattr +i /etc/gshadow

# chattr +i /etc/shadow

# chattr +i /etc/group

# chattr +i /etc/passwd

  • 安装
  • 解压安装包

# tar zxf apr-1.6.3.tar.gz

# tar zxf apr-util-1.6.1.tar.gz

# tar zxf apr-iconv-1.2.2.tar.gz

# tar zxf scons-3.0.0.tar.gz

# unzip serf-1.3.9.zip

# tar zxf subversion-1.10.0.tar.gz

# tar zxf httpd-2.4.33.tar.gz

 

  • 安装APR
  • 安装apr-1.6.3

# cd /mnt/apr-1.6.3

# ./configure --prefix=/usr/local/apr-1.6.3

# make&&make install

  • 安装apr-iconv-1.2.2

# cd /mnt/apr-iconv-1.2.2

# ./configure --prefix=/usr/local/apr-iconv-1.2.2 --with-apr=/usr/local/apr-1.6.3

# make&&make install

  • 安装apr-util-1.6.1

# cd /mnt/apr-util-1.6.1

# ./configure --prefix=/usr/local/apr-util-1.6.1 --with-apr=/usr/local/apr-1.6.3 --with-apr-iconv=/usr/local/apr-iconv/bin/apriconv-1.2.2

# make&&make install

 

  • 安装scons和serf
  • 安装scons-3.0.0

# cd /mnt/scons-3.0.0

# python setup.py install --prefix=/usr/local/scons-3.0.0

  • 安装serf-1.3.9

# unzip /mnt/serf-1.3.9.zip

#  cd serf-1.3.9

  • 注释掉如下警告

 #  /usr/local/scons-3.0.0/bin/scons PREFIX=/usr/local/serf-1.3.9 APR=/usr/local/apr-1.6.3 APU=/usr/local/apr-util-1.6.1

#  /usr/local/scons-3.0.0/bin/scons install

 

  • 链接动态共享库

#  cp -f /usr/local/serf-1.3.9/lib/libserf-1.so* /usr/local/lib/

#  ldconfig -v

#  echo "/usr/local/serf1.3.9/lib/" >> /etc/ld.so.conf

#  echo "/usr/local/apr-util-1.2.2/lib" >> /etc/ld.so.conf

#  echo "/usr/local/apr-1.6.3/lib" >> /etc/ld.so.conf

 

  • 安装apache和subversion
  • 安装apache-2.4.33

#  cp -rf /mnt/apr-util-1.6.1 /mnt/httpd-2.4.33/srclib/apr-util

#  cp -rf /mnt/apr-1.6.3 /mnt/httpd-2.4.33/srclib/apr

#  cd /mnt/httpd-2.4.33

#  ./configure --prefix=/usr/local/apache-2.4.33 --enable-so --enable-ssl --enable-cgi --enable-rewrite --enable-proxy --enable-proxy-ajp=share --enable-dav --enable-dav-fs --with-apr=/usr/local/apr-1.6.3 --with-apr-util=/usr/local/apr-util-1.6.1/  --enable-mods-shared=all --with-zlib --enable-deflate=shared --enable-proxy-fcgi --enable-modules=most --enable-mpms-shared=all --with-mpm=event --with-included-apr

 #  make&&make install

 #  echo "export PATH=/usr/local/apache-2.4.33/bin:$PATH" >> /etc/profile

 #  source /etc/profile

  • 修改apxs调用perl

 

 

  • 安装subversion-1.10.0

 #  cd /mnt/subversion-1.10.0

 #  ./configure --prefix=/usr/local/subversion-1.10.0 --with-apr=/usr/local/apr-1.6.3/ --with-apr-util=/usr/local/apr-util-1.6.1/ --with-apxs=/usr/local/apache/bin/apxs --with-apache-libexecdir --with-serf=/usr/local/serf-1.3.9--with-zlib

 #  make&&make install

 # echo "export PATH=/usr/local/subversion-1.10.0/bin:$PATH" >> /etc/profile

 #  source /etc/profile

  • 确认SVN的DAV模块是否存在

ls /usr/local/apache-2.4.33/modules/|grep svn

  • 修改配置文件调用SVN模块

subversion+Apache部署_第1张图片

 

 

 

  • 增加Apache认证SVN

subversion+Apache部署_第2张图片

 

 

  • 启动Apache

# /usr/local/apache/bin/apachectl start

# ps -elf|grep httpd

 

  • 创建SVN父目录

# mkdir /Repositories

# chown-R svn.svn /Repositories

 

  • 启动SVN

# svnserve -d -r /Repositories

# ps -elf|grep svnserve

你可能感兴趣的:(运维)