开发者

Problems Getting Subversion + Apache to Work

开发者 https://www.devze.com 2023-01-23 15:19 出处:网络
Following the instructions in this helpful guide, I\'ve been attempting to set up Subversion on my site, using Apache instead of svnserve. Once everything is set up, I\'ll have a repository at /srv/sv

Following the instructions in this helpful guide, I've been attempting to set up Subversion on my site, using Apache instead of svnserve. Once everything is set up, I'll have a repository at /srv/svn/myrepository that is accessible from code.mydomain.com.

However, after following all of the instructions in the guide linked above, visiting code.mydomain.com displays the contents of the Ap开发者_如何转开发ache default site, /var/www (i.e., "It works!"). This also generates the following error in my Apache log:

[Sat Nov 06 10:11:33 2010] [notice] caught SIGTERM, shutting down
[Sat Nov 06 10:11:34 2010] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Sat Nov 06 10:11:34 2010] [notice] mod_python: using mutex_directory /tmp
[Sat Nov 06 10:11:34 2010] [notice] Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 mod_jk/1.2.26 PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 configured -- resuming normal operations

Here's an edited version of my site configuration:

<VirtualHost my.server.ip:80>
        ServerAdmin me@mydomain.com
        ServerName code.mydomain.com
        ErrorLog /srv/www/code.mydomain.com/logs/error.log
        CustomLog /srv/www/code.mydomain.com/logs/access.log combined

        <Location />
                DAV svn
                SVNPath /srv/svn/myrepository

                AuthType Basic
                AuthName "Subversion Repository"
                AuthUserFile /srv/auth/svn/myrepository.htpasswd
                Require valid-user
        </Location>
</VirtualHost>

Thanks in advance for any assistance that you're able to provide!


Here are the results of some troubleshooting that I've done per the suggestions of other users (thanks very much). In each case, I restarted Apache after making the change, then checked the site to verify the results:

0) I am not connecting via SSL.

1) SVNParentPath is only necessary when multiple repositories are in use-- here, I'm only using one. Nevertheless, I re-did my configuration using SVNParentPath as a test, and got the same result.

2) I attempted to put the Auth options inside a Limit stanza, and got the same result. I then removed all of the Auth options, but got the same result.

3) Having removed all Auth options from the configuration file and received the same result, I don't think this is related to an authorization module; nevertheless, I can confirm that although I do have the dav_svn module loaded, I don't have the authz_svn module loaded.

4) I had already created the repository in the location /srv/svn/myrepository . I ran svnadmin verify on that location, and the tool reported that all is well.

5) I'm on Debian 5, where Apache runs as www-data; and prior to this I had given www-data:www-data ownership of /srv/svn as well as /srv/svn/myrepository . I ran stat on those directories to verify this.

6) Pinging code.mydomain.com shows that it is indeed resolving to the correct IP

7) I ran a2ensite code.mydomain.com, which apparently had not been done (oops), and restarted Apache. The folder /srv/www/code.mydomain.com/logs now contains access.log and error.log, but both files remain empty. Meanwhile, attempting to access code.mydomain.com produces the same result as before, and the default Apache error.log contains the same error messages as before.

8) None of the Apache configuration files contain a NameVirtualHost *:80 line.


first of all check that you are going to http and not https.

I am using centos 5.5. comparing my /etc/httpd/conf.d/subversion.conf with what you provide, leads to the following observations.

check:

  1. SVNPath should be SVNParentPath
  2. try commenting out the AuthType, AuthName, AuthUserFile and Require to see if that works. Try enclosing them in:

    <LimitExcept GET PROPFIND OPTIONS REPORT>
    ...
    </LimitExcept>
    
  3. these lines are somewhere

    LoadModule dav_svn_module     modules/mod_dav_svn.so
    LoadModule authz_svn_module   modules/mod_authz_svn.so
    
  4. that you have done

    svnadmin create /srv/svn/myrepository
    
  5. that you have done

    chown -R apache.apache /srv/svn/myrepository
    

    (if you are on debian/ubuntu apache.apache would be www-data:www-data).

it seems you should not put these things in the file /etc/apache2/sites-available/code.domain.com, instead you should be editing /etc/apache2/mods-available/dav_svn.conf (it should already be there and contain more or less the same things that you are trying to put in the site conf file. remove all the duplicate things from the site conf file).

you will need to put a path in the location, /svn.


I think you just need to make sure the svn sites virtual domain stays on the top of the hierarchy. By default debian systems have the default port configured to the default domain. you might want to change it specific to the domain.

check this link http://www.daniweb.com/forums/thread268331.html for some detailed instructions.

The last line "sudo a2ensite svn.example.com" would be important.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号