tag:blogger.com,1999:blog-49957107792923256052024-03-12T20:39:45.794-07:00New Way Of Learning Linux And UnixAbhishek Kumar Singhhttp://www.blogger.com/profile/11570877616808881437noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4995710779292325605.post-70110937454800589142008-05-17T23:53:00.000-07:002008-05-18T03:11:01.232-07:00How To Setup Subversion Replication on CentOS5?<p>If you want to setup two subversion server , one master and another as read only slave with password and acl protected so keep reading. Let's suppose you have two subversion server , as below...<br /><br />SVN-M(master)<br />Hostname: svn-m.example.com<br />IPAddress: 10.10.10.1/24<br /><br />SVN-S (slave)<br />Hostname: svn-s.example.com<br />IPAddess: 10.10.10.2/24<br /><br /><br />Setup yum repository:<br /><br />Download any one RPM according to your OS and system architecture .....<br /><br />(for RHEL5 32 bit version)<br />wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm<br /><br /><font style="font-weight: bold">OR<br /><br /></font>(for RHEL5 64 bit version)<br />wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm<br />rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm<br /><br /><font face="arial" style="font-weight: bold">Setup Master SVN Server:</font><br /><br /><font size="3" style="font-weight: bold">1) Install Apache Webserver and Subversion .</font><br /><br /><font style="font-style: italic">yum install httpd httpd-devel subversion mod_dav_svn -y</font><br /><br /><br /><font face="arial" style="font-weight: bold"><font face="arial" size="3">2) Create SVN Repository:</font><br /></font><font face="arial"><br />I like fsfs filesystem based SVN repository over BDB based . To know more difference between fsfs and BDB go through following article<br /><br />http://svnbook.red-bean.com/en/1.1/ch05.html#svn-ch-5-sect-1.3<br /><font size="2"><br /><font style="font-style: italic">(Read "</font></font></font><font size="2"><font style="font-style: italic">Repository Data-Stores" section )</font></font><br /><br /><font style="font-style: italic">mkdir -p /var/www/svn</font> ( -p to create parent directory if it doesn't exist)<br /><br /><font style="font-style: italic">svnadmin create --fs-type=fsfs /var/www/svn/repos </font><br /><br />Note:check httpd.conf User and Group section to know user and group by which apache is running as follows and then change owner and group owner according to that )<br /><br /><font style="font-style: italic">grep ^User /etc/httpd/conf/httpd.conf</font><br /><br />OutPut: User apache<br /><br /><font style="font-style: italic">grep ^Group /etc/httpd/conf/httpd.conf</font><br /><br />OutPut: Group apache<br /><br /><font style="font-style: italic">chown -R apache:apache /var/www/svn/repos </font><br /><br /><br /><font face="arial" size="3" style="font-weight: bold">3) Configure Apache Webserver for Master subversion:</font><br /><br />Enable name based virtual hosting in<br /><br /><font style="font-style: italic">vi /etc/httpd/conf/httpd.conf</font><br /><br />NameVirtualHost *:80<br /><br /><font face="arial" style="font-weight: bold"><br /></font>vi /etc/httpd/conf.d/subversion.conf<br /><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br />LoadModule dav_svn_module modules/mod_dav_svn.so<br />LoadModule authz_svn_module modules/mod_authz_svn.so<br /><br /><VirtualHost *:80><br />ServerName svn-m.example.com<br /><Location /repos><br /> DAV svn<br /><br /> SVNPath /var/www/svn/repos<br /> AuthType Basic<br /> AuthName "Authorization Realm"<br /> AuthUserFile /var/www/svn/.htpasswd<br /> AuthzSVNAccessFile /etc/svn-acl-conf<br /> Require valid-user<br /><br /> </Location><br /> </VirtualHost><br /><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br /><br /><br /><font face="arial" size="3" style="font-weight: bold">4) Create SVN user :</font><br /><br /><font style="font-style: italic">htpasswd -cm /var/www/svn/.htpasswd test </font><br /><br />Note: -c to create file first time and -m for md5 hashed password. Don't use -c second time while creating user otherwise it will overwrite existing file.<br /><br /><font size="3" style="font-weight: bold">5) Create Subversion Access control list file for Master:</font><br /><br /><font style="font-style: italic">vi /etc/svn-acl-conf</font><br /><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br />[repos:/]<br />administrator = rw<br />* = r<br /><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br />Note: Only administrator can write to repository and everyone else can only read to repository.<br /><br /><font size="3"><font face="arial" style="font-weight: bold">6) Create SVN Repository Layout:</font></font><br /><br /><font style="font-style: italic">mkdir -p /tmp/productname/{trunk,stable,branches,releases}</font><br /><br /><font style="font-style: italic">svn import /tmp/productname/ file:///var/www/svn/repos/productname -m "Creating Productname Layout"</font><br /><br />To know more about SVN Repository Layout , Please go through following link...<br /><br />http://svnbook.red-bean.com/en/1.4/svn.tour.importing.html#svn.tour.importing.layout<br /><br /><br />Now make host entry as follows in <font style="font-weight: bold">/etc/hosts</font> on client side and point <font style="font-weight: bold">http://svn-m.example.com/repos</font> in your browser and you will get username password box.Now login by previously created usernane.<br /><br />10.10.10.1 svn-m.example.com<br /><br />Here your master SVN server is ready...... :)<br /><br /><br /><font face="arial" style="font-weight: bold">Setup Slave SVN Server:</font><br /><br />Step 1 and 2 same as Master.<br /><br />3) <font face="arial" size="3" style="font-weight: bold">Configure Apache Webserver for Slave subversion:</font><br /><br />Enable name based virtual hosting in<br /><br /><font style="font-style: italic">vi /etc/httpd/conf/httpd.conf</font><br /><br />NameVirtualHost *:80<br /><br /><br />vi /etc/httpd/conf.d/subversion.conf<br /><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br />LoadModule dav_svn_module modules/mod_dav_svn.so<br />LoadModule authz_svn_module modules/mod_authz_svn.so<br /><br /><VirtualHost *:80><br /> ServerName <font style="font-weight: bold">svn-s.example.com </font><br /><br /> <Location /repos><br /> DAV svn<br /><br /> SVNPath /var/www/svn/repos<br /> AuthType Basic<br /> AuthName "Authorization Realm"<br /> AuthUserFile /var/www/svn/.htpasswd<br /> AuthzSVNAccessFile /etc/svn-acl-conf<br /> Require valid-user<br /><br /></Location><br /> </VirtualHost><br /> <br /><br /><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br />4) Step 4 is same as master<br /><br />5) <font size="3" style="font-weight: bold">Create Subversion Access control list file for Slave:<br /></font><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br />[repos:/]<br />svnmirror = rw<br />* = r<br /><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br /><font style="font-weight: bold">Imp Note: </font>Please don't give write access to anyother user than svnmirror , only svnmirror should be able to write on slave no one else.<br /><br /><font style="font-weight: bold">6) </font><font face="arial" style="font-weight: bold">Make Mirror Repository Revision Properties Modifiable by Synchronizing User:<br /><br /></font><font face="arial">cd </font>/var/www/svn/repos/hooks<br />vi <font face="arial">pre-revprop-change<br /></font><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------</font><br /><font face="arial"> #!/bin/sh<br /><br />USER="$3"<br /><br />if [ "$USER" = "svnmirror" ]; then exit 0; fi<br /><br />echo "Only the svnmirror user may change revision properties as this is a read-only, mirror repository." >&2<br /><br />exit 1<br /></font><font face="arial">-------------------------------------------------------------------------------------------------------------------------------------<br /><br /><font style="font-weight: bold">7)</font> <font style="font-weight: bold">Create <font style="font-style: italic">svnmirror</font> user on master </font><br /><br /><font style="font-style: italic">htpasswd -bm /var/www/svn/.htpasswd svnmirror svn<br /></font></font><br /><font face="arial"><font style="font-style: italic"><br />Note: -b option is used to supply password on command line, here svnmirror user password is "svn". You can just remove -b option can type when it will ask for password.<br /><br /><font style="font-weight: bold">8)</font> </font><font style="font-weight: bold">Register mirror repository for synchronization </font><font style="font-style: italic"><br /></font></font></p><p><font size="10"><strong><font size="3">svnsync initialize file:///var/www/svn/repos </font></strong></font><font style="font-weight: bold">http://svn-m.example.com/repos --username=svnmirror<br /><br /></font><font size="2">It will ask svnmirror password that we created on master in our case this is "svn"<br /><br /></font>If everything is configured properly, you should see some output like this<br /><br />Copied properties for revision 0.<br /><br />Now we have registered our svn-s , slave i.e. mirror repository with master repository , now we should do initial synchronization so that mirror (slave) and master repository are synchronized .<br /><br />svnsync synchronize file:///var/www/svn/ repos --username=svnmirror<br /><br />you should see output like this.<br /><br />Committed revision 1.<br />Copied properties for revision 1.<br /><br /><font face="arial" size="3"><font style="font-weight: bold">9) Create SVN user on Slave:</font></font><br /><br /><font face="arial"><font style="font-style: italic">htpasswd -bm /var/www/svn/.htpasswd svnslavetest svnslavetest</font></font><br />Now make host entry in /etc/hosts on client side and point your http://svn-s.example.com/repos in your browser.You should get username and password pop-up just use previously created username and password<br /><br />UserName: svnslavetest<br />Password: svnslavetest<br /><br />10.10.10.2 svn-s.example.com<br /><br />9) Automate Synchronization with cron<br /><br />vi /etc/crontab<br /><br />*/5 * * * * root svnsync synchronize file:///var/www/svn/ repos --username=svnmirror --password=svn > /tmp/svnsync.log<br /><br />Now every 5 minute mirror repository will synchronize with master.<br /><br />cool :)<br /><br />Please send me your feedback and suggestions.<br /><br />Thanks</p>Abhishek Kumar Singhhttp://www.blogger.com/profile/11570877616808881437noreply@blogger.com3tag:blogger.com,1999:blog-4995710779292325605.post-55022250743459368552007-05-01T10:56:00.000-07:002008-12-08T22:24:13.965-08:00How To Play Mp3 and Video in UbuntuIf you want to enjoy linux sound and video player, so this is may be right place for you. I am going to tell you exactly how will you play mp3 and video in Ubuntu Linux<br /><br />If you like xmms so simply go to<br /><br />Applications ->Add/Remove Programs<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_DcEGsyg8OyY/RjeCJaxn6lI/AAAAAAAAAAU/7Xh-zYbe7Z8/s1600-h/Screenshot.png"><img style="cursor: pointer; width: 413px; height: 359px;" src="http://2.bp.blogspot.com/_DcEGsyg8OyY/RjeCJaxn6lI/AAAAAAAAAAU/7Xh-zYbe7Z8/s320/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5059655804691933778" border="0" /></a><br /><br /><br />Click on Sound & Video , then select xmms from Application section and click Ok.<br /><br />Now it will install xmms with mp3 decoder , now enjoy your favorite mp3 songs in Ubuntu , How simple is playing MP3 in linux.<br /><br />If you want to watch your favorite movie in Ubuntu , its very simple Just do following.<br /><br />Go to , Applications -> Add/Remove Program<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_DcEGsyg8OyY/RjeCJaxn6lI/AAAAAAAAAAU/7Xh-zYbe7Z8/s1600-h/Screenshot.png"><img style="cursor: pointer; width: 413px; height: 359px;" src="http://2.bp.blogspot.com/_DcEGsyg8OyY/RjeCJaxn6lI/AAAAAAAAAAU/7Xh-zYbe7Z8/s320/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5059655804691933778" border="0" /></a><br /><br />You will get this type of screen once again select Sound & Video , now select<br />GStreamer extra plugins and GStreamer ffmpeg video plugin after that click on Apply and then OK.<br /><br />Now enjoy your favorite movie's in Ubuntu Linux. Following Format's are supported.....<br /><br />mp3, sid, mpeg1-2,4 , AC-3, wmv, asf , mpeg, divx, DVD (without encryption)Abhishek Kumar Singhhttp://www.blogger.com/profile/11570877616808881437noreply@blogger.com0