SlideShare uma empresa Scribd logo
1 de 7
Installation of Subversion on Ubuntu, with Apache, SSL, and BasicAuth.


 1。安装 subversion 和 apache2 的组件(已经认为您已经安装了 apache2),


sudo apt-get install subversion libapache2-svn




 在/etc/apache2/mods-enabled 中会多出来一下几个链接文件(实际文件在 mods-available 中,我们不需要去
 管,只需要关注 enabled 目录就成):
 dav_fs.load dav_svn.conf dav_fs.conf dav.load dav_svn.load

 2。建立 svn 数据库




    a. 只建立一个仓库:


sudo svnadmin create /var/svn

ls /var/svn



 你将得到这样的结果,则说明建立成功 conf dav db format hooks locks README.txt


sudo chown -R root:svn /var/svn

sudo chmod -R g+rws /var/svn # 给 svn 组赋予读写权限,可以根据需要更改相应权限

sudo chmod -R o-rwx /var/svn # 删除其他无关人员的读、写、执行权限,默认情况下可能其他人有读权限

# 注:有关权限修改的问题可以查看相关 linux 命令

b.建立多个仓库($REPOS 是自己定义的仓库名称):

sudo mkdir /var/svn
sudo svnadmin create /var/svn/$REPOS

sudo chown -R root:svn /var/svn /$REPOS

sudo chmod -R g+rws /var/svn/$REPOS # 给 svn 组赋予读写权限,可以根据需要更改相应权限

sudo chmod -R o-rwx /var/svn/$REPOS # 删除其他无关人员的读、写、执行权限,默认情况下可能其他人有读权
限

ls /var/svn/$REPOS
你将得到这样的结果,则说明建立成功 conf dav db format hooks locks README.txt


  #注意:建立一个仓库时/etc/apache2/mods-enabled/dav_svn.conf (步骤 3) 应该注释掉
SVNParentPath:/var/svn 行,而去掉 SVNPath /var/svn 前面的注释。


    3。配置 apache



cd /etc/apache2/mods-enabled
sudo vi dav_svn.conf




    按照提示去掉一些文件注释,最终的文件看起来如下


# dav_svn.conf - Example Subversion/Apache configuration

#

# For details and further options see the Apache user manual and

# the Subversion book.

#

# NOTE: for a setup with multiple vhosts, you will want to do this

# configuration in /etc/apache2/sites-available/*, not here.

# <Location URL> ... </Location>

# URL controls how the repository appears to the outside world.

# In this example clients access the repository as http://hostname/svn/

# Note, a literal /svn should NOT exist in your document root.

<Location /svn>

    # Uncomment this to enable the repository

    DAV svn

    # Set this to the path to your repository

    #SVNPath /var/svn

    # 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 /var/svn

# 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"

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
# SSLRequireSSL

 #</LimitExcept>

</Location>




 或者象这样来实现独立的域名情况:



<VirtualHost 127.0.0.10>
     ServerName svn.rollenc.com
     DocumentRoot /var/svn

    <Location />
           DAV svn
           SVNPath /var/svn
           AuthType Basic
           AuthName "Subversion Repository"
           AuthUserFile /etc/apache2/dav_svn.passwd
           <LimitExcept GET PROPFIND OPTIONS REPORT>
                Require valid-user
           </LimitExcept>
      </Location>
</VirtualHost>




 4。建立密码文件
 建立第一个用户需要加-c 参数



sudo htpasswd2 -c /etc/apache2/dav_svn.passwd username




 输入两次密码
 建立其他用户:



sudo htpasswd2 /etc/apache2/dav_svn.passwd username2




 注意没有加-c,加-c 的话会清除掉以前存在的密码。
 如果 username2 为已存在用户,那这句命令的意义就是修改密码
5.重启 apache


sudo apache2 -k restart



 如果一切正常的话,使用浏览器打开 http://127.0.0.1/svn 应该看到如下信息 Revision 0: /
 Powered by Subversion version 1.3.1 (r19032).

 OK,安装完成
 你可以对他进行一些 import,commit 等操作了

 导入版本的文件框架



mkdir -p tmp/lab.rollenc.com/trunk tmp/eemap/trunk #如果你有其他已经写好的需要一起导入的文件,cp 过来让
在相应的 trunk 目录下,然后下一步。
svn import tmp http://127.0.0.10/ #更具提示输入 message 信息和用户,密码。



我在实验时发现有权限问题,这是你可能需要修改/var/svn 的权限为可读写


sudo chmod -R 777 /var/svn




 然后再继续执行上面的 import 操作。
 现在使用浏览器打开 http://127.0.0.10,可以得到
 Revision 1: /

 * eemap/
 * lab.rollenc.com/


 继续 checkout 和 commit 吧,祝你有一个愉快的 subversion。


Defined tags for this entry: subversion, Ubuntu, 技术

作者 rollenc

6.完善成为 https 的方式访问 SVN

  a.加载 ssl 模块


 sudo a2enmod ssl
b .生成认证证书

sudo apt-get install ssl-cert
sudo mkdir /etc/apache2/ssl
sudo /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem

   ls -l /etc/apache2/sites-available

  你看到有一个 default-ssl 文件,则说明生成成功

 c 创建虚拟主机($SITENAME 为你的站点名称)

sudo cp /etc/apache2/sites-available/default-ssl /etc/apache2/sites-available/$SITENAME

sudo vim /etc/apache2/sites-available/$SITENAME

add:(保证你看到下面两行)
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem


sudo a2ensite $SITENAME

   d 配置 apache,使 WebDAV and SVN 可用


cd /etc/apache2/mods-enabled
sudo vim dav_svn.conf
 add:

SSLRequireSSL

   e.配置成功

 sudo /etc/init.d/apache2 restart




利用 Tortoise SVN 可检出仓库:https://yourServerIp/svn/$REPOS




如果出现如下错误:

 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443

解决方法:

   1、netstat -tuln | grep :443 看端口是否开启

2、sudo less /etc/apache2/ports.conf 是否写了两个 Listen 443
测试:


网页访问:
lynx https://localhost/svn/$REPOS exposes the repository.
lynx http://localhost/svn/$REPOS says: eat my shorts , i.e. 403-forbidden.

一个初始化导入:

svn import --username $AUTH_USER $A_FILE https://localhost/svn/$REPOS/testdir -m “Testing”

检出:

svn co --username $AUTH_USER https://localhost/svn/$REPOS

按照步骤 2 的 b 方法 可以重复添加多个仓库


Above all, check the great SVN Book.

Mais conteúdo relacionado

Mais procurados

Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installation
franbow
 
Apache installation and configurations
Apache installation and configurationsApache installation and configurations
Apache installation and configurations
Nikhil Jain
 
Cent os 5.1 - configuring samba 3.0 to use the ads security mode
Cent os 5.1  - configuring samba 3.0 to use the ads security modeCent os 5.1  - configuring samba 3.0 to use the ads security mode
Cent os 5.1 - configuring samba 3.0 to use the ads security mode
B Sasi Kumar
 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Beni Krisbiantoro
 
Building a moat bastion server
Building a moat   bastion serverBuilding a moat   bastion server
Building a moat bastion server
nseemiller
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
tutorialsruby
 

Mais procurados (20)

55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines
 
Document Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSDocument Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OS
 
Apache1.ppt
Apache1.pptApache1.ppt
Apache1.ppt
 
Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installation
 
Lession2 Xinetd
Lession2 XinetdLession2 Xinetd
Lession2 Xinetd
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands
 
Apache installation and configurations
Apache installation and configurationsApache installation and configurations
Apache installation and configurations
 
How lve stats2 works for you and your customers
How lve stats2 works for you and your customersHow lve stats2 works for you and your customers
How lve stats2 works for you and your customers
 
Samba 4 - debian instalacao
Samba 4 - debian instalacaoSamba 4 - debian instalacao
Samba 4 - debian instalacao
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
 
Readme
ReadmeReadme
Readme
 
Linux con europe_2014_f
Linux con europe_2014_fLinux con europe_2014_f
Linux con europe_2014_f
 
Cent os 5.1 - configuring samba 3.0 to use the ads security mode
Cent os 5.1  - configuring samba 3.0 to use the ads security modeCent os 5.1  - configuring samba 3.0 to use the ads security mode
Cent os 5.1 - configuring samba 3.0 to use the ads security mode
 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
 
Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9
 
Putting some "logic" in LVM.
Putting some "logic" in LVM.Putting some "logic" in LVM.
Putting some "logic" in LVM.
 
Apache Presentation
Apache PresentationApache Presentation
Apache Presentation
 
Building a moat bastion server
Building a moat   bastion serverBuilding a moat   bastion server
Building a moat bastion server
 
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 

Destaque

Micaela Carter Presentation
Micaela Carter PresentationMicaela Carter Presentation
Micaela Carter Presentation
micaelac329
 
Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置
wensheng wei
 
XMLHTTPRequest的属性和方法简介
XMLHTTPRequest的属性和方法简介XMLHTTPRequest的属性和方法简介
XMLHTTPRequest的属性和方法简介
wensheng wei
 
【转】CVS使用手册
【转】CVS使用手册【转】CVS使用手册
【转】CVS使用手册
wensheng wei
 
Tomcat源码学习1
Tomcat源码学习1Tomcat源码学习1
Tomcat源码学习1
wensheng wei
 
数据库系统防黑客入侵技术综述
数据库系统防黑客入侵技术综述数据库系统防黑客入侵技术综述
数据库系统防黑客入侵技术综述
wensheng wei
 
我的最小项目管理工具集
我的最小项目管理工具集我的最小项目管理工具集
我的最小项目管理工具集
wensheng wei
 
十张叫做幸福的图片
十张叫做幸福的图片十张叫做幸福的图片
十张叫做幸福的图片
wensheng wei
 
Twitter新手使用教程
Twitter新手使用教程Twitter新手使用教程
Twitter新手使用教程
wensheng wei
 
PHP-Debug-Manual-public
PHP-Debug-Manual-publicPHP-Debug-Manual-public
PHP-Debug-Manual-public
wensheng wei
 
信息时代的组合数学
信息时代的组合数学信息时代的组合数学
信息时代的组合数学
wensheng wei
 
Linux安全配置终极指南
Linux安全配置终极指南Linux安全配置终极指南
Linux安全配置终极指南
wensheng wei
 
MVC详解:了解真正所谓的
MVC详解:了解真正所谓的MVC详解:了解真正所谓的
MVC详解:了解真正所谓的
wensheng wei
 
常用数据库的链接方法
常用数据库的链接方法常用数据库的链接方法
常用数据库的链接方法
wensheng wei
 
The Most Important Algorithms
The Most Important AlgorithmsThe Most Important Algorithms
The Most Important Algorithms
wensheng wei
 
Ubuntu 下安装 svn 服务器
Ubuntu 下安装 svn 服务器Ubuntu 下安装 svn 服务器
Ubuntu 下安装 svn 服务器
wensheng wei
 
部分PHP问题总结[转贴]
部分PHP问题总结[转贴]部分PHP问题总结[转贴]
部分PHP问题总结[转贴]
wensheng wei
 
管理员必备的20个 Linux系统监控工具
管理员必备的20个 Linux系统监控工具管理员必备的20个 Linux系统监控工具
管理员必备的20个 Linux系统监控工具
wensheng wei
 

Destaque (18)

Micaela Carter Presentation
Micaela Carter PresentationMicaela Carter Presentation
Micaela Carter Presentation
 
Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置
 
XMLHTTPRequest的属性和方法简介
XMLHTTPRequest的属性和方法简介XMLHTTPRequest的属性和方法简介
XMLHTTPRequest的属性和方法简介
 
【转】CVS使用手册
【转】CVS使用手册【转】CVS使用手册
【转】CVS使用手册
 
Tomcat源码学习1
Tomcat源码学习1Tomcat源码学习1
Tomcat源码学习1
 
数据库系统防黑客入侵技术综述
数据库系统防黑客入侵技术综述数据库系统防黑客入侵技术综述
数据库系统防黑客入侵技术综述
 
我的最小项目管理工具集
我的最小项目管理工具集我的最小项目管理工具集
我的最小项目管理工具集
 
十张叫做幸福的图片
十张叫做幸福的图片十张叫做幸福的图片
十张叫做幸福的图片
 
Twitter新手使用教程
Twitter新手使用教程Twitter新手使用教程
Twitter新手使用教程
 
PHP-Debug-Manual-public
PHP-Debug-Manual-publicPHP-Debug-Manual-public
PHP-Debug-Manual-public
 
信息时代的组合数学
信息时代的组合数学信息时代的组合数学
信息时代的组合数学
 
Linux安全配置终极指南
Linux安全配置终极指南Linux安全配置终极指南
Linux安全配置终极指南
 
MVC详解:了解真正所谓的
MVC详解:了解真正所谓的MVC详解:了解真正所谓的
MVC详解:了解真正所谓的
 
常用数据库的链接方法
常用数据库的链接方法常用数据库的链接方法
常用数据库的链接方法
 
The Most Important Algorithms
The Most Important AlgorithmsThe Most Important Algorithms
The Most Important Algorithms
 
Ubuntu 下安装 svn 服务器
Ubuntu 下安装 svn 服务器Ubuntu 下安装 svn 服务器
Ubuntu 下安装 svn 服务器
 
部分PHP问题总结[转贴]
部分PHP问题总结[转贴]部分PHP问题总结[转贴]
部分PHP问题总结[转贴]
 
管理员必备的20个 Linux系统监控工具
管理员必备的20个 Linux系统监控工具管理员必备的20个 Linux系统监控工具
管理员必备的20个 Linux系统监控工具
 

Semelhante a Ubuntu安装SVN总结

Subversion on-the-fly replication
Subversion on-the-fly replicationSubversion on-the-fly replication
Subversion on-the-fly replication
normanmaurer
 
ByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalived
redhat9
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 
Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)
Conrad Cruz
 
Aeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filteringAeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filtering
Conrad Cruz
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Carlos Sanchez
 
R hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopR hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing Hadoop
Aiden Seonghak Hong
 

Semelhante a Ubuntu安装SVN总结 (20)

Subversion on-the-fly replication
Subversion on-the-fly replicationSubversion on-the-fly replication
Subversion on-the-fly replication
 
ByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalived
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)
 
Aeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filteringAeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filtering
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 
Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
 
Lumen
LumenLumen
Lumen
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
 
R hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopR hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing Hadoop
 
BuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopBuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec Workshop
 
Professional deployment
Professional deploymentProfessional deployment
Professional deployment
 
Null bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web ApplicationNull bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web Application
 
Server hardening
Server hardeningServer hardening
Server hardening
 
Svn Subversion
Svn SubversionSvn Subversion
Svn Subversion
 
Installing Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu InstanceInstalling Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu Instance
 

Mais de wensheng wei

你会柔软地想起这个校园
你会柔软地想起这个校园你会柔软地想起这个校园
你会柔软地想起这个校园
wensheng wei
 
几米语录(1)
几米语录(1)几米语录(1)
几米语录(1)
wensheng wei
 
高级PHP应用程序漏洞审核技术
高级PHP应用程序漏洞审核技术高级PHP应用程序漏洞审核技术
高级PHP应用程序漏洞审核技术
wensheng wei
 
存储过程编写经验和优化措施
存储过程编写经验和优化措施存储过程编写经验和优化措施
存储过程编写经验和优化措施
wensheng wei
 
CentOS5 apache2 mysql5 php5 Zend
CentOS5 apache2 mysql5 php5 ZendCentOS5 apache2 mysql5 php5 Zend
CentOS5 apache2 mysql5 php5 Zend
wensheng wei
 
Happiness is a Journey
Happiness is a JourneyHappiness is a Journey
Happiness is a Journey
wensheng wei
 
Java JNI 编程进阶
Java JNI 编程进阶     Java JNI 编程进阶
Java JNI 编程进阶
wensheng wei
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:
wensheng wei
 
Java正则表达式详解
Java正则表达式详解Java正则表达式详解
Java正则表达式详解
wensheng wei
 
Linux Security Quick Reference Guide
Linux Security Quick Reference GuideLinux Security Quick Reference Guide
Linux Security Quick Reference Guide
wensheng wei
 
Android模拟器SD Card映像文件使用方法
Android模拟器SD Card映像文件使用方法Android模拟器SD Card映像文件使用方法
Android模拟器SD Card映像文件使用方法
wensheng wei
 
如何硬盘安装ubuntu8.10
如何硬盘安装ubuntu8.10如何硬盘安装ubuntu8.10
如何硬盘安装ubuntu8.10
wensheng wei
 
数据库设计方法、规范与技巧
数据库设计方法、规范与技巧数据库设计方法、规范与技巧
数据库设计方法、规范与技巧
wensheng wei
 
揭秘全球最大网站Facebook背后的那些软件
揭秘全球最大网站Facebook背后的那些软件揭秘全球最大网站Facebook背后的那些软件
揭秘全球最大网站Facebook背后的那些软件
wensheng wei
 
mysql的字符串函数
mysql的字符串函数mysql的字符串函数
mysql的字符串函数
wensheng wei
 
入门-Java运行环境变量的图文教程
入门-Java运行环境变量的图文教程入门-Java运行环境变量的图文教程
入门-Java运行环境变量的图文教程
wensheng wei
 

Mais de wensheng wei (20)

你会柔软地想起这个校园
你会柔软地想起这个校园你会柔软地想起这个校园
你会柔软地想起这个校园
 
几米语录(1)
几米语录(1)几米语录(1)
几米语录(1)
 
我的简历
我的简历我的简历
我的简历
 
高级PHP应用程序漏洞审核技术
高级PHP应用程序漏洞审核技术高级PHP应用程序漏洞审核技术
高级PHP应用程序漏洞审核技术
 
存储过程编写经验和优化措施
存储过程编写经验和优化措施存储过程编写经验和优化措施
存储过程编写经验和优化措施
 
CentOS5 apache2 mysql5 php5 Zend
CentOS5 apache2 mysql5 php5 ZendCentOS5 apache2 mysql5 php5 Zend
CentOS5 apache2 mysql5 php5 Zend
 
Happiness is a Journey
Happiness is a JourneyHappiness is a Journey
Happiness is a Journey
 
Java JNI 编程进阶
Java JNI 编程进阶     Java JNI 编程进阶
Java JNI 编程进阶
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:
 
Java正则表达式详解
Java正则表达式详解Java正则表达式详解
Java正则表达式详解
 
Linux Security Quick Reference Guide
Linux Security Quick Reference GuideLinux Security Quick Reference Guide
Linux Security Quick Reference Guide
 
issue35 zh-CN
issue35 zh-CNissue35 zh-CN
issue35 zh-CN
 
Android模拟器SD Card映像文件使用方法
Android模拟器SD Card映像文件使用方法Android模拟器SD Card映像文件使用方法
Android模拟器SD Card映像文件使用方法
 
Subversion FAQ
Subversion FAQSubversion FAQ
Subversion FAQ
 
如何硬盘安装ubuntu8.10
如何硬盘安装ubuntu8.10如何硬盘安装ubuntu8.10
如何硬盘安装ubuntu8.10
 
ubunturef
ubunturefubunturef
ubunturef
 
数据库设计方法、规范与技巧
数据库设计方法、规范与技巧数据库设计方法、规范与技巧
数据库设计方法、规范与技巧
 
揭秘全球最大网站Facebook背后的那些软件
揭秘全球最大网站Facebook背后的那些软件揭秘全球最大网站Facebook背后的那些软件
揭秘全球最大网站Facebook背后的那些软件
 
mysql的字符串函数
mysql的字符串函数mysql的字符串函数
mysql的字符串函数
 
入门-Java运行环境变量的图文教程
入门-Java运行环境变量的图文教程入门-Java运行环境变量的图文教程
入门-Java运行环境变量的图文教程
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Ubuntu安装SVN总结

  • 1. Installation of Subversion on Ubuntu, with Apache, SSL, and BasicAuth. 1。安装 subversion 和 apache2 的组件(已经认为您已经安装了 apache2), sudo apt-get install subversion libapache2-svn 在/etc/apache2/mods-enabled 中会多出来一下几个链接文件(实际文件在 mods-available 中,我们不需要去 管,只需要关注 enabled 目录就成): dav_fs.load dav_svn.conf dav_fs.conf dav.load dav_svn.load 2。建立 svn 数据库 a. 只建立一个仓库: sudo svnadmin create /var/svn ls /var/svn 你将得到这样的结果,则说明建立成功 conf dav db format hooks locks README.txt sudo chown -R root:svn /var/svn sudo chmod -R g+rws /var/svn # 给 svn 组赋予读写权限,可以根据需要更改相应权限 sudo chmod -R o-rwx /var/svn # 删除其他无关人员的读、写、执行权限,默认情况下可能其他人有读权限 # 注:有关权限修改的问题可以查看相关 linux 命令 b.建立多个仓库($REPOS 是自己定义的仓库名称): sudo mkdir /var/svn sudo svnadmin create /var/svn/$REPOS sudo chown -R root:svn /var/svn /$REPOS sudo chmod -R g+rws /var/svn/$REPOS # 给 svn 组赋予读写权限,可以根据需要更改相应权限 sudo chmod -R o-rwx /var/svn/$REPOS # 删除其他无关人员的读、写、执行权限,默认情况下可能其他人有读权 限 ls /var/svn/$REPOS
  • 2. 你将得到这样的结果,则说明建立成功 conf dav db format hooks locks README.txt #注意:建立一个仓库时/etc/apache2/mods-enabled/dav_svn.conf (步骤 3) 应该注释掉 SVNParentPath:/var/svn 行,而去掉 SVNPath /var/svn 前面的注释。 3。配置 apache cd /etc/apache2/mods-enabled sudo vi dav_svn.conf 按照提示去掉一些文件注释,最终的文件看起来如下 # dav_svn.conf - Example Subversion/Apache configuration # # For details and further options see the Apache user manual and # the Subversion book. # # NOTE: for a setup with multiple vhosts, you will want to do this # configuration in /etc/apache2/sites-available/*, not here. # <Location URL> ... </Location> # URL controls how the repository appears to the outside world. # In this example clients access the repository as http://hostname/svn/ # Note, a literal /svn should NOT exist in your document root. <Location /svn> # Uncomment this to enable the repository DAV svn # Set this to the path to your repository #SVNPath /var/svn # Alternatively, use SVNParentPath if you have multiple repositories under
  • 3. # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...). # You need either SVNPath and SVNParentPath, but not both. SVNParentPath /var/svn # 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" 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
  • 4. # SSLRequireSSL #</LimitExcept> </Location> 或者象这样来实现独立的域名情况: <VirtualHost 127.0.0.10> ServerName svn.rollenc.com DocumentRoot /var/svn <Location /> DAV svn SVNPath /var/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location> </VirtualHost> 4。建立密码文件 建立第一个用户需要加-c 参数 sudo htpasswd2 -c /etc/apache2/dav_svn.passwd username 输入两次密码 建立其他用户: sudo htpasswd2 /etc/apache2/dav_svn.passwd username2 注意没有加-c,加-c 的话会清除掉以前存在的密码。 如果 username2 为已存在用户,那这句命令的意义就是修改密码
  • 5. 5.重启 apache sudo apache2 -k restart 如果一切正常的话,使用浏览器打开 http://127.0.0.1/svn 应该看到如下信息 Revision 0: / Powered by Subversion version 1.3.1 (r19032). OK,安装完成 你可以对他进行一些 import,commit 等操作了 导入版本的文件框架 mkdir -p tmp/lab.rollenc.com/trunk tmp/eemap/trunk #如果你有其他已经写好的需要一起导入的文件,cp 过来让 在相应的 trunk 目录下,然后下一步。 svn import tmp http://127.0.0.10/ #更具提示输入 message 信息和用户,密码。 我在实验时发现有权限问题,这是你可能需要修改/var/svn 的权限为可读写 sudo chmod -R 777 /var/svn 然后再继续执行上面的 import 操作。 现在使用浏览器打开 http://127.0.0.10,可以得到 Revision 1: / * eemap/ * lab.rollenc.com/ 继续 checkout 和 commit 吧,祝你有一个愉快的 subversion。 Defined tags for this entry: subversion, Ubuntu, 技术 作者 rollenc 6.完善成为 https 的方式访问 SVN a.加载 ssl 模块 sudo a2enmod ssl
  • 6. b .生成认证证书 sudo apt-get install ssl-cert sudo mkdir /etc/apache2/ssl sudo /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem ls -l /etc/apache2/sites-available 你看到有一个 default-ssl 文件,则说明生成成功 c 创建虚拟主机($SITENAME 为你的站点名称) sudo cp /etc/apache2/sites-available/default-ssl /etc/apache2/sites-available/$SITENAME sudo vim /etc/apache2/sites-available/$SITENAME add:(保证你看到下面两行) SSLEngine on SSLCertificateFile /etc/apache2/ssl/apache.pem sudo a2ensite $SITENAME d 配置 apache,使 WebDAV and SVN 可用 cd /etc/apache2/mods-enabled sudo vim dav_svn.conf add: SSLRequireSSL e.配置成功 sudo /etc/init.d/apache2 restart 利用 Tortoise SVN 可检出仓库:https://yourServerIp/svn/$REPOS 如果出现如下错误: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443 解决方法: 1、netstat -tuln | grep :443 看端口是否开启 2、sudo less /etc/apache2/ports.conf 是否写了两个 Listen 443
  • 7. 测试: 网页访问: lynx https://localhost/svn/$REPOS exposes the repository. lynx http://localhost/svn/$REPOS says: eat my shorts , i.e. 403-forbidden. 一个初始化导入: svn import --username $AUTH_USER $A_FILE https://localhost/svn/$REPOS/testdir -m “Testing” 检出: svn co --username $AUTH_USER https://localhost/svn/$REPOS 按照步骤 2 的 b 方法 可以重复添加多个仓库 Above all, check the great SVN Book.