subversion 1.10.0 安装集成if.svnadmi

2018-12-25  本文已影响0人  平_方

环境

image.png

创建用户

解锁用户和密码存储文件

chattr -i /etc/gshadow
chattr -i /etc/shadow
chattr -i /etc/group
chattr -i /etc/passwd

创建svn用户

groupadd svn
useradd -M -g svn svn

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

chattr +i /etc/gshadow
chattr +i /etc/shadow
chattr +i /etc/group
chattr +i /etc/passwd

规划目录

创建软件部署目录

mkdir /usr/local/ apr-1.6.3
mkdir /usr/local/apr-iconv-1.2.2
mkdir /usr/local/svnadmin-1.6.2
mkdir /usr/local/apr-util-1.6.1
mkdir /usr/local/scons-3.0.0
mkdir /usr/local/serf-1.3.9
mkdir -p /mnt/subversion-1.10.0/sqlite-amalgamation
mkdir /usr/local/apache-2.4.33
mkdir /usr/local/subversion-1.10.0

创建apache日志目录

mkdir /usr/local/apache-2.4.33/logs

权限设置

chown svn.svn /usr/local/subversion-1.10.0
chown svn.svn /usr/local/apache-2.4.33

安装依赖

yum -y install openssl-devel zlib-devel expat-devel apr-devel gcc make lz4-devel epel-release perl utf8proc utf8proc-devel pcre-devel lua-devel libxml2-devel

上传程序包并解压

上传到/mnt下

解压程序包

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
tar zxvf libxml2-2.9.1.tar.gz
tar zxvf php-5.3.8.tar.gz
unzip svnadmin-1.6.2.zip

编译依赖包

安装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

安装sqlite-amalgamation

unzip /mnt/sqlite-amalgamation-3160200.zip
cp sqlite-amalgamation-3160200/* /mnt/subversion-1.10.0/sqlite-amalgamation/

安装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
注释掉如下警告


image.png
/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

4.7.链接动态共享库

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

更改配置文件

vi /usr/local/apache-2.4.33/conf/httpd.conf
修改用户为svn


image.png

取消红框中的注释


image.png
添加ServerName
image.png

权限设置

chown -R svn.svn /usr/local/apache-2.4.33

安装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-2.4.33/bin/apxs --with-apache-libexecdir --with-serf=/usr/local/serf-1.3.9 --with-zlib --with-utf8proc=internal
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


image.png

修改配置文件调用SVN模块

vi /usr/local/apache-2.4.33/conf/httpd.conf
在最后添加

Include conf/extra/httpd-svn.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

增加Apache认证SVN

vi /usr/local/apache-2.4.33/conf/extra/httpd-svn.conf

<Location /svn>
 DAV svn
 support more repositories
 SVNParentPath /Repositories
 list all repositories
 SVNListParentPath on
 AuthType Basic
 AuthName "Please input Username and Password"
 AuthUserFile /Repositories/conf/passwd
 AuthzSVNAccessFile /Repositories/conf/authz
 Require valid-user
</Location>

启动Apache

/usr/local/apache/bin/apachectl start
ps -elf|grep httpd

svn使用

创建svn父目录

mkdir /Repositories
chown svn.svn /Repositories

启动svn

svnserve -d -r /Repositories

创建svn版本库

svnadmin create /Repositories/back

创建svn配置文件

cd /Repositories/
mkdir conf
cd conf
建立本地访问控制文件
touch passwd authz
htpasswd -cb /Repositories/conf/passwd yu 123
第一次创建加 -c 参数,增加用户去掉-c选项
htpasswd -b /Repositories/conf/passwd yuru 123
为创建的版本库添加权限
vi authz
[back:/]
yu = rw
重启Apache

测试连接

http://ip/svn/版本库名

if.svnadmin安装

安装php

编译安装依赖

cd /mnt/libxml2-2.9.1/
./configure –prefix=/usr/local/libxml2
make && make install

报错

image.png

解决办法
yum -y install python-devel

编译php

cd /mnt/php-5.6.38/

./configure  --prefix=/usr/local/php --with-apxs2=/usr/local/apache-2.4.33/bin/apxs --with-config-file-path=/usr/local/php/etc --with-libxml-dir=/usr/local/libxml2
make && make install

cp php.ini-development /etc/php.ini

安装if.svnadmin

cd /mnt/iF.SVNAdmin-stable-1.6.2
mv * /usr/local/svnadmin/
cd /usr/local/svnadmin/include/
vi config.inc.php
添加一行如下图

define("IF_SVNBaseC_ConfigDir", "/blubb/edi/blubb");
image.png

chown svn.svn /usr/local/svnadmin -R
chmod 777 /usr/local/svnadmin/data

修改httpd.conf

修改内容如下


image.png

在最后面添加内容如下

<Directory "/usr/local/svnadmin/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
image.png

添加index.php


image.png

添加一行如下图

AddType application/x-httpd-php .php
image.png

添加在Alias中一行如图


image.png

重启apache
/usr/local/apache-2.4.33/bin/apachectl restart

登录验证

http://IP/svnadmin

上一篇下一篇

猜你喜欢

热点阅读