Linux下安装SVN

来源:互联网 发布:怎么加淘宝优惠微信群 编辑:程序博客网 时间:2024/04/30 07:25

 

 

 Linux下安装SVN是我们学习的一个重点,但是方法也很多,若果有一种方法比较能够让我们简洁易懂,而且容易接受,很多会员推荐了一下的方式希望大家大家喜欢

 

2:相关版本
   subversion在安装的时候,要求相关软件的版本一致,而不是说软件版本最新就最好.下面是我安装的相关版本.
httpd-2.2.3.tar.gz ,
subversion-deps-1.4.0.tar.gz
subversion-1.4.0.tar.gz

3:安装准备
mkdir /subversion
cp httpd-2.2.3.tar.gz /subversion/
cp subversion-deps-1.4.0.tar.gz /subversion/
cp subversion-1.4.0.tar.gz /subversion/
cd /subversion/
tar zxvf httpd-2.2.3.tar.gz
tar zxvf subversion-deps-1.4.0.tar.gz
tar zxvf subversion-1.4.0.tar.gz

4:httpd的安装.
cd /subversion/httpd-2.2.3
./configure --prefix=/usr/local/apache2 --enable-so --enable-dav
make && make install
cd /usr/local/apache2/bin/
./apachectl start
这个时候,打开浏览器,输入http://localhost/,如果浏览器出现It Works,则说明httpd安装成功了.

5:subversion的安装
cd /subversion/subversion-1.4.0
./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apache2/ --with-apr-util=/usr/local/apache2/ --prefix=/usr/local/subversion --with-ssl --with-zlib --enable-maintianer-mode 
make && make install

6:建立和导入版本库
[root@localhost subversion-1.4.0]# cd /usr/local/subversion/bin/
[root@localhost bin]# mkdir /repository
[root@localhost bin]# ./svnadmin create --fs-type fsfs /repository/test
[root@localhost bin]# ls /repository/test/   
//如果ls /repository/test/ 出现了下面的内容,就说明subversion安装成功了.
conf   dav   db   format   hooks   locks   README.txt
[root@localhost bin]# ./svn import /root/src/ file:///repository/test/ -m "initial import"
//命令成功执行,会有如下的提示信息,.
新增           /root/src/main.cpp
提交后的修订版为 1。

7:修改权限
[root@localhost bin]# cd /repository/test/
[root@localhost test]# chmod -R 777 *
8:修改Apache的配置文件 
1):打开httpd.conf文件
[root@localhost test]# gedit /usr/local/apache2/conf/httpd.conf &
2):修改httpd.conf文件,在文件的最后添加下面几行
<Location /svn>
DAV svn
SVNParentPath /repository/
</Location>
3):保存退出

9:重启apache服务.
[root@localhost bin]# cd /usr/local/apache2/bin/
[root@localhost bin]# ./apachectl stop
[root@localhost bin]# ./apachectl start

起动
/usr/bin/svnserve -d -r /myproject/project