You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Andy Canfield <an...@pimco.mobi> on 2011/07/17 08:06:45 UTC

Subversion: via Apache

WHOA! Near as I can tell, if you have an apache2 server offering web sites
http://example.com/alpha
http://example.com/beta
http://example.com/gamma
and you configure the apache2 web server for Subversion support, 
suddenly you can no longer access alpha and beta and gamma. DOES 
SUBVERSION TAKE OVER THE ENTIRE APACHE SERVER????? Apparently so. Yet 
the book makes no mention of this!

Well, we can not have subversion stealing our apache server; after all 
we plan to use subversion to maintain a web site being hosted by that 
very server. So we'll have to use svnserve.

Re: Subversion: via Apache

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Mon, Jul 18, 2011 at 4:50 AM, Dave Huang <kh...@azeotrope.org> wrote:
> On 7/18/2011 3:43 AM, Andy Canfield wrote:
>>
>> On 07/18/2011 09:34 AM, Geoff Hoffman wrote:
>>>
>>> Test your config with -t
>>
>> Option "-t" on what command line? "-t" for svnserve means "tunnel";
>> svnadmin and svn have no -t option.
>
> This thread is about "Subversion: via Apache", so the Apache commandline :)
>
> Usage: httpd [-D name] [-d directory] [-f file]
>             [-C "directive"] [-c "directive"]
>             [-k start|restart|graceful|graceful-stop|stop]
>             [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]
> Options:
> [...]
>  -t                 : run syntax check for config files

Some httpd setups provide this in the init script, an
"/etc/init.d/httpd configtest" option. Be careful to tease out the
actual init options used by your init script: Debian hides a lot of
them in /etc/default/apache2, for example.

Re: Subversion: via Apache

Posted by Dave Huang <kh...@azeotrope.org>.
On 7/18/2011 3:43 AM, Andy Canfield wrote:
>
> On 07/18/2011 09:34 AM, Geoff Hoffman wrote:
>> Test your config with -t 
>
> Option "-t" on what command line? "-t" for svnserve means "tunnel"; 
> svnadmin and svn have no -t option.
This thread is about "Subversion: via Apache", so the Apache commandline :)

Usage: httpd [-D name] [-d directory] [-f file]
              [-C "directive"] [-c "directive"]
              [-k start|restart|graceful|graceful-stop|stop]
              [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]
Options:
[...]
   -t                 : run syntax check for config files


Re: Subversion: via Apache

Posted by Andy Canfield <an...@pimco.mobi>.
On 07/18/2011 09:34 AM, Geoff Hoffman wrote:
> Test your config with -t 

Option "-t" on what command line? "-t" for svnserve means "tunnel"; 
svnadmin and svn have no -t option.


Re: Subversion: via Apache

Posted by Geoff Hoffman <gh...@cardinalpath.com>.
Test your config with -t

Re: Subversion: via Apache

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Sun, Jul 17, 2011 at 11:07 PM, Les Mikesell <le...@gmail.com> wrote:
> On 7/17/11 9:41 PM, Andy Levy wrote:
>>
>> Rather than trying to figure out what versions you have now, just
>> remove what you have&  replace with a version compiled with an APR
>> version that matches your Apache installation. If you installed both
>> Subversion&  Apache via your distro's packaging system, this should
>> have all been taken care of for you.
>
> The packages may depend on the distribution.  For example, for Red Hat or
> Centos it would be httpd, subversion, and mod_dav_svn, and you'd get a
> snippet of the httpd config in /etc/httpd/conf.d/subversion.conf where you
> can customize the setup.

The reference to "/etc/apache2/httpd.conf" indicates that it's
probably Debian or Ubunty. Red Hat correctly refers to it as "httpd".

> --
>  Les Mikesell
>   lesmikesell@gmail.com
>

Re: Subversion: via Apache

Posted by Les Mikesell <le...@gmail.com>.
On 7/17/11 9:41 PM, Andy Levy wrote:
>
> Rather than trying to figure out what versions you have now, just
> remove what you have&  replace with a version compiled with an APR
> version that matches your Apache installation. If you installed both
> Subversion&  Apache via your distro's packaging system, this should
> have all been taken care of for you.

The packages may depend on the distribution.  For example, for Red Hat or Centos 
it would be httpd, subversion, and mod_dav_svn, and you'd get a snippet of the 
httpd config in /etc/httpd/conf.d/subversion.conf where you can customize the setup.

-- 
   Les Mikesell
    lesmikesell@gmail.com

Re: Subversion: via Apache

