当前位置: 首页 > 工具软件 > USVN > 使用案例 >

闭上眼睛安装 debian + apache2.4 + usvn + svn

莫宁
2023-12-01
爱转载的请随意,如果有人用得上才有价值!



1、安装debian,在最后的安装选项选中“标准”、“数据库

2、安装svn

root@debian:/# aptitude install apache2 php5 libapache2-mod-php5mysql-server php5-mysql subversion libapache2-svn

3、配置ssl

root@debian:/#a2enmod ssl

root@debian:/#/etc/init.d/apache2 restart

root@debian:/#a2ensite default-ssl

root@debian:/#/etc/init.d/apache2 reload

4、下载usvn

root@debian:/#mkdir /opt/usvn

root@debian:/#cd /opt/usvn

root@debian:/opt/usvn/#wget https://github.com/usvn/usvn/archive/1.0.7.tar.gz

root@debian:/opt/usvn/#tar xzvf usvn-1.0.7.tar.gz

root@debian:/opt/usvn/#mkdir /usvn

root@debian:/opt/usvn/#mkdir -p /usvn/repo

root@debian:/opt/usvn/# mv 1.0.7 /usvn

root@debian:/opt/usvn/# chown -R www-data:www-data /usvn

 

5、配置

5.1、

root@debian:/# vi /etc/apache2/mods-available/dav_svn.load

LoadModule authz_svn_module/usr/lib/apache2/modules/mod_authz_svn.so

 

5.2、

root@debian:/# vi /etc/apache2/apache2.conf

DEBIAN7APACHE2.2:

Alias /usvn /usvn/public

<Directory "/usvn/public">

    Options +SymLinksIfOwnerMatch

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

DEBIAN8(APACHE2.4):

Alias /usvn /usvn/public

<Directory "/usvn/public">

   Options+SymLinksIfOwnerMatch

   AllowOverrideAll

   #Orderallow,deny

   #Allow from all

   Require allgranted

</Directory>

 

5.3、(debian8,即apache2.4下)

root@debian:/usvn/public# vi .htaccess

<Files *.ini>

#Order Allow,Deny

#Deny from all

Require all denied

</Files>

 

php_flag short_open_tag on

php_flag magic_quotes_gpc off

 

RewriteEngine on

#RewriteCond

RewriteBase "//usvn/"

RewriteRule ^svn/ - [L,NC] #this is the ruleI added to fix the 500 errors

RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

RewriteRule ^.*$ index.php [NC,L]


5.4、

root@debian:/# /etc/init.d/apache2 restart

 

6、安装:

http://x.x.x.x/usvn/install.php

按提示操作即可

 

7、迁移

7.1、备份配置:/usvn/authz、/usvn/htpasswd

7.2、备份环境库:mysqldump -u root -p usvn > usvn.sql

7.3、备份SVN库:svnadmin dump prj > prj.dump

#安装新的环境之后

7.4、恢复配置:/usvn/authz、/usvn/htpasswd

7.4、恢复环境库:mysql -u root -p usvn < usvn.sql

7.5、恢复SVN库:svnadmin create prj

svnadmin load prj < prj.dump

 

 类似资料: