Home >System Tutorial >LINUX >Detailed explanation: SVN cooperates with Apache under Centos6.6

Detailed explanation: SVN cooperates with Apache under Centos6.6

WBOY
WBOYforward
2024-05-04 08:13:19564browse

Detailed explanation: SVN cooperates with Apache under Centos6.6

Install svn and Apache
yum install -y httpd httpd-devel subversion mod_dav_svn
Make sure the svn module has been installed: mod_dav_svn
#cd /etc/httpd/modules            
#ls | grep svn 
mod_authz_svn.so
mod_dav_svn.so
Confirm that svn has been installed
#svn- -version
SVN configuration

Go to the /etc/httpd/conf.d directory and use vim to open the subversion.conf configuration file to modify the options
Module configuration must ensure that the following two sentences exist in the configuration file, otherwise the svn warehouse will not be accessible

LoadModuledav_svn_module     modules/mod_dav_svn.so 
LoadModuleauthz_svn_module   modules/mod_authz_svn.so
Svn warehouse configuration
# mkdir -p /home/svn
# cd /home/svn
# svnadmin create myapp 
# chown -R apache.apache  myapp        $apache是httped服务的默认用户 
# vi /etc/httpd/conf.d/subversion.conf 加入以下配置 
LoadModuledav_svn_module     modules/mod_dav_svn.so 
LoadModuleauthz_svn_module   modules/mod_authz_svn.so 
<location>
DAV svn
SVNParentPath /svn    仓库目录
SVNListParentPath on  使用多仓库
AuthType Basic
AuthName  "Authorization Realm" 
AuthUserFile /home/svn/svn/httpdpasswd   使用的用户文件
AuthzSVNAccessFile /home/svn/authz    使用的用户配置
Require  valid-user   用户需要验证才能登录
</location>
Create Apathce accessible user information
# htpasswd -c /var/svn/passwd Justin  //创建一个httpd的用户 ,第一次使用需要用 -c 选项
 # servicehttpd restart 
Create user information that can access svn

There is a passwd file under the created SVN warehouse myapp/conf/passwd. Create user information and user password passwd configuration by editing the file.

Permission control authz configuration

There is an authz file under the created SVN warehouse myapp/conf/authzz to configure user permissions

Start svn
svnserve -d -r /home/svn/myapp 
ps aux | grep svn

The above is the detailed content of Detailed explanation: SVN cooperates with Apache under Centos6.6. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linuxprobe.com. If there is any infringement, please contact admin@php.cn delete