Posted by Andy Canfield <an...@pimco.mobi>.
I have requested our system administrator re-install Apache and all it's 
mod_dav modules and tell me the distribution versions of everything. 
After it gets done I can re-test.

In the meantime I can hope to get svn talking to svnserve via port 3690. 
So far failed on permissions, but more testing tomorrow.


Re: Subversion: via Apache

Posted by Andy Levy <an...@gmail.com>.
On Sun, Jul 17, 2011 at 22:29, Andy Canfield <an...@pimco.mobi> wrote:
> I removed the <Location /svn> block. No, Apache does not function.
>
> telnet hk.pimco.mobi 80
> Trying 202.181.201.137...
> Connected to hk.pimco.mobi.
> Escape character is '^]'.
> HEAD / HTTP/1.0
> (pressed Enter twice)
> Connection closed by foreign host.
>
> In my last message I did not include the Apache version number; the output
> of '/usr/sbin/httpd -v' is:
>     Server version: Apache/2.2.14 (Unix)
>     Server built:   Feb 10 2010 22:22:39
> Is there any way to check the version number of the SVN modules if they are
> not working?

If Apache isn't working at all with your <Location> block ripped out,
then the problem is the modules themselves.

Rather than trying to figure out what versions you have now, just
remove what you have & replace with a version compiled with an APR
version that matches your Apache installation. If you installed both
Subversion & Apache via your distro's packaging system, this should
have all been taken care of for you.

> On 07/17/2011 08:15 PM, Andy Levy wrote:
>
> Strip your httpd.conf.subversion down to ONLY load the modules. Do not
> include the <Location /svn> block. Does Apache function? Telnet to
> hk.pimco.mobi on port 80 and enter the following:
>
> HEAD / HTTP/1.0
>
> Then ENTER twice. You should get an HTTP/1.1 200 OK response (see
> http://tonycode.com/wiki/index.php?title=Making_HTTP_requests_via_telnet
> for more details on this).
>
> If this doesn't work, then you likely have a difference between the
> version of Apache you're running and the SVN modules. They need to be
> built using the same version of APR, IIRC.
>
>

Re: Subversion: via Apache

Posted by Andy Canfield <an...@pimco.mobi>.
I removed the <Location /svn> block. No, Apache does not function.

*telnet hk.pimco.mobi 80
Trying 202.181.201.137...
Connected to hk.pimco.mobi.
Escape character is '^]'.
HEAD / HTTP/1.0*
(pressed Enter twice)
*Connection closed by foreign host.*

In my last message I did not include the Apache version number; the 
output of '/usr/sbin/httpd -v' is:
*    Server version: Apache/2.2.14 (Unix)
     Server built:   Feb 10 2010 22:22:39*
Is there any way to check the version number of the SVN modules if they 
are not working?


On 07/17/2011 08:15 PM, Andy Levy wrote:
> Strip your httpd.conf.subversion down to ONLY load the modules. Do not
> include the<Location /svn>  block. Does Apache function? Telnet to
> hk.pimco.mobi on port 80 and enter the following:
>
> HEAD / HTTP/1.0
>
> Then ENTER twice. You should get an HTTP/1.1 200 OK response (see
> http://tonycode.com/wiki/index.php?title=Making_HTTP_requests_via_telnet
> for more details on this).
>
> If this doesn't work, then you likely have a difference between the
> version of Apache you're running and the SVN modules. They need to be
> built using the same version of APR, IIRC.
>

Re: Subversion: via Apache

Posted by Andy Levy <an...@gmail.com>.
On Sun, Jul 17, 2011 at 08:21, Andy Canfield <an...@pimco.mobi> wrote:
> I point my browser to http://hk.pimco.mobi/organic-asia/pc and it loads
> fine. I ssh into the server and sudo bash. Here are the versions of
> httpd.conf that are sitting in the /etc/apache2 directory:
> [root@pimco:/etc/apache2]: Dir httpd.conf*
> -rw-r--r--+ 1 root  wheel  55592 Apr 23 08:25 httpd.conf
> -r--r--r--  1 root  wheel  60360 Jul 21  2009 httpd.conf.default
> -rw-r--r--  1 root  wheel  55989 Jul 15 16:09 httpd.conf.subversion
> [root@pimco:/etc/apache2]: mv httpd.conf httpd.conf.good
>
> Here is a diff to show exaclty the changes that I have made to the
> httpd.conf file to enable subversion processing:
> [root@pimco:/etc/apache2]: diff httpd.conf.good httpd.conf.subversion
> 127c127
> < #LoadModule dav_module libexec/apache2/mod_dav.so
> ---
>> LoadModule dav_module libexec/apache2/mod_dav.so
> 154c154
> < #LoadModule dav_svn_module libexec/apache2/mod_dav_svn.so
> ---
>> LoadModule dav_svn_module libexec/apache2/mod_dav_svn.so
> 1501a1502,1515
>>
>> # This spells out where the subversion repositories go
>> <Location /svn>
>>   DAV svn
>>   # any "/svn/foo" URL will map to a repository /var/svn/foo
>>   SVNParentPath /var/svn
>>   # how to authenticate a user
>>   AuthType Digest
>>   AuthName "Subversion repository"
>>   AuthDigestDomain /svn/
>>   AuthUserFile /etc/svn-auth-file
>>   # only authenticated users may access the repository
>>   Require valid-user
>> </Location>
> [root@pimco:/etc/apache2]:
> These are the only changes I made to any apache configuration files to
> enable subversion.
>
> Here is what I did to make the 'subversion' version of httpd.conf the active
> one:
> [root@pimco:/etc/apache2]: copy httpd.conf.subversion httpd.conf
> [root@pimco:/etc/apache2]: apachectl restart
>
> As of this point my browser can no longer access the web page that it
> accessed at the start of this test; instead of giving me a web page it gives
> me a blank page. I pointed my browser to http://hk.pimco.mobi/svn and that
> also gives me just a blank page. View Page Source shows a total blank file;
> not even any <http> tag. Indeed pointing the browser to
> http://hk.pimco.mobi/foobar gives me the same result; not even a 404.
>
> The last entry in /var/log/apache2/error_log reads:
> [Sun Jul 17 19:47:05 2011] [notice] caught SIGTERM, shutting down
> which comes from the "apachectl restart" command. No error log entry for
> going to my web site no error log entry for going to /svn both of which give
> me a blank page. Nothing in /var/log/apache2/access_log in that time frame.
>
> The command
>     svnserve --version
> gives this reply:
>     svnserve, version 1.6.5 (r38866)
>        compiled Oct 16 2009, 02:54:10
> The command
>     svn --version
> gives this reply:
>     svn, version 1.6.5 (r38866)
>        compiled Oct 16 2009, 02:54:10
> These are the timestamps on the mod_dav files:
> -rwxr-xr-x  1 root  wheel  356432 Feb 11  2010 mod_dav.so
> -rwxr-xr-x  1 root  wheel  198160 Feb 11  2010 mod_dav_fs.so
> -rwxr-xr-x  1 root  wheel  429632 Oct 16  2009 mod_dav_svn.so
> I don't know how to get version numbers out of them.

Strip your httpd.conf.subversion down to ONLY load the modules. Do not
include the <Location /svn> block. Does Apache function? Telnet to
hk.pimco.mobi on port 80 and enter the following:

HEAD / HTTP/1.0

Then ENTER twice. You should get an HTTP/1.1 200 OK response (see
http://tonycode.com/wiki/index.php?title=Making_HTTP_requests_via_telnet
for more details on this).

If this doesn't work, then you likely have a difference between the
version of Apache you're running and the SVN modules. They need to be
built using the same version of APR, IIRC.

Re: Subversion: via Apache

Posted by Andy Canfield <an...@pimco.mobi>.
I point my browser to http://hk.pimco.mobi/organic-asia/pc and it loads 
fine. I ssh into the server and sudo bash. Here are the versions of 
httpd.conf that are sitting in the /etc/apache2 directory:
*[root@pimco:/etc/apache2]: **Dir httpd.conf*
-rw-r--r--+ 1 root  wheel  55592 Apr 23 08:25 httpd.conf
-r--r--r--  1 root  wheel  60360 Jul 21  2009 httpd.conf.default
-rw-r--r--  1 root  wheel  55989 Jul 15 16:09 httpd.conf.subversion
[root@pimco:/etc/apache2]: mv httpd.conf httpd.conf.good
*
Here is a diff to show exaclty the changes that I have made to the 
httpd.conf file to enable subversion processing:
*[root@pimco:/etc/apache2]: diff httpd.conf.good httpd.conf.subversion
127c127
< #LoadModule dav_module libexec/apache2/mod_dav.so
---
 > LoadModule dav_module libexec/apache2/mod_dav.so
154c154
< #LoadModule dav_svn_module libexec/apache2/mod_dav_svn.so
---
 > LoadModule dav_svn_module libexec/apache2/mod_dav_svn.so
1501a1502,1515
 >
 > # This spells out where the subversion repositories go
 > <Location /svn>
 >   DAV svn
 >   # any "/svn/foo" URL will map to a repository /var/svn/foo
 >   SVNParentPath /var/svn
 >   # how to authenticate a user
 >   AuthType Digest
 >   AuthName "Subversion repository"
 >   AuthDigestDomain /svn/
 >   AuthUserFile /etc/svn-auth-file
 >   # only authenticated users may access the repository
 >   Require valid-user
 > </Location>
[root@pimco:/etc/apache2]:
*These are the only changes I made to any apache configuration files to 
enable subversion.

Here is what I did to make the 'subversion' version of httpd.conf the 
active one:
*[root@pimco:/etc/apache2]: copy httpd.conf.subversion httpd.conf
[root@pimco:/etc/apache2]: apachectl restart*
*
*As of this point my browser can no longer access the web page that it 
accessed at the start of this test; instead of giving me a web page it 
gives me a blank page. I pointed my browser to http://hk.pimco.mobi/svn 
and that also gives me just a blank page. View Page Source shows a total 
blank file; not even any <http> tag. Indeed pointing the browser to 
http://hk.pimco.mobi/foobar gives me the same result; not even a 404.

The last entry in /var/log/apache2/error_log reads:
*[Sun Jul 17 19:47:05 2011] [notice] caught SIGTERM, shutting down*
which comes from the "apachectl restart" command. No error log entry for 
going to my web site no error log entry for going to /svn both of which 
give me a blank page. Nothing in /var/log/apache2/access_log in that 
time frame.

The command
*    svnserve --version*
gives this reply:
*    svnserve, version 1.6.5 (r38866)
        compiled Oct 16 2009, 02:54:10*
The command
*    svn --version*
gives this reply:
*    svn, version 1.6.5 (r38866)
        compiled Oct 16 2009, 02:54:10*
These are the timestamps on the mod_dav files:
*-rwxr-xr-x  1 root  wheel  356432 Feb 11  2010 mod_dav.so
-rwxr-xr-x  1 root  wheel  198160 Feb 11  2010 mod_dav_fs.so
-rwxr-xr-x  1 root  wheel  429632 Oct 16  2009 mod_dav_svn.so*
I don't know how to get version numbers out of them.

On 07/17/2011 06:31 PM, Andy Levy wrote:
>
> Resending as I forgot reply all
>
> On Jul 17, 2011 7:30 AM, "Andy Levy" <andy.levy@gmail.com 
> <ma...@gmail.com>> wrote:
> >
> >
> > On Jul 17, 2011 5:01 AM, "Andy Canfield" <andy.canfield@pimco.mobi 
> <ma...@pimco.mobi>> wrote:
> > >
> > > WHOA! Near as I can tell, if you have an apache2 server offering 
> web sites
> > > http://example.com/alpha
> > > http://example.com/beta
> > > http://example.com/gamma
> > > and you configure the apache2 web server for Subversion support, 
> suddenly you can no longer access alpha and beta and gamma. DOES 
> SUBVERSION TAKE OVER THE ENTIRE APACHE SERVER????? Apparently so. Yet 
> the book makes no mention of this!
> >
> > Only true if you configure subversion under a <location /> block. If 
> you use <location /something> it won't take anything over.
> >
> > I'm fairly sure the book covers this but perhaps you didn't 
> interpret it properly.
> >
> > > Well, we can not have subversion stealing our apache server; after 
> all we plan to use subversion to maintain a web site being hosted by 
> that very server.
> >
> > Indignation doesn't win friends.
>

Re: Subversion: via Apache

Posted by Andy Levy <an...@gmail.com>.
Resending as I forgot reply all

On Jul 17, 2011 7:30 AM, "Andy Levy" <an...@gmail.com> wrote:
>
>
> On Jul 17, 2011 5:01 AM, "Andy Canfield" <an...@pimco.mobi> wrote:
> >
> > WHOA! Near as I can tell, if you have an apache2 server offering web
sites
> > http://example.com/alpha
> > http://example.com/beta
> > http://example.com/gamma
> > and you configure the apache2 web server for Subversion support,
suddenly you can no longer access alpha and beta and gamma. DOES SUBVERSION
TAKE OVER THE ENTIRE APACHE SERVER????? Apparently so. Yet the book makes no
mention of this!
>
> Only true if you configure subversion under a <location /> block. If you
use <location /something> it won't take anything over.
>
> I'm fairly sure the book covers this but perhaps you didn't interpret it
properly.
>
> > Well, we can not have subversion stealing our apache server; after all
we plan to use subversion to maintain a web site being hosted by that very
server.
>
> Indignation doesn't win friends.