Jump to content

Recommended Posts

Posted

Thought I'd store this here too as I spent the last four hours trying to figure out how to make WHM's Apache 2.x install work with subversion.

 

With a little help from this thread:

cPanel Forums

 

I managed to re-work the information into something a bit more usable and easier to understand... Oh and get it all to work! :)

 

 

---------------

 

mkdir -p /usr/local/src/subverison

cd /usr/local/src/subversion

wget http://subversion.tigris.org/downloads/subversion-1.5.2.tar.bz2

tar xfj subversion-1.5.2.tar.bz2

 

cd subversion-1.5.2

 

./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.9/srclib/apr-util

make

make install

 

NB: You can ignore the warning about berkleydb that comes at the end of the ./configure command.

 

Create the svn_custom.conf using the new EA3 feature as described here:

cPanel - The Easy Apache Configuration System - Adding Custom Directives to httpd.conf

/etc/httpd/conf/userdata/std/2/[username]/[subdomain?].[domain]

 

eg: /etc/httpd/conf/userdata/std/2/contink/www.continuousink.info

.. the www is required or can be any subdomain but note the exception to wildcard sub-domains in the reference above.

 

DAV svn

SVNPath /home/[username]/svn/[repos-name]

AuthType Basic

AuthName "[Repository Label]"

AuthUserFile /home/[username]/svn/passwd

Require valid-user

 

The call helps avoid your apache falling over if there's a problem with the conf file so don't get rid of it!

 

TEST the custom configuration before you commit it!

/scripts/verify_vhost_includes

 

Assuming all is well... commit the svn_custom.conf and restart the apache server:

 

/scripts/ensure_vhost_includes --user=[username]

 

/scripts/rebuildhttpdconf

/scripts/restartsrv_httpd

 

 

 

You also need to do the following

WHM > Apache Setup > Include Editor > Pre-Main Include

 

Add the lines:

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so 

 

.. then restart apache.

 

 

 

One thing to watch out for... if you get an error like this:

Invalid command 'AuthzSVNAccessFile', perhaps mis-spelled or defined by a module not included in the server configuration"

... it's because you forgot to add the LoadModule command for the authz_svn_module

 

... that little oversight caused me 45 minutes of head scratching so hopefully this will save some other poor s*d from the same fate.

 

 

 

Anyhoo... hope that's useful and obviously this is a guide for NIX systems only. YMMV for Win32 systems.

  • Thanks 1
  • 7 months later...
Posted

Some more info to add to this in response to this post:

Don't have a /usr/local/apache/conf/userdata folder - cPanel Forums

 

 

1. If you don't have the directory:

/usr/local/apache/conf/userdata

 

You need to create it... (ensure ownership user:group is root:root)

Same with the /usr/local/apache/conf/userdata/std/2/[account]/[subdom.domain]

 

 

2. What do I chown the repository folders to?

If you are using Mod SuPHP then you leave the repository owned by the account owner.. so it you ftp in under username "foo" then you need to make sure that the repository owner is "foo".

 

However if you're not using Mod SuPHP that then you'll need to work out what account apache is running under (usually nobody:nobody).

 

You then do either:

- CHOWN nobody:nobody /path/to/repository -R

..or..

- CHMOD 777 /path/to/repository -R

 

 

Either will work.

  • Thanks 1
Posted

Further to that lot here's another nugget..

 

When you recompile Apache using Easy Apache you will need to do the following first:

 

In WHM go to:

  1. Main >> Service Configuration >> Apache Configuration
  2. In the "Pre Main Include" select your current version
  3. Replace:
     LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so 


    with:

    # LoadModule dav_svn_module modules/mod_dav_svn.so
    # LoadModule authz_svn_module modules/mod_authz_svn.so 


    (This disables the subversion repository)

 

You can now recompile Apache successfully (remember to select "Dav" as one of the modules to include).

 

If you don't do this you get an error and your build will fail.

 

 

Once you've finished Easy apache successfully... Compile your Subversion against the new apache, etc...

 

ie:

cd subversion-1.6.2

 

./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.11/srclib/apr-util

make

make install

** I've updated for the latest versions of Apache and Subversion so if your version of subversion is out of date now is a good time to update it.

 

Once that is done you can then return to Main >> Service Configuration >> Apache Configuration and return the "Pre Main Include" code to what is was before.

 

Works like a charm :)

  • Thanks 1
  • 1 month later...
Posted
I follow step by step tutorial on this post and it's really helpful.. however, before I install the latest svn from this post, I already use yum found on another tutorial using svn 1.4.2. Now I have both version installed but when I type svn or svnadmin it still referring to the 1.4.2 version. How do I get rid of 1.4.2?
Posted

