Tuesday, December 9, 2008

Quick Setup SVN with Apache2 on Linux


Step 1. Install Apache2 , if not already installed. (apache2,SVN,Linux)
Step 2. Install libapache2-svn, subversion ,subversion-tools(apache2,SVN,Linux)
If you are using debian try "apt-get install libapache2-svn subversion subversion-tools" or in Redhat/Fedora
try "yum install install libapache2-svn subversion subversion-tools".(apache2,SVN,Linux)
Step 3. Create SVN Repo Directory(apache2,SVN,Linux)
as root user(apache2,SVN,Linux)
mkdir /src (apache2,SVN,Linux)
chown -R ApacheUser /src (apache2,SVN,Linux)
svnadmin create /src/trunk (apache2,SVN,Linux)
Step 3. Now create apache config , put this config (apache2,SVN,Linux)
Under Location directive: (apache2,SVN,Linux)

DAV svn (apache2,SVN,Linux)
SVNPath /src/trunk (apache2,SVN,Linux)
AuthType Basic (apache2,SVN,Linux)
AuthName "SVN Authentication" (apache2,SVN,Linux)
AuthUserFile /etc/apache2/.svn.passwd (apache2,SVN,Linux)
Require valid-user (apache2,SVN,Linux)

Restart apache (apache2,SVN,Linux)

Step 4. Create SVN user (apache2,SVN,Linux)
htpasswd -c -m /etc/apache2/.svn.passwd user
You can add more user later

Step 5. Test you installation (apache2,SVN,Linux)
Open in your browser
http://yourservername/src/trunk

Step 6. If all set then import your files to this SVN Repo (apache2,SVN,Linux)
svn --username user import http://yourservername/src/trunk -m "First Import"

No comments: