1: Install apache http server
yum httpd
2: View the installation directory
rpm -ql httpd | cat -n
will see the relevant value
/etc/httpd/conf/httpd.conf
/usr/bin/htpasswd
/usr/sbin/apachectl
/usr/lib/httpd/modules
3: Start the apache http server and check if the installation is successful
/usr/sbin/apachectl start
Visit http://XXXXXX/
4: Install subversion
yum subversion
svnserve --version
5: Check whether the svn module is installed under apache
cd /etc/httpd/modules ls | grep mod_dav_svn.so ls | grep mod_authz_svn.so
If not, you need to install
yum install mod_dav_svn
Then check whether there are mod_dav_svn.so, mod_authz_svn.so in the modules directory
6: Code base creation
cd opt mkdir -p svn / pinganfu / paff svnadmin create /opt/svn/pinganfu/paff
7: apache configure svn
Add in httpd.conf file
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /pinganfu> DAV svn SVNParentPath "/opt/svn/pinganfu" SVNListParentPath on AuthType Basic AuthName "Welcome to Pinganfu Paff SVN" #AuthzSVNAccessFile "/opt/svn/pinganfu/authz" AuthUserFile "/opt/svn/pinganfu/passwd" Require valid-user </Location>keep, restart apache
/usr/sbin/apachectl restartif it appears
[Tue Aug 06 20:01:45 2013] [warn] module dav_svn_module is already loaded, skipping [Tue Aug 06 20:01:45 2013] [warn] module authz_svn_module is already loaded, skippingIndicates that dav_svn_module and authz_svn_module have been loaded, delete the LoadModule item in the httpd.conf file
8: Add svn user
In step 7, the AuthUserFile address has been configured, and the commented out AuthzSVNAccessFile, the following is to create the two files of authz and passwd
/usr/bin/htpasswd -cm /opt/svn/pinganfu/passwd adminAfter executing the above command to create, output the password
vi / opt / svn / pinganfu / authz
9: Change the permissions of the svn library (important here)
Change the /opt/svn/pinganfu/paff directory to the apache user and the apache user group
chown -R apache: apache paff chown apache:apache authz chown apache:apache passwd
chmod -R 777 paff
由于RHEL5中引入了SELinux来加安全控制,因此还需要对该路径进行赋权。(整个路径的目录都要赋权, 如:要访问/opt/svn/pinganfu/paff/,则从/opt开始都要赋权)
如果不赋权,会出现 Can't open file '/opt/svn/pinganfu/paff/db/txn-current-lock': Permission denied 这样的错误
chcon -R -h -t httpd_sys_content_t /opt/svn/pinganfu/paff/
10:访问,添加文件