构建Apache+Subversion的环境

构建Apache+Subversion的环境

安装Apache

yum install -y httpd

安装Subversion

yum install -y subversion

安装Apache SVN模块

yum install -y mod_dav_svn

建立SVN库

mkdir -p /home/svn/
cd /home/svn/
svnadmin create work
chown -R apache.apache work

添加Subversion账号

htpasswd -c /home/svn/work/conf/passwdfile  test

修改/etc/httpd/conf.d/subversion.conf,内容如下

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /svn/work>
    DAV svn
    SVNPath /home/svn/work
    AuthType Basic
    AuthName "Authorization Realm"
    AuthUserFile /home/svn/work/conf/passwdfile
    AuthzSVNAccessFile /home/svn/work/conf/authz
    Require valid-user
</Location>

启动httpd

/etc/init.d/httpd start

使用Nginx反向代理
下载nginx

wget http://nginx.org/download/nginx-0.8.55.tar.gz
tar -xzvf nginx-0.8.55.tar.gz
cd nginx-0.8.55

添加nginx账号

useradd -s /bin/false nginx

编译安装nginx

./configure --prefix=/opt/nginx-0.8.55 \
--with-http_stub_status_module \
--with-http_gzip_static_module
make
make install
cd /opt && ln -sf nginx-0.8.55 nginx && cd -

配置Nginx反向代理,修改/opt/nginx/conf/nginx.conf

server {
    listen       80;
    server_name  svn.test.com;

    location /svn/work {
        proxy_pass  http://127.0.0.1/svn/work;
    }

    location / {
        return 404;
    }
}

启动nginx

/opt/nginx/sbin/nginx

最后
访问http://svn.test.com/svn/work 即访问svn库

转载于:https://my.oschina.net/evancheung/blog/2050916

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值