明天中秋节了,今晚去看了敢死队,也周末了回来就想起来把这周自己在公司服务器上搭建SVN的过程整理一下。
1.安装软件
apt-get install subversion
apt-get install apache2
apt-get install libapache2-svn
2.创建SVN库,最好使用root用户,否则其他的用户会引发一些权限问题
mkdir /home/svn
3.创建项目
svnadmin create /home/svn/project 此时project下面会多出几个文件
root@ubuntu-14:/home/svn/project# ls -a
. .. conf db format hooks locks README.txt
然后进行读写授权
chmod -R 777 /home/svn/project 否则在代码提交的时候会出现commit failed !can't open file '/home/fruits/svn/projects/code/testsvn/db/txn-current-lock'!
4.cd conf
root@ubuntu-14:/home/svn/project# cd conf
root@ubuntu-14:/home/svn/project/conf# ls -a
. .. authz hooks-env.tmpl passwd svnserve.conf
5.开始修改配置文件
[aliases]
[groups] #用户分组
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
admin=pm,admin
test=test
[/] #组赋予读写权限的设置
@admin=rw
@test=r
还可以设置具体的目录权限
[/projectname/目录/子目录]
[general]
### The anon-access and auth-access options control access to the
### repository for unauthenticated (a.k.a. anonymous) users and
### authenticated users, respectively.
### Valid values are "write", "read", and "none".
### Setting the value to "none" prohibits both reading and writing;
### "read" allows read-only access, and "write" allows complete
### read/write access to the repository.
### The sample settings below are the defaults and specify that anonymous
### users have read-only access to the repository, while authenticated
### users have read and write access to the repository.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the
### directory containing this file. The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository. If you don't specify an authz-db,
### no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
7.然后就是修改passwd文件,直接就是在【user】进行username=password的格式显示密码,如果你要支持http格式加密的访问这里暂时不用配置
htpasswd -c /home/svn/project/conf/passwd username 然后会让输入2次密码
之后在进行添加用户的时候要去掉 -c 否则就会覆盖所有
例如:添加test
htpasswd /home/svn/project/conf/passwd test
test:$apr1$FIjm/2hw$WtCyafEOc9rqBsPAewWGl1 #这是加密之后的
如果进行修改密码 这样操作也是可以的
8.配置apache
<Location /project>
DAV svn
#SVNParentPath /home/svn
SVNPath /home/svn/project
ModMimeUsePathInfo on
AuthzSVNAccessFile /home/svn/project/conf/authz
AuthzSVNAnonymous off
AuthzSVNNoAuthWhenAnonymousAllowed off
AuthType Basic
AuthName "Subversion"
AuthUserFile /home/svn/project/conf/passwd
Require valid-user
</Location>
9.如果要修改apache2端口
Listen 端口 #你想要的端口
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
10.如果你想修改SVN默认的端口
重新指定一个端口号(默认端口3690)比如修改为3691
svnserve -d –listen-port 3691 -r /home/svn/project
11.配置完毕重启/etc/init.d/apache2 restart
12.说一下我在配置过程中遇到的问题
第一个:启动apache2的时候遇到的
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
apache 启动出现这种错误的解决方法:
将 apache2的配置文件httpd.conf中的 ServerName 改成可用域名或如下配置
ServerName localhost:80 端口 注意是否有修改过端口
第二个:编码问题
在安装ubuntu的时候选了中文,但后来发现SVN客户端需要utf8来支持中文。
于是修改 /etc/default/locale为:
但是,后来perl, locale,export LANG=en_US.UTF-8之类的命令都出现warning:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
locale-gen en_US.UTF-8
第三个问题:提交代码的时候出现的
添加:chmod -R 777 /home/svn/project
就写到这里吧!也可以使用一键包安装挺简单的!下一篇就是,我上传的附件有我下载的一键包!
相关推荐
ubuntu linux中配置svn+apache+ssl
Ubuntu+svn+ssl+ldap 的安装以及集成
本文档将指导您在 Ubuntu 操作系统下安装和配置 SVN(Subversion)和 Apache 服务器。 一、准备源码包 在开始安装之前,需要下载以下三个源码包: 1. Subversion 1.6.17:...
实际工作中在ubuntu上安装apache+svn的配置文档
Apache2+Svn 在 Ubuntu 下的详细配置 在本文中,我们将详细介绍如何在 Ubuntu 系统下配置 Apache2+Svn,以便实现版本控制和协作开发。本文将涵盖从安装 Apache2 和 Svn 服务器到配置 Svn 仓库的所有步骤。 安装 ...
Ubuntu上搭建SVN服务器详细步骤。 目 录 1 概述 1 2 安装Ubuntu 9.10服务器 1 3 安装Apache服务器 1 4 创建SVN服务器 1 4.1 安装SVN 1 4.2 增加组 2 4.3 创建SVN仓库 2 4.4 配置Apache服务器 2 5 配置SSL 3 6 远程...
ubuntu下简单安装svn 服务器--简介: svn是目前使用比较多的版本控制软件,目前在linux下,svn服务器一般有两个选择:svnserve和apache,下文就主要介绍怎么在ubuntu9.10里安装和使用svn服务器。
在Ubuntu 18 LTS环境中,搭建一个简单apache2+subversion的版本控制。
svn jsvnadmin 搭建 svn服务器
需要注意的是如果该文件是在windows下创建的,在拷贝到Ubuntu或Linux环境下需要转换格式,可使用dos2unix进行转换。 2.安装Authen::SASL模块 因为Perl通过SMTP发送邮件,其中SMTP验证的时候需要Authen::SASL模块。 ...
准备,下载所需要文件本文测试环境:ubuntu6.06LTS(kernel2.6.15-25-k7,gcc-4.0.3)/ubuntuserver(2.6.15-26-server,gcc-4.0.4)Subversion1.3.2/1.4.2Apache2.2.2/2.2.3GCC4.1.2最新的版本Subversion可以在这里找到...
ubuntu 工具源码和安装说明. export PATH=$PATH:/usr/local/vim/bin tar xf ncurses_5.9.orig.tar.gz mv ncurses-5.9/ ncurses cd ncurses ./configure --prefix=/usr/local/ncurses --without-cxx make sudo make ...
./configure --prefix=/usr/local/svn --with-apxs=/usr/local/webserver/apache2/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-sqlite=/usr/local/sqlite --with-ssl --with-...
自己编译的activemq-cpp的2.X的最后版本,在windows + vs2010下测试通过。压缩包中包含了include\lib\dll文件。 由于尝试了N个3.X的版本都不同过,于是退到2.X版本,通过了,另外在vs2005下编译出来的也没有问题。...
系统是ubuntu 12.04,已经安装好了apache和...Tips:如果没有这个命令,需要先安装svn,在ubuntu下直接使用apt-get安装就OK了: 复制代码 代码如下:$ sudo apt-get install subversion 关于php源码,如需要了解更多信息
软件安装的最小可用空间量: 2 GB (不需要全部安装)。执照HTAN已获得Apache许可版本2.0的许可。安装和使用德比安# root access is requiredsu -l root# update packagesapt-get update && apt-get upgrade# prere
2、jdk、maven 需要手动下载,下载之后分别为 jdk-8u51-linux-x64.gz apache-maven-3.3.3-bin.tar.gz 3、创建一个Dockerfile文件,包含以下内容 FROM ubuntu RUN apt-get update RUN apt-get -y install ...
包括Actionscript Apache Ant ASP C C# C++ Delphi Java Javascript Perl PHP Python VB Ruby Scala LISP Matlab Mathematica Fortran CSS DOM Erlang Perl Php QT Firfox Flash Git SVN Haskell ...
包括Actionscript Apache Ant ASP C C# C++ Delphi Java Javascript Perl PHP Python VB Ruby Scala LISP Matlab Mathematica Fortran CSS DOM Erlang Perl Php QT Firfox Flash Git SVN Haskell ...