subversion + ssl + viewvc 설치 방법
centos 7.x 기준, repo 가 /data 라는 기준
업데이트
# yum update -y
재부팅
# reboot
php 설치
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
# wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# rpm -ivh epel-release-7-9.noarch.rpm remi-release-7.rpm
# yum install -y --enablerepo=remi,remi-php56 php php-devel
# yum install -y --enablerepo=epel,remi libaio libaio-devel libmcrypt libmcrypt-devel libtidy openssl openssl-devel
# yum install -y --enablerepo=remi,remi-php56 php-gd php-mbstring php-mcrypt php-mysql php-pdo php-pear php-tidy php-xml php-xmlrpc pcre-devel
# yum install -y --enablerepo=epel,remi,remi-php56 ImageMagick ImageMagick-devel php-pecl-imagick
# vi /etc/php.ini
date.timezone = Asia/Seoul
추가
아파치 설치
yum install -y httpd*
# vi /etc/httpd/conf/httpd.conf
<Directory />
AllowOverride none
# Require all denied
Require all granted
</Directory>
수정
방화벽(나중에 셋팅하고 지금은 끄기)
systemctl stop firewalld
selinux 비활성화
# vi /etc/selinux/config
SELINUX=enforcing 을
SELINUX=disable 로 변경
subversion 설치
# yum install -y subversion* mod_dav_svn
# vi /etc/httpd/conf.d/subversion.conf
<Location /svn>
DAV svn
SVNParentPath /data/
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /data/htpasswd
AuthzSVNAccessFile /data/authz
Require valid-user
SVNIndexXSLT /svnstyle/svnindex.xsl
Order deny,allow
Allow from 192.168.0.1/24
Deny From all
LogFormat "%{%Y-%m-%d %T}t %u@%h %>s repo:%{SVN-REPOS-NAME}e %{SVN-ACTION}e (%B Bytes in %T Sec)" svn
CustomLog "/var/log/httpd/svn/svn.log" svn env=SVN-ACTION
추가
/var/log/httpd/svn 폴더를 만들어주자 안그러면 에러 뜬다.
viewvc 설치
# wget http://viewvc.org/downloads/viewvc-1.1.26.tar.gz
# tar -xvf viewvc-1.1.26.tar.gz
# cd viewvc-1.1.26
# ./viewvc-install - 다 그냥 엔터
This is the ViewVC 1.1.26 installer.
It will allow you to choose the install path for ViewVC. You will now
be asked some installation questions. Defaults are given in square brackets.
Just hit [Enter] if a default is okay.
Installation path [/usr/local/viewvc-1.1.26]:
DESTDIR path (generally only used by package maintainers) []:
Installing ViewVC to /usr/local/viewvc-1.1.26:
created /usr/local/viewvc-1.1.26/bin/cgi/
installed /usr/local/viewvc-1.1.26/bin/cgi/viewvc.cgi
installed /usr/local/viewvc-1.1.26/bin/cgi/query.cgi
created /usr/local/viewvc-1.1.26/bin/wsgi/
installed /usr/local/viewvc-1.1.26/bin/wsgi/viewvc.wsgi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ViewVC file installation complete.
Consult the INSTALL document for detailed information on completing the
installation and configuration of ViewVC on your system. Here's a brief
overview of the remaining steps:
1) Edit the /usr/local/viewvc-1.1.26/viewvc.conf file.
2) Either configure an existing web server to run
/usr/local/viewvc-1.1.26/bin/cgi/viewvc.cgi.
Or, copy /usr/local/viewvc-1.1.26/bin/cgi/viewvc.cgi to an
already-configured cgi-bin directory.
Or, use the standalone server provided by this distribution at
/usr/local/viewvc-1.1.26/bin/standalone.py.
apache viewvc 환경설정
# vi /etc/httpd/conf.d/viewvc.conf
Alias /viewvc/docroot /usr/local/viewvc-1.1.26/templates/docroot
ScriptAlias /viewvc /usr/local/viewvc-1.1.26/bin/cgi/viewvc.cgi
ScriptAlias /query /usr/local/viewvc-1.1.26/bin/cgi/query.cgi
<Location /viewvc>
SVNPath /data
AuthType Basic
AuthName "Subversion repository with ViewVC"
AuthUserFile /data/htpasswd
Require valid-user
SVNIndexXSLT /svnstyle/svnindex.xsl
AddDefaultCharset UTF-8
Options +Includes
</Location>
추가
viewvc 환경설정
# /usr/local/viewvc-1.1.26/viewvc.conf
svn_roots = svn: /data
root_parents = /data: svn
use_localtime = 1
authorizer = svnauthz
authzfile = /data/authz
authorizer, authzfile 이설정이 중요하다 viewvc 에서도 동일하게 볼수 있는 권한을 설정해주는 설정이다.
추가
https(443) 설정
# yum install mod_ssl openssl
# openssl genrsa -out ca.key 1024
# openssl req -new -key ca.key -out ca.csr
# openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
# cp ca.csr /etc/pki/tls/certs
# cp ca.key /etc/pki/tls/private/ca.key
# cp ca.csr /etc/pki/tls/private/ca.csr
# cd /etc/httpd/conf.d/
# cp ssl.conf.rpmnew ssl.conf
# vi ssl.conf
SSLCertificateFile /etc/pki/tls/certs/ca.csr
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
svn 접속
https://ip/svn/
viewvc 접속
https:/ip/viewvc
추가로
# vi /etc/httpd/conf/httpd.conf
KeepAlive On
MaxKeepAliveRequests 0
KeepAliveTimeout 600000
Timeout 600000
SVNInMemoryCacheSize 1048576
SVNCacheFullTexts On
SVNCacheTextDeltas On
SVNCompressionLevel 5