简体   繁体   中英

My server IP + all subdirectories are pointing to Subversion (SVN)

I installed a subversion on my server and it's working properly. All my repositories are located at /var/svn/repo1 /var/svn/repo2 etc... My /etc/apache2/sites-available/svn looks this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName svn.myhostname.com
    DocumentRoot /var/svn
    <Directory /var/svn/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    <Location />
        DAV svn
        SVNParentPath /var/svn
        AuthType Basic
        AuthName "Subversion"
        AuthUserFile /etc/subversion/svn-auth
        Require valid-user
    </Location>
    LogLevel warn
    ErrorLog ${APACHE_LOG_DIR}/svn.error.log
    CustomLog ${APACHE_LOG_DIR}/svn.access.log combined
</VirtualHost>

The problem is that when I open a browser and type my IP address or hostname they both point to SVN for some reason. For example, when I type only my IP the browser says "A username and password are being requested by MYIPADDRESS. The site says: "Subversion"". I think the only address that should be pointed to SVN would be svn.myipaddress.com, right??

When I type svn.myipaddress/repo1 it shows the repository normally though.

This causes me hard times as I cannot access my IP and open html/php-files there because it asks for SVN password every time.

Any thoughts on this?

Your initial <VirtualHost *:80> is redirecting all requests on port 80 (the standard http port) to the subversion directories. If you change that to something like <VirtualHost *:3690> then standard web requests should work as normal, though you'll need to add the port when accessing the repositories from the client, ie svn co http://repository.url:3690/repo1 in order for subversion commands to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM