Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts

Wednesday, 4 April 2012

Export specific sub holder from svn on CentOS

Some time project grows in your repository and you may want to move it to separate repository or you want to share you work and open up repository from tight security. The reasons can be many but the process is the same.

(assuming root access, LATEST refers to the latest available version, procedure was tested on 0.5.8)

Install needed components
yum install subversion-devel httpd-devel
wget http://prdownloads.sourceforge.net/rsvndump/rsvndump-LATEST.tar.gz
tar xvfz rsvndump-LATEST.tar.gz
cd rsvndump-LATEST
./configure
make
sudo make install

Exporting your project
With rsvndump you don't need to use filters to extract your subfolder within svn, it will do it for you just in one command
rsvndump -v -u username -p psw  https://ulr/svn/repos/to/subfolder > subfolder

Create svn repository
svnadmin create /path/to/svn/project

Allow Apache to read it
chown -R apache:apache symphony

Import it dumped file
svnadmin load --force-uuid /path/to/svn/project < subfolder

Enable web access in Apache
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
<location svn="">
        SSLRequireSSL
        DAV svn
        SVNParentPath /path/to/svn
        AuthzSVNAccessFile /path/to/svn-acl-conf
        AuthType Basic
        AuthName "Subversion repos"
        AuthUserFile /path/to/svn-auth-conf
        Require valid-user
        SVNIndexXSLT "https://url/svnindex.xsl"
</location>

Enable access in svn-acl-conf
[project:/]
@project_users=rw

[repos:/]
@users=rw

Restart Apache
/etc/init.d/httpd restart

More info
The assumption in example is that all your repositories are in the /path/to/svn/ Then you can use only one conf file for Apache and control access to repositories :) and you are done!

Thursday, 8 March 2012

Trac on Centos

cat httpd/conf.d/trac-project.conf

 #configuration 
#permament redirect for https
Redirect permanent http://path https://path
WSGIScriptAlias /project /var/www/html/project/cgi-bin/trac.wsgi
#with multiple project you need only alias it once 
Alias /trac/chrome/common /usr/share/trac/htdocs/common
Alias /trac/chrome/site /usr/share/trac/htdocs/site

<Directory /var/www/html/project/cgi-bin/>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>

<Location '/symphony'>
        SSLRequireSSL
        AuthType Basic
        AuthName "Trac symphony"
        AuthUserFile /usr/share/trac/projects/project/conf/trac.htpasswd
        Require valid-user
</Location> 



Back up trac
Since 0.13, trac back up include MySQL db back up, always good to have before upgrading.


 $ trac-admin /path/to/projenv hotcopy /path/to/backupdir
More info: http://trac.edgewall.org/wiki/0.13/TracBackup