`
lz1130
  • 浏览: 406283 次
  • 性别: Icon_minigender_1
  • 来自: 福建
社区版块
存档分类
最新评论

nginx subversion apache 安装配置

阅读更多
由于nginx现在暂时不支持subversion,而web服务器又选择了nginx,所以只能安装apache集成subversion,然后通过nginx proxy给apache来实现nginx的svn

这里用的服务器版本是:ubuntu server 8.04 32bit
并且已经认为你安装了nginx

nginx的安装可以看另一篇博客nginx php 安装与配置


Apache安装
sudo apt-get install apache2
sudo apt-get install apache2-utils


Subversio与libapache2-svn安装
sudo apt-get install subversion subversion-tools libapache2-svn


把svn模块添加到/etc/apache2/mods-enabled中
cd /etc/apache2/mods-enabled
ln -s ../mods-available/dav_fs.* ./
ln -s ../mods-available/dav_svn.* ./
ln -s ../mods-available/dav.load ./


建立svn文件库
sudo mkdir /home/workhome/svn
sudo svnadmin create /home/workhome/svn/test
ls  -l /home/workhome/svn/test
看到以下文件则成功
-rw-r--r-- 1 root root  229 Oct  7 14:22 README.txt
drwxr-xr-x 2 root root 4096 Oct  7 14:22 conf
drwxr-sr-x 6 root root 4096 Oct  7 14:22 db
-r--r--r-- 1 root root    2 Oct  7 14:22 format
drwxr-xr-x 2 root root 4096 Oct  7 14:22 hooks
drwxr-xr-x 2 root root 4096 Oct  7 14:22 locks


权限设置
sudo chown -R ftp:ftp /home/workhome/svn
sudo chown -R www-data /home/workhome/svn/test


配置svn的VirtualHost
sudo mv /etc/apache2/sites-available/default /etc/apache2/sites-available/svn.sends.cc.conf
cd /etc/apache2/sites-enabled/
sudo rm default
sudo ln -s /etc/apache2/sites-available/svn.sends.cc.conf ./
sudo vi svn.sends.cc.conf


配置文件如下:

NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@sends.cc

<Location />

  # Uncomment this to enable the repository
  DAV svn

  # Set this to the path to your repository
  #SVNPath /home/workhome/svn/test
  # Alternatively, use SVNParentPath if you have multiple repositories under
  # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
  # You need either SVNPath and SVNParentPath, but not both.
  SVNParentPath /home/workhome/svn

#---------------------
  SVNListParentPath On
  SVNAutoversioning On
#---------------------

  # Access control is done at 3 levels: (1) Apache authentication, via
  # any of several methods.  A "Basic Auth" section is commented out
  # below.  (2) Apache <Limit> and <LimitExcept>, also commented out
  # below.  (3) mod_authz_svn is a svn-specific authorization module
  # which offers fine-grained read/write access control for paths
  # within a repository.  (The first two layers are coarse-grained; you
  # can only enable/disable access to an entire repository.)  Note that
  # mod_authz_svn is noticeably slower than the other two layers, so if
  # you don't need the fine-grained control, don't configure it.

  # Basic Authentication is repository-wide.  It is not secure unless
  # you are using https.  See the 'htpasswd' command to create and
  # manage the password file - and the documentation for the
  # 'auth_basic' and 'authn_file' modules, which you will need for this
  # (enable them with 'a2enmod').
  AuthType Basic
  AuthName "Subversion Repository Of SendsLab"
  AuthUserFile /etc/apache2/dav_svn.passwd

  # To enable authorization via mod_authz_svn
  AuthzSVNAccessFile /etc/apache2/dav_svn.authz

  # The following three lines allow anonymous read, but make
  # committers authenticate themselves.  It requires the 'authz_user'
  # module (enable it with 'a2enmod').
  #<LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  #</LimitExcept> 

</Location>


        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/svn.sends.cc.error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/svn.sends.cc.access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>


建立密码文件dav_svn.passwd
sudo htpasswd -c /etc/apache2/dav_svn.passwd root
建立其他用户及修改密码
sudo htpasswd  /etc/apache2/dav_svn.passwd isends


建立授权文件dav_svn.authz
sudo cp /home/workhome/svn/test/conf/authz /etc/apache2/dav_svn.authz
内容参考如下:
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
sendsadmin = root
sendstest = sendstest
other = isends

[/]
@sendsadmin = rw
@sendstest = r
* =

[test:/]
@sendsadmin = rw
@sendstest = rw
* =



更改apache端口
sudo vi /etc/apache2/ports.conf
这里改成20080
ps:别忘了防火墙打开端口


Nginx配置(我nginx的虚机主机都在vhost下)
sudo vi /usr/local/web/nginx636/conf/vhost/svn.sends.cc.conf
加入以下:
    server {
        listen       80;
        server_name  svn.sends.cc;
        access_log   /var/log/nginx/svn.sends.cc.access.log  main;
        root  /home/workhome/svn;

         location / {
                   proxy_set_header Host $host;
                   proxy_set_header X-Real-IP $remote_addr;
                   proxy_set_header X-Forwarded-Proto https;
                   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                   proxy_pass http://127.0.0.1:20080;
         }
    }


svn客户端与使用
svn客户端TortoiseSVN,使用很简单,安装后在任意盘符建立一个目录,右键单击目录选择“SVN 检出”。输入svn文件库地址(如http://svn.sends.cc/test)、账号、密码便可迁出项目。
1
0
分享到:
评论

相关推荐

    linux安装nginx和tomcat

    #### 二、Nginx的安装与配置 1. **下载Nginx源码包** 首先需要下载Nginx的源码包,这里选择的是1.2.8版本。 ```bash cd /opt wget http://nginx.org/download/nginx-1.2.8.tar.gz wget ...

    subversion-1.6.9 and deps-1.6.9

    在部署Subversion时,首先需要在服务器上正确安装Nginx,并配置适当的反向代理规则,将SVN的HTTP请求转发到Subversion服务器。这通常涉及到编辑Nginx的配置文件,设置SSL加密以保证数据安全,以及定义路径映射。然后...

    svn 一键安装配置

    本文将详细介绍如何一键安装配置SVN,以及如何实现开机自动启动SVN服务。 首先,我们需要获取SVN的安装包。这通常可以通过访问SVN官方网站或通过包管理器(如apt-get for Ubuntu/Debian,yum for CentOS/RHEL)来...

    SVN的安装和配置 SVN的安装和配置

    在Linux下,使用Apache HTTPD或Nginx作为SVN前端,配置SSL模块。 **9. 备份和恢复** 定期备份SVN仓库是非常重要的。可以使用SVN的热备份功能,或者直接复制仓库文件。在恢复时,只需替换备份的仓库文件。 通过...

    SVN服务器安装[借鉴].pdf

    SVN服务器的安装涉及到多个步骤,包括用户组管理、目录准备、HTTPD(Apache)配置以及Nginx的编译安装。 首先,用户组管理是确保安全性的基础。文档中创建了两个用户组:`www-g` 和 `svn-g`,分别对应Web服务器(如...

    apache和tomcat整合.pdf

    安装和配置Apache:确保Apache服务器已经安装并且运行正常。 b. 下载和安装mod_jk:从Apache Tomcat官方网站下载适合你Apache版本的mod_jk模块,解压后将其编译并安装到Apache的模块目录。 c. 配置mod_jk:...

    SVN安装配置

    **SVN安装配置详解** 版本控制系统(Version Control System,VCS)在软件开发中起着至关重要的作用,它能够帮助团队协同工作,跟踪代码的修改历史,以及方便地回滚到任何版本。其中,Subversion(SVN)是广泛应用...

    Subversion+Trac+Installation+Manual

    2. 配置Web服务器:Trac通常通过HTTP/HTTPS访问,因此需要配置Web服务器如Apache或Nginx来代理Trac。安装mod_wsgi或mod_proxy模块,然后根据Trac文档配置服务器配置文件。 3. 启动Trac:运行tracd或通过Web服务器...

    FreeBSD下Apache、PHP、SVN、Memcached、PostgreSQL、MySql的安装笔记

    "08.SVN.txt"会讲解如何安装和配置Subversion(SVN)。创建仓库,设置用户和权限,然后通过Apache的`mod_dav_svn`模块提供WebDAV接口供用户访问。 总的来说,这个配置过程涉及到服务器管理、网络服务配置、数据库...

    Nginx + PHP-FPM + APC=绝妙的组合

    相比传统的Apache HTTP Server,Nginx 在处理静态文件和反向代理方面表现出色,对于大型网站和高并发环境尤为适用。 PHP-FPM 是 PHP FastCGI 进程管理器,它是一个用于管理PHP进程的补丁,将FastCGI集成到PHP中。...

    常用Java Web应用软件 (LNMJ,LAMJ)安装

    本文主要总结了在Ubuntu10下常用Java Web应用软件的安装,特别是LNMJ Web(Linux+Nginx+Mysql+Java Tomcat)架构和LAMJ Web(Linux+Apache+Mysql+Java Tomcat)架构下的软件安装。为进一步配置和实现LNMJ和LAMJ架构(负载...

    笔记配置文档_linux_

    3. **linux-nginx安装配置.txt** - Nginx是一款高性能的HTTP和反向代理服务器,这部分可能讲解了如何在Linux上安装Nginx、配置服务器块、处理静态文件和反向代理等功能。 4. **linux权限.txt** - Linux的权限系统是...

    nginx+tomcat的负载均衡session共享和ant构建全流程

    Nginx的负载均衡策略包括轮询、权重轮询、最少连接数等,可以根据实际需求灵活配置。例如,轮询策略会平均分配请求到每个服务器,而最少连接数则会将新请求转发给当前连接数最少的服务器,以优化资源利用。 其次,...

    SVN SEARCHER 配置安装手册

    5. **配置Web服务器**:编辑Web服务器的配置文件(如Apache的 `httpd.conf` 或 Nginx 的 `nginx.conf`),确保能够正确处理 `.php` 文件并指向 SVN SEARCHER 的根目录。 6. **权限设置**:确保Web服务器的运行用户...

    老鸟rhel5/centos5服务器架设笔记:Trac的安装和配置

    5. 启动Trac Web服务器,可以使用内置的`tracd`轻量级服务器,或者与Apache或Nginx等全功能Web服务器集成。 为了使Trac能够与ClearSilver交互,你还需要配置Trac的模板引擎为ClearSilver。在`trac.ini`的`...

    在Linux系统中将Redmine和SVN整合入Nginx的方法

    - 在CentOS上,你需要安装LAMP(Linux、Apache、MySQL、PHP)或LNMP(Linux、Nginx、MySQL、PHP)环境。在这个案例中,使用Nginx作为Web服务器,因为Nginx以其高性能和低内存占用而闻名。 3. **安装Ruby**: - 解...

    Redmine+svn+testlink 配置文档(linux)

    1. **系统准备**:首先,确保系统更新至最新状态,安装必要的开发工具和库,例如Apache或Nginx作为Web服务器,以及MySQL或PostgreSQL作为数据库服务器。 2. **安装Redmine**:通过添加Redmine的官方仓库,使用`apt-...

    linux下svn安装笔记带钩子

    ### Linux下SVN安装与配置含钩子详解 #### 一、SVN简介与作用 Subversion(简称SVN)是一种分布式版本控制系统,主要用于代码管理。它可以追踪每一项对文件或目录所做的更改,并且能够查看任何时刻的版本状态。这...

Global site tag (gtag.js) - Google Analytics