> ## Documentation Index
> Fetch the complete documentation index at: https://kb.mochahost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SVN installation (Linux VPS/Cloud) Apache 2.4

1. Via SSH on your server execute the following command to **install SVN:**  

`# yum install ea-apache24-devel subversion`

2. Check if **dav modules** are loaded:

\`/etc/init.d/httpd -M | grep dav

dav\_module (static)\
dav\_fs\_module (static)\
dav\_lock\_module (static)\
dav\_svn\_module (shared)\`

If this modules are missing you need to add it from **WHM-> Easyapache4**.

Also make sure whether **neon installed or not**, if not installed:

[http://www.webdav.org/neon/neon-0.28.4.tar.gz](http://www.webdav.org/neon/neon-0.28.4.tar.gz)

`tar -xzvf neon-0.28.4.tar.gz 
cd neon-0.28.4 
./configure --prefix=/usr/local/neon`

3. Install and configure **SVN**. Execute the commands via SSH:

\`wget [https://archive.apache.org/dist/subversion/subversion-1.13.0.tar.bz2](https://archive.apache.org/dist/subversion/subversion-1.13.0.tar.bz2)

tar xfj subversion-1.13.0.tar.bz2\
wget [http://www.sqlite.org/sqlite-amalgamation-3.7.0.tar.gz](http://www.sqlite.org/sqlite-amalgamation-3.7.0.tar.gz)\
tar -zxvf sqlite-amalgamation-3.7.0.tar.gz\
cd subversion-1.13.0\
mkdir sqlite-amalgamation\
cp /usr/src/sqlite-3.7.0/sqlite3.c /usr/src/subversion-1.6.3\`

4. **Configure the subversion**.

Execute:

`./configure --with-apr=/opt/cpanel/ea-apr16/bin/apr-1-config --with-apr-util=/opt/cpanel/ea-apr16/bin/apu-1-config --with-apxs=/usr/bin/apxs --with-neon=/usr/local --with-lz4=internal`

make

\`make install

mv /usr/local/libexec/mod\_authz\_svn.so /etc/apache2/modules/\
mv /usr/local/libexec/mod\_dav\_svn.so /etc/apache2/modules/\`

Add:

`LoadModule dav\_svn\_module /etc/apache2/modules/mod\_dav\_svn.so 
LoadModule authz\_svn\_module /etc/apache2/modules/mod\_authz\_svn.so`

**in /etc/apache2/conf.d/includes/pre\\\_main\\\_global.conf**

`/scripts/restartsrv\_httpd`

5. Create **SVN for cpanel user**:

\`mkdir -v /home/user/directory/repository

/usr/bin/svnadmin create --fs-type fsfs /home/user/directory/repository\`

That should create a **subversion repository** under **/home/user/directory/repository**.

6. **Fix permissions** for the created directory:

`chown -R user:nobody /home/user/dir/repository 
chmod -R 770 /home/user/dir/repository`

Put the following entries in **/etc/apache2/conf.d/userdata/std/2\\\_4/user/domain/svn.conf**

\`Alias /svn "/home/user/directory/repository"

DAV svn\
SVNPath "/home/user/directory/repository"\
SVNPathAuthz Off # More faster but don't check permission permission in all parenth path ( - security)\
AuthzSVNAccessFile "/home/user/directory/repository/conf/auth"\
require valid-user\
Satisfy Any\
Options MultiViews\
Require all granted

\`

Save it.

Then run:

`/scripts/ensure\_vhost\_includes --user=username`

7. **Adding SVN users**:

`htpasswd -cmd /home/user/directory/repository/conf/auth username`

8. Access the svn using link **[http://domain.com/svn](http://domain.com/svn)**
