Frage

I have recently had the 403 error issue which was resolved by the answer here

However I have 2 domains pointing to my home server, problem is both of them show the repository

so www.domain1.com/repos and www.domain2.com/repos show the repository, but I only want www.domain2.com/repos to show it.

How can this be achieved? I tried adding the location from dav_svn.conf into my 000-default file but this didn't work, I also want to force https. Any suggestions?

/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>
War es hilfreich?

Lösung

If you want to have SVN only in one virtual host, you have to add <Location> container only inside container of this virtual host.

Now mods-enabled/dav_svn.conf is added to "main" site and shared all virthosts

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top