linux SVN服务迁徙,指标服务器Red Hat8
步骤如下:
- 进行SVN服务
- 装置
- 迁徙
- 配置
- 启动
装置
yum install php httpd subversion policycoreutils-python-utils mod_dav_svn -y
迁徙
- 将仓库文件拷贝到/var/www/svn/repos
- 将SVN配置文件拷贝/var/www/svn/config
- 将SVNadmin拷贝到/var/www/html/svnadmin
配置
权限配置
chown -R apache.apache /var/www/html/svnadminchmod 777 /var/www/html/svnadmin/datachown -R apache.apache /var/www/svn
Selinx配置
- 简略粗犷 seenforce 0 长期敞开,可用于测试是否是因为这个权限导致无法访问
配置平安上下文
semanage fcontext -a -t httpd_sys_content_t "/var/www(/.*)?"restorecon -Rv /var/www/html/svnadminrestorecon -Rv /var/www/svn
文件配置
1.
vi /etc/sysconfig/svnserve
OPTIONS="-r /var/www/svn/repos"
2.
vi /var/www/html/svnadmin/data/config.ini
[Common]FirstStart=0BackupFolder=./data/backup/[Translation]Directory=./translations/[Engine:Providers]AuthenticationStatus=basicUserViewProviderType=passwdUserEditProviderType=passwdGroupViewProviderType=svnauthfileGroupEditProviderType=svnauthfileAccessPathViewProviderType=svnauthfileAccessPathEditProviderType=svnauthfileRepositoryViewProviderType=svnclientRepositoryEditProviderType=svnclient[ACLManager]UserRoleAssignmentFile=./data/userroleassignments.ini[Subversion]SVNAuthFile=/var/www/svn/config/authz[Repositories:svnclient]SVNParentPath=/var/www/svn/reposSvnExecutable=/usr/bin/svnSvnAdminExecutable=/usr/bin/svnadmin[Users:passwd]SVNUserFile=/var/www/svn/config/passwd[Users:digest]SVNUserDigestFile=SVNDigestRealm=SVN Privat[Ldap]HostAddress=ldap://192.168.136.130:389/ProtocolVersion=3BindDN=CN=Manuel Freiholz,CN=Users,DC=insanefactory,DC=comBindPassword=rootCacheEnabled=falseCacheFile=./data/ldap.cache.json[Users:ldap]BaseDN=DC=insanefactory,DC=comSearchFilter=(&(objectClass=person)(objectClass=user))Attributes=sAMAccountName[Groups:ldap]BaseDN=DC=insanefactory,DC=comSearchFilter=(objectClass=group)Attributes=sAMAccountNameGroupsToUserAttribute=memberGroupsToUserAttributeValue=distinguishedName[Update:ldap]AutoRemoveUsers=trueAutoRemoveGroups=true[GUI]RepositoryDeleteEnabled=falseRepositoryDumpEnabled=falseAllowUpdateByGui=true
3.
vi /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so## Example configuration to enable HTTP access for a directory# containing Subversion repositories, "/var/www/svn". Each repository# must be both:## a) readable and writable by the 'apache' user, and## b) labelled with the 'httpd_sys_content_t' context if using# SELinux### To create a new repository "http://localhost/repos/stuff" using# this configuration, run as root:## # cd /var/www/svn# # svnadmin create stuff# # chown -R apache.apache stuff# # chcon -R -t httpd_sys_content_t stuff##<Location /repos># DAV svn# SVNParentPath /var/www/svn## #Limit write permission to list of valid users.# <LimitExcept GET PROPFIND OPTIONS REPORT># # Require SSL connection for password protection.# # SSLRequireSSL## AuthType Basic# AuthName "Authorization Realm"# AuthUserFile /path/to/passwdfile# Require valid-user# </LimitExcept>#</Location><Location /svn>DAV svnSVNParentPath /var/www/svn/reposSVNLISTParentPath onAuthType BasicAuthName "Authorization Realm"AuthUserFile /var/www/svn/config/passwdAuthzSVNAccessFile /var/www/svn/config/authzRequire valid-user</Location>
启动
systemctl enable svnservesystemctl start svnservesystemctl enable httpdsystemctl start httpd
问题
- svnadmin拜访显示如下
vi /var/www/html/svnadmin/include/config.inc.php
正文掉如下代码
- svnadmin拜访显示文件夹层级,而不是解析的php页面
启动php-fpm - 能拜访到/svn,然而不能拜访/svn下的我的项目
查看authz文件,权限可能有问题