由于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)、账号、密码便可迁出项目。
分享到:
相关推荐
Jupyter-Notebook
Jupyter-Notebook
高效甘特图模板下载-精心整理.zip
lstm Summary Framework: z = U>x, x u Uz Criteria for choosing U: • PCA: maximize projected variance • CCA: maximize projected correlation • FDA: maximize projected intraclass variance
OpenGL调试工具,适合图形开发者,包括视频开发,播放器开始以及游戏开发者。
全国行政区划shp最新图.zip
全国研究生招生与在校数据+国家线-最新.zip
Jupyter-Notebook
直播电商交流平台 SSM毕业设计 附带论文 启动教程:https://www.bilibili.com/video/BV1GK1iYyE2B
《林黛玉进贾府》课本剧剧本
2000-2020年沪深A股上市公司融资约束程度SA指数-最新数据发布.zip
PPT模版资料,PPT模版资料
CPA注会考试最新教材资料-最新发布.zip
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。
内容概要:本文提供了一个完整的职工管理系统的C++源代码。通过面向对象的编程方法,实现了包括创建新职工、查询、增加、修改、删除、排序、统计以及存储和恢复职工数据在内的多个基本操作功能。该系统支持不同的用户角色(如管理员与老板),并通过菜单驱动方式让用户方便地进行相关操作。此外,还包括了错误检测机制,确保操作过程中的异常得到及时处理。 适合人群:有一定C++语言基础,特别是面向对象编程经验的程序员;企业管理人员和技术开发人员。 使用场景及目标:适用于中小型企业内部的人力资源管理部门或IT部门,用于维护员工基本信息数据库,提高工作效率。通过本项目的学习可以加深对链表、类和对象的理解。 阅读建议:建议先熟悉C++的基本语法和面向对象概念,再深入学习代码的具体实现细节。对于关键函数,比如exchange、creatilist等,应当重点关注并动手实践以加强理解。
Jupyter-Notebook
考研公共课历年真题集-最新发布.zip
Huawei-HKUST Joint Workshop on Theory for Future Wireless 15-16 September 2022 华为-香港科技大学未来无线理论联合研讨会 Speaker:Jingwen Tong
演出人员与观众疫情信息管理系统 SSM毕业设计 附带论文 启动教程:https://www.bilibili.com/video/BV1GK1iYyE2B
《林黛玉进贾府》课本剧剧本.pdf