Subversion setup in Mandriva 2007, Suse EL 10 and Fedora Core 6
Subversion setup is similar in Mandriva 2007, Suse EL 10 and Fedora. It is easier in Mandriva just because of urpmi. If you want to install a package , just type the urpmi packagename. It will get installed and urpmi will resolve all the dependency issues. In my experience, it is much better compared to apt-get ( I have installed apt-get for Suse 10) and yum (Fedora ) is not upto the mark yet when compared to urpmi (It is based on my experience with these distros.. your opinion may vary )
Now let’s go to the installation saga…
Apache installation
Most probably apache is pre installed in almost all the distros. But Suse Desktop edition is an exception.To install apache
- Login or su as root
- Run:
In Mandriva
urpmi apache
We don’t have to worry about setting up SSL for https in Mandriva as it is pre configured.
- Restart httpd
/etc/init.d/httpd restart
- HTTPS should work.
Try: https://hostname/
In Fedora,
Apache is a standard package. We can select that package and install it from the CD or DVD .. Same in the case of Mandriva
We don’t have to worry about setting up SSL for https in Mandriva as it is pre configured.
- Restart httpd
/etc/init.d/httpd restart
- HTTPS should work.
Try: https://hostname/
In Suse,
Webserver is not pre installed in Suse. We need to install it .
It is not preconfigured for https also. So we need to setup https by editing the configuration files and select the SSL certificate file in that configuration file.
- Restart httpd
/etc/init.d/apache restart
- HTTPS should work.
Try: https://hostname/
Or the generic procedure…
Download Apache 2 latest Source disrtibution from:
http://httpd.apache.org/download.cgi
Unix Source :httpd-2.0.52.tar.gz
and unpack the package .
./configure –prefix=/usr/local/apache2 –with-mysql –with-susexec
–enable-mods-shared=all
make
make install
Now for Subversion configuration ,
Install the packages
subversion
libapache2-svn
subversion-tools
Creating a repository
In Mandriva and Fedora
cd /home mkdir myrepo chown apache myrepo
In Suse
cd /home mkdir myrepo chown www-run myrepo
In Mandirva and Fedora
su apache -c "svnadmin create myrepo/src"
Then
su -
and edit your httpd.conf
in the /etc/httpd/conf/httpd.conf
In VirtualHost declaration, add
<Location /myrepo/src> DAV svn SVNPath /home/myrepo/src
AuthType Basic
AuthName "Ushustech Repository"
AuthUserFile /home/myrepo/.dav_svn.passwd
Require valid-user
</Location>
- Use this instead of “Require valid-user” if you don’t want to use passwords for read-only access
<LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept>
Append this in the httpd.conf file. LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule dav_svn_module modules/mod_dav_svn.so
make sure that mod_dav_svn.so ,mod_dav.so and mod_dav_fs.so are present in the httpd.conf .
Adding the Subversion users.
su apache -c "htpasswd -c -m /home/myrepo/.dav_svn.passwd maxin"
Give password for that user two times as usual .
Add another user. Now remember not to use the -c in httpasswd command or it will recreate the file with just that user.
su apache -c "htpasswd -m /home/myrepo/.dav_svn.passwd sree"
Now let's test the repository
- Using your browser. Load https://127.0.0.1/myrepo/src/ in your browser. Replace hostname with your host name or ip. You will get something like:
Revision 0: / Powered by Subversion version 1.1.3 (r12730).
Now start using subversion from the command line
svn co https://127.0.0.1/myrepo/src
This will prompt for username and password of a valid user.
This will create a directory src in your machine. Then
cd src
and add the directories
mkdir branches
mkdir site
mkdir tags
mkdir trunk
Then type
svn add *
svn update
svn commit
Test your subversion from browser again mozilla https://127.0.0.1/myrepo/src
Revision 1: / * branches/ * site/ * tags/ * trunk/ Powered by Subversion version 1.1.3 (r12730).
For Suse, the apache user is not present, So replace that apache with www-run. Also the htpasswd command is htpasswd2 in Suse. Other configurations are same .
Well that's all. Keep your subversion repo clean using my previous shell script :-). Happy Subversioning ..