我最近遇到了 403 错误问题,此处的答案已解决
但是我有 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/sites-enabled/000-default
<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>