Well you did a YUM upgrade which isn't on the instructions so I'm afraid I don't know.

 

You'll need to query forums/docs for your particular linux distro and get some help there... You should have no problems querying your source installed svn and svnadmin though using the full path eg:

 

/usr/local/bin/svn --version

 

Sorry I don't have anything for your specific scenario...

  • 6 months later...
Posted

Updating this having found a small but possibly significant quirk in updating Apache to 2.2.14, PHP to 5.3.1 and SubVersion to 1.6.9

 

This still applies

In WHM go to:

  1. Main >> Service Configuration >> Apache Configuration
  2. In the "Pre Main Include" select your current version
  3. Replace:
     LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so 


    with:

    # LoadModule dav_svn_module modules/mod_dav_svn.so
    # LoadModule authz_svn_module modules/mod_authz_svn.so 


    (This disables the subversion repository)

 

You can now recompile Apache successfully (remember to select "Dav" as one of the modules to include).

 

If you don't do this you get an error and your build will fail.

 

 

Once you've finished Easy apache successfully...

Compile your Subversion against the new apache, using:

configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.14/srclib/apr-util
make clean
make
make install

 

The make clean gets rid of incompatible libs that would otherwise cause errors during make and make install

 

 

Once that is done you can then return to Main >> Service Configuration >> Apache Configuration and return the "Pre Main Include" code to what is was before.

  • Thanks 1
  • 1 month later...
Posted

Apache to 2.2.15, PHP to 5.3.2 and SubVersion to 1.6.9

 

Compile your Subversion against the new apache, using:

configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.15/srclib/apr-util
make clean
make
make install

  • Thanks 1
  • 2 months later...
Posted

Seen as this thread has helped me sooo many times:

 

This is the same as above svn 1.6.11, apache 2.2.15 php 5.2.13 with ssl support and neon (so you can ass the svn locally using http:// instead of svn://)

 

cd /home/downloads/svn
wget http://subversion.tigris.org/downloads/subversion-1.6.11.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.11.tar.gz
tar xfvz subversion-1.6.11.tar.gz
tar xfvz subversion-deps-1.6.11.tar.gz
cd subversion-1.6.11/neon
./configure --prefix=/usr/local/neon
make
make install
cd ..
./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.15/srclib/apr-util --with-neon=/usr/local/neon/ --with-ssl
make
make install

 

Should be able to copy and paste into your bash session and job done!

 

I will make an automated bash installer in the future if enough people request it.

 

Thanks,

Chris

  • Thanks 2
  • 4 months later...
  • 4 months later...
  • 4 months later...
Posted

Updated Chrisjenx2001 instructions for the version to date:

 

Apache 2.2.19

Subversion 1.6.17

 

cd /home/downloads/svn
wget http://subversion.tigris.org/downloads/subversion-1.6.17.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.17.tar.gz
tar xfvz subversion-1.6.17.tar.gz
tar xfvz subversion-deps-1.6.17.tar.gz
cd subversion-1.6.17/neon
./configure --prefix=/usr/local/neon
make
make install
cd ..
./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.19/srclib/apr-util --with-neon=/usr/local/neon/ --with-ssl
make
make install

  • Thanks 1
  • 3 weeks later...
Posted

Great thread. Thanks

 

Just a note for anyone with the same issue I had.

when doing make of subversion I got the error

/usr/lib/libexpat.so: could not read symbols: File in wrong format

The problem is that the make use the 32bit version of libexpat while I am running CentOS 64bit.

Removing the 32bit libs solved the problem

yum remove glibc-devel.i386 expat-devel.i386

  • 2 weeks later...
Posted

What do the permissions and owner need to be when running suPHP? Having it set for useraccount:useraccount does not work. I can create and import under root but it not with tortoise using http. I keep getting permision denied errors. I have tried many combinations of uid:grp but something always fails. I tried nobody:nobody, useraccount:nobody, root:root, and combinations of these.

Environment is Centos 5.6 with latest WHM/Cpanel.

 

Somebody please help, I know this will work because I have had it set up in the past. It is driving me nuts!

  • 3 weeks later...
  • 1 month later...
Posted

To fix the permissions: the folder and files need to be for useraccount:useraccount if you are using suPHP.

 

You then also have to add to your config file located at /usr/local/apache/conf/userdata/std/2/cpanl_user/domain.com/file.conf

# added for permissions/access

Order allow,deny

Allow from all

 

The complete conf file should look like this:

# mod dav svn support and location of svn repo files

DAV svn

SVNPath /path/to/svn/repos

# authentication for security, create using htpasswd

AuthType Basic

AuthName "SVN Access"

AuthUserFile /path/to/file/containing/user.pass

Require valid-user

# added for permissions/access

Order allow,deny

Allow from all

  • 3 weeks later...
Posted

Latest has a significant update due to the way dependencies are now handled.

 

Apache 2.2.19

Subversion 1.7.1

 

cd /home/downloads/svn
wget http://subversion.tigris.org/downloads/subversion-1.7.1.tar.gz
tar xfvz subversion-1.7.1.tar.gz
cd subversion-1.7.1
sh get-deps.sh
cd neon
./configure --prefix=/usr/local/neon
make
make install
cd ..
./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.19/srclib/apr-util --with-neon=/usr/local/neon/ --with-ssl
make
make install

  • Thanks 1
  • 6 months later...
Posted

That time again...

 

Apache 2.2.22

Subversion 1.7.5

 

cd /home/downloads/svn
wget http://subversion.tigris.org/downloads/subversion-1.7.5.tar.gz
tar xfvz subversion-1.7.5.tar.gz
cd subversion-1.7.5
sh get-deps.sh
cd neon
./configure --prefix=/usr/local/neon
make
make install
cd ..
./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.22/srclib/apr-util --with-neon=/usr/local/neon/ --with-ssl
make
make install

  • Thanks 1
  • 2 months later...
Posted

Small nugget...

 

If your Apache version and Subversion version are still the same but you want to update say PHP to in Cpanel.. .

 

  1. Ensure you have disabled the include editor LoadModule lines (as per earlier posts) & restarted Apache.
  2. Use EasyApache as normal and ensure you are indeed leaving your apache version alone during the update
  3. Run this code:
    cd /home/downloads/svn/subversion-1.7.5
    make
    make install
    


  4. Re-enable the LoadModule lines
  5. Restart Apache

  • 8 months later...
Posted

Recently upgraded but came up against a few things regarding mod_security so see below if you get something similar.

 

Apache 2.2.24

Subversion 1.7.9

 

cd /home/downloads/svn
wget http://subversion.tigris.org/downloads/subversion-1.7.9.tar.gz
tar xfvz subversion-1.7.9.tar.gz
cd subversion-1.7.9
sh get-deps.sh
cd neon
./configure --prefix=/usr/local/neon
make
make install
cd ..
./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2.24/srclib/apr-util --with-neon=/usr/local/neon/ --with-ssl
make
make install

 

 

The Mod_Security quirk was down to the rules I had in a custom.conf for apache...


 
   DAV svn
   SVNParentPath /home/foo/svn/dev

   # Our ACL (Access Control Policy)
   AuthzSVNAccessFile /home/foo/svn/svnaccess

   # Try anonymous access first, then usernames if required.
   Satisfy Any
   Require valid-user

   AuthType Basic
   AuthName "My Dev Repos"
   AuthUserFile /home/foo/svn/passwd

   

       # Blanket approach (disable if possible)
       #SecRuleEngine Off

       # SubVersion Rules to allow through
       #SecRule REQUEST_METHOD "^(PROPFIND|PROPPATCH)$" allow "id:1234123456"
       #SecRule REQUEST_METHOD "^(REPORT|OPTIONS)$" "id:1234123457,allow"
       #SecRule REQUEST_METHOD "^(MKACTIVITY|CHECKOUT)$" "id:1234123458,allow"
       #SecRule REQUEST_METHOD "^(PUT|DELETE|MERGE)$" "id:1234123459,allow"
       #SecRule REQUEST_METHOD "^(MKCOL)$" allow "id:1234123460,allow"

   

 

 

Now the code above is now disabled because it seems Mod_Security has included a subversion exception/rule as standard now but the code above caused me some problems because of two things:

 

1. Mod_security now requires a unique_id for each rule, which CPanel appears to have helpfully applied to each of my custom rules...

2. The syntax has changed from the pre Mod_Sec 2.7 type:

SecRule REQUEST_METHOD "^(PROPFIND|PROPPATCH)$" allow

..to this:

SecRule REQUEST_METHOD "^(PROPFIND|PROPPATCH)$" "id:1234123456,allow"

 

As you can see in my example above I've disabled the workaround as it doesn't appear to be required anymore but it might catch you out if you've been getting errors like this:

SecRule takes two or three arguments, rule target, operator and optional action list
  • 4 months later...
  • 2 months later...
Posted (edited)

Hi

Many Thanks for the guidance.

I have






Apache 2.2.25

Subversion 1.8.4

PHP Version 5.3.27

 

I am trying to setup SVn on my server and bit confused of the order. Please correct me if the following order is wrong.

 

 

cd /home/downloads/svn

wget http://subversion.tigris.org/downloads/subversion-1.8.4.tar.gz

tar xfvz subversion-1.8.4.tar.gz

cd subversion-1.8.4

sh get-deps.sh (I cannot see this script)

cd serf

./serfmake --prefix=/usr/local/serf --with-apr=/usr/local/apache/bin install

make

make install

cd ..

./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2/srclib/apr-util --with-serf=/usr/local/serf/

make

make install

 

 

Create the svn_custom.conf using the new EA3 feature as described here:

cPanel - The Easy Apache Configuration System - Adding Custom Directives to httpd.conf

/etc/httpd/conf/userdata/std/2/[username]/[subdomain?].[domain]

 

eg: /etc/httpd/conf/userdata/std/2/contink/www.continuousink.info

.. the www is required or can be any subdomain but note the exception to wildcard sub-domains in the reference above.

DAV svn

SVNPath /home/[username]/svn/[repos-name]

AuthType Basic

AuthName "[Repository Label]"

AuthUserFile /home/[username]/svn/passwd

Require valid-user

The call helps avoid your apache falling over if there's a problem with the conf file so don't get rid of it!

 

TEST the custom configuration before you commit it!

/scripts/verify_vhost_includes

 

Assuming all is well... commit the svn_custom.conf and restart the apache server:

 

/scripts/ensure_vhost_includes --user=[username]

 

/scripts/rebuildhttpdconf

/scripts/restartsrv_httpd

 

 

In WHM go to:

 

  1. Main >> Service Configuration >> Apache Configuration
  2. In the "Pre Main Include" select your current version
  3. Replace:

Code:

LoadModule dav_svn_module modules/mod_dav_svn.so

LoadModule authz_svn_module modules/mod_authz_svn.so

with:

Code:

# LoadModule dav_svn_module modules/mod_dav_svn.so

# LoadModule authz_svn_module modules/mod_authz_svn.so

(This disables the subversion repository)

 

 

You can now recompile Apache successfully (remember to select "Dav" as one of the modules to include).

 

Is this order right?

Edited by milindras
  • 2 months later...
Posted

Apache 2.2.26

Subversion 1.8.5

 

cd /home/downloads/svn
wget http://subversion.tigris.org/downloads/subversion-1.8.5.tar.gz
tar xfvz subversion-1.8.5.tar.gz
cd subversion-1.8.5
sh get-deps.sh
cd serf
./serfmake --prefix=/usr/local/serf --with-apr=/usr/local/apache/bin install
cd ..
./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.2/srclib/apr-util --with-serf=/usr/local/serf/
make clean
make
make install

 

It also seems that because the modules are now being built in a new location you need to alter the apache pre-main config as well

 

Instead of:

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

 

You will now need to use:

LoadModule dav_svn_module /usr/local/libexec/mod_dav_svn.so
LoadModule authz_svn_module /usr/local/libexec/mod_authz_svn.so

  • 2 weeks later...
Posted (edited)

Right... Having spent the last 4 [expletive] hours trying to nail this down here's a few tips on how to deal with the 1.8.x update that may trip you up.

 

1. Make sure you know where your apache error_log is and tail it if you hit problems.

tail -f /usr/local/apache/logs/error_log

 

In particular watch out for 403 forbidden errors that weren't a problem with Subversion 1.7 but appeared as soon as you upgraded your svn server or client to 1.8 or higher.

 

In my case the problem was a problem with a file system path in one of my AuthzSVNAccessFile settings. It completely borked the entire authentication file without giving any indication to the client. It'll appear as something like:

Failed to load the mod_authz_svn config: Section name 'repository_name' contains non-canonical fspath 'repository_name'

 

2. Look out for problems from mod_security coming in all over again

 
   DAV svn
   SVNParentPath "/home/foo/svn/dev"

   # Our ACL (Access Control Policy)
   AuthzSVNAccessFile /home/foo/svn/svnaccess

   # Try anonymous access first, then usernames if required.
   Satisfy Any
   Require valid-user

   AuthType Basic
   AuthName "My Dev Repos"
   AuthUserFile /home/foo/svn/passwd

   

       # Blanket approach (disable if possible)
       #SecRuleEngine Off

       # SubVersion Rules to disable to allow commits
       SecRuleRemoveById 390616

   

 

 

 

3. If you're installing Nginx as a way of boosting your servers speed for static files then you'll need to make some changes to allow apache to handle your svn access or you'll hit more forbidden error problems:

 

Once installed:

cd /etc/nginx/vhosts
pico www.yourdomain.com

 

FIND:

root /home/foo/public_html;

 

AFTER, ADD:

location [your repos as per your apache custom.conf] {
proxy_pass http://[your_ip:proxy_port];
include proxy.inc;
include microcache.inc;
}

 

For the above, refer to the other blocks of code in the nginx conf file to see what you should be putting in each...

Edited by contink

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...