我最近遇到了403错误问题,该问题已由答案here
解决但是我有2个域指向我的家庭服务器,问题是它们都显示存储库
所以www.domain1.com/repos
和www.domain2.com/repos
会显示存储库,但我只希望www.domain2.com/repos
显示它。
如何实现这一目标?我尝试将dav_svn.conf
中的位置添加到我的000-default
文件中,但这不起作用,我也想强制使用https。有什么建议吗?
/etc/apache2/mods-enabled/dav_svn.conf
<Location /repos>
DAV svn
SVNParentPath /var/svn
SVNListParentPAth on
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
的/ etc / apache2的/启用的站点 - / 000-默认
<VirtualHost *:80>
ServerAdmin me@domain.com
ServerName domain1.com
DocumentRoot /var/www/domain1.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/domain1.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/domain1.error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/domain1.access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@domain2.com
ServerName domain2.com
DocumentRoot /var/www/domain2.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/domain2.com/>
Options FollowSymLinks Indexes Multiviews
AllowOverride none
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@domain1.com
ServerName domain1.com
DocumentRoot /var/www/domain1.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/domain1.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/domain1.com.key
SSLProtocol all
SSLCertificateKeyFile /etc/apache2/ssl/domain1.com.key
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@domain2.com
ServerName domain2.com
<Location repos/>
DAV svn
SVNParentPath /var/svn/
AuthType Basic
AuthName "Repository of Ancient Knowledge"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
DocumentRoot /var/www/domain2.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/domain2.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/domain2.com.key
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
</VirtualHost>
答案 0 :(得分:1)
如果您只想在一个虚拟主机中安装SVN,则必须在此虚拟主机的容器内添加<Location>
容器 。
现在 mods-enabled / dav_svn.conf 已添加到“主”网站并共享所有virthosts