Subversion UNIX/Linux (instead of Git, etc)

I’ve to post these as usual to make it something easier to remember. This is absolutely text book but honestly, sys.admin must help developer to keep production server or staging update automatically as well as their codes has been created.

I presumed that we are using centOS distro, and using original directory as /app/xmp2012 into path svn on /app/svn/xmp2012
1). Server]# yum install mod_dav_svn subversion
2). Server]# vi /etc/httpd/conf/httpd.conf # Tweak it
3). Server]# vi /etc/httpd/conf.d/subversion.conf
# adding module then adjust them
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /svn/xmp2012>
DAV svn
SVNPath /app/svn/xmp2012
AuthType Basic
AuthName “XMP Wakimobi Repos”
AuthUserFile /etc/svn-auth-conf
Require valid-user
</Location>
4). Server]# /etc/init.d/httpd restart
5). Server]# htpasswd -cm /etc/svn-auth-conf # admin-auth
6). Server]# htpasswd -m /etc/svn-auth-conf # other user
7.) Server]# cd /app && mkdir -p svn && find . -iname ‘.svn’ -printO | xargs -O rm -rf # make sure there’s no hidden svn directory before.
8). Server]# cd svn/ && svnadmin create xmp2012
9). Server]# chown -Rf apache.apache xmp2012/
10). Server]# /etc/init.d/httpd restart
11.) Server]# svn import /app/xmp2012/ file:///app/svn/xmp2012 -m ‘Initial repository for KB deployment’
12). Client]# cd /app
13). Client]# svn co http://<IP_server>/svn/xmp2012
14). Client]# vi /app/xmp2012/interface/proxl/config/database.php # Try to adding some lines.
15). Client]# svn commit -m ‘adding lines on db file’
16). Client]# svn up /app/xmp2012/interface/proxl/config/*
17). Client]# cp -pa /home/hary/ldap/slapd.conf /app/xmp2012/interface/proxl/www/ && svn add /app/xmp2012/interface/proxl/www/slapd.conf
18). Client]# svn commit -m ‘try to adding file’
19). Client]# svn up /app/xmp2012/interface/proxl/www/*
20). Client]# links http://<IP_server>/svn/xmp2012 # keep on your eye the latest Revision <number>: / of subversion DB
21). Server]# cd /app/xmp2012/interface/proxl/config/ # OR you have to remove original folder then use svn check out into that path
22). Server]# svn export http://<IP_server>/svn/xmp2012/interface/proxl/config/database.php
23). Server]# cd /app/xmp2012/interface/proxl/www/
24). Server]# svn export http://<IP_server>/svn/xmp2012/interface/proxl/www/slapd.conf
25). Server]# svn –help # Learn much more params svn like svn <delete>, <log> in order to reverting back, <diff>, <merge>, <revert>, <switch>, etc

Catatan :
Pada step diatas kita menggunakan perintah find. Untuk case lain jika ingin mencari file dengan awalan bebas dan huruf kedua ‘h’ yang berada dibawah direktori /home/hary gunakan perintah berikut ~# find /home/hary/ -type f -name ‘?h*’   .Jika ingin mencari file (tipe, bukan ekstensi ya) dengan ukuran lebih dari 1G gunakan perintah ~# find /home/hary/ -type f -size +1000m .
Jika ingin mencari file dengan ukuran antara 100k dan 1000k gunakan perintah berikut ~# find /home/hary/ -type f  -size +100k -size -1000k  .
Gunakan opsi d untuk direktori, opsi b untuk tipe file ‘block’ , dll.


Cheers
HarysMatta

Advertisements

Tinggalkan pesan atau komentar

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s