test Blog
Happy living

在linux(Ubuntu)下安装subversion

老鼠 posted @ 2009年4月02日 22:24 in web with tags ubuntu Subversion , 2383 阅读

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


sudo apt-get install subversion subversion-tools  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数据库
 


sudo svnadmin create /var/svn 



 

ls /var/svn


你将得到这样的结果,则说明建立成功
 

conf dav db format hooks locks README.txt



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.

# <Location URL> ... </Location>
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/
<Location /svn>

  # Uncomment this to enable the repository,
    DAV svn

  # Set this to the path to your repository
    SVNPath /var/svn

  # The following allows for basic http authentication.  Basic authentication
  # should not be considered secure for any particularly rigorous definition of
  # secure.

  # to create a passwd file
  # # rm -f /etc/apache2/dav_svn.passwd
  # # htpasswd2 -c /etc/apache2/dav_svn.passwd dwhedon
  # New password:
  # Re-type new password:
  # Adding password for user dwhedon
  # #

  # Uncomment the following 3 lines to enable Basic Authentication
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/apache2/dav_svn.passwd

  # Uncomment the following line to enable Authz Authentication
  # AuthzSVNAccessFile /etc/apache2/dav_svn.authz

  # The following three lines allow anonymous read, but make
  # committers authenticate themselves.

  <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  </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。

 

Business Development 说:
2022年8月04日 00:41

Business development executive is one of the most critical roles for any organization. This role demands high communication skills and strategical thinking in order to build business proposals, client connections for business development. Business Development Executive Any Business structure of a company will have a segment or department for Business development for company’s growth and sustainable development. This is a strategic department with high ability in building client business connections and customer trust relationships. Business development executive is one of the most critical roles for any organization. This role demands high communication skills and strategical thinking in order to build business proposals.

TN SSLC Model Paper 说:
2022年8月20日 19:04

Blueprint, TN SSLC Model Paper 2023, Tamil Nadu Chennai Board By merging the Board of Secondary Education and the Board of Higher Secondary Examinations in 2023, the Kalisolai Government of Tamil Nadu established a new board. Samuel Kalvi Here you can get the TN Board 10th SSLC Class Previous Question Paper from 2023 as well as the Tamil Nadu State Board SSLC Previous Year Question Paper. So that Class 10 TN SSLC Model Paper 2023 students can download these papers for use in mock exams leading up to the TN Board 10th Question Paper 2023 , click on the subject you want to read and download the previous years' question papers for.

SBI Payment Billdesk 说:
2023年1月26日 23:07

Paying the credit card dues on time, does ensure you have a good financial transaction and without letting you pay an excess late fee, and SBI Credit Card has a particular due date and paying the due amount by then will also have your credit score undisturbed. SBI Payment Billdesk Having debt is always a high risk and it is always better to pay the dues on time, else your debt will increase and will directly disturb your financial transaction.

Maha Board 1st Clas 说:
2023年9月20日 19:22

Maharashtra Board 1st Class Exam Date Sheet 2024 Available at Official Website. This Maha Board Primary School Exam Attended Every Year More than 50 Laks of Students, MSCE Pune Little Students Studying Maharashtra Class Revised Syllabus 2024 helps Students to Learn Logic and order and hence,Maharashtra Elementary Syllabus 2024 is Designed in Accordance with the NCERT Based Maha Board 1st Class Syllabus 2024 Guidelines and helps Students to get an Overview of the Marathi, English Medium All Subject, Students Should Perform well in the Exam, which is Possible by Understanding the Syllabus and Studying Accordingly.To Prepare well for the Maharashtra Class get Promoted to the next Standard, Understanding of the syllabus of Maharashtra State Board for each subject is essential


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter