Linux 下安装配置 SVN 环境
安装和建立版本库
1 | sudo yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql |
新建名为 fang 的用户,文件位置 /var/svn/passwd
1 | htpasswd -cm /var/svn/passwd fang |
新建 /var/svn/authz 文件,将用户权限加上
1 | [aliases] |
修改 /etc/httpd/conf.d/subversion.conf
1 | /svn> |
其中 SSLRequireSSL,意味着需要https加密访问
重启apache,访问 http://ip/svn/stuff/ 即可
HTTPS服务
安装软件包
1 | sudo yum install mod_ssl openssl |
申请证书
cd /etc/pki/tls/private
openssl genrsa -out ca.key 1024
openssl req -new -key ca.key -out ca.csr
cd /etc/pki/tls/certs
openssl x509 -req -days 365 -in /etc/pki/tls/private/ca.csr -signkey /etc/pki/tls/private/ca.key -out ca.crt
修改 /etc/httpd/conf.d/ssl.conf 替换真实路径
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
修改 /etc/httpd/conf/httpd.conf,最后面加入下列代码
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory /var/svn>
AllowOverride All
</Directory>
DocumentRoot /var/svn
ServerName H0STNAME
</VirtualHost>
重启apache,访问 https://H0STNAME/svn/stuff/ 即可