Category Archives: English

Network File System (NFS)

This is my first look with NFS,

although i’ve tried NFS about 2 years ago, but i never write about that.
These are my requirement for test: 3 VM with connectable network. Such a 1 nfs server (192.168.56.2)  and 2 nfs client (192.168.56.3-4 CentOS 6.2 minimal server), package nfs, rpcbind (portmap service alternative, since kernel version was growth. Two nfs client should be run this service), iptables, telnet (optional package).

Server Configuration
We already set /data1 and /data2 as two partition will be share.
Edit /etc/exports file
nfs2Configure allow and deny hosts
nfs4Configure /etc/sysconfig/nfs for rpcbind, mountd, nfsd, etc static port
nfs5Configure iptables
nfs3

Client Side
Just use these params to mount them
~# mount -o rw <ip_nfs_server>:/<path_folder> /<path_destination>
Then your file/ folder will be set as user and group nfsnobody by nfs server.

Result
nfs1
Then if you want to execute the service or mounting activity automatically, set them with this params:
~# chkconfig <service_name> on
~# vi /etc/fstab // edit fstab foreach client

 <ip_nfs_server>:/<path>   /<destination_path>  nfs  ro  0  0
 <ip_nfs_server>:/<path>   /<destination_path>  nfs  rw  0  0

 

References
[1] Aji. Kresno, “Sharing File di Jaringan dengan NFS” . 2003 (Mei): 1-2. Retrieved 16 january 2015.
[2] http://eduardo-lago.blogspot.com/2012/02/installing-nfs-on-centos-62.html

Linux Terminal Server Project (LTSP)

First, i will you show how could this ‘Thin Client’ method work. Although it can’t be more powerfull than Cloud or Virtual Machine (i have described it in this sites). The LTSP server only completely handled the disk space and allocate them into the client (then you have to manage quota for them).  It was not memory, processor, etc, only Harddisk Drives. It can be an alternative for they aren’t have much cost or requirement to initiate Cloud Computing (https://tifosilinux.wordpress.com/2015/01/08/vcenter-server-appliance-testing/ and https://tifosilinux.wordpress.com/2015/01/03/cloud-computing-dengan-vmware/).

Here we are,
In this test can be very text book since i’ve got it from infoLINUX magazines (03/2013) but with little adjustment, you have installed Ubuntu 12.04.2 desktop precise with memory 1GiB and 16GiB HDD for LTSP server. Then you have to preparing the network configuration and the dependency of packages by using apt-get .
// i presumed that we are using two devices, which one devices function as a connection to internet (eth0) and the other one for local/ internal network (eth1)
~# vim /etc/network/interfaces
netLTSP
~# apt-get update
~# apt-get install ltsp-server-standalone openssh-server ltsp-server ltsp-client
dhcpLTSP
~# sed -i ‘s/INTERFACES=””/INTERFACES=”eth1″/’ /etc/default/isc-dhcp-server
Continue reading

vCenter Server Appliance – Testing

Alhamdulillah,

Once more, here with my little paper for you, for me, ..for us

Cheers

Chat in The Terminal with ‘Write’

Anything that you can do with UNIX/Linux are chatting with secure connection by write. Besides talk, ytalk, or wall which is broadcasting your message to all of user logged in, it should be not comfortable enough.

Here is an example, first you have grep tty as active user logged in with these params:
~# last -n10 | grep dhinesh | grep ‘still logged in’ | awk ‘{print $2}’ | head -1

[root@Jojoku-Chat ~]# write dhinesh pts/1
hello dhinesh

anything all right with ulimit ?
seems you are  still login in this server

^CYou have new mail in /var/spool/mail/root
[root@Jojoku-Chat ~]#

Cheers

IPTABLES (picture worth a thousand words .. again)

Hoaaammm.. almost get bored with another task after this one

First
PREROUTING_lokal

Second
PREROUTING_redirect# Generated by iptables-save v1.4.7 on Fri May 15 15:52:27 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1839883:265041417]
-A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 22 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 80 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 443 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 17135 -j ACCEPT
-A INPUT -j REJECT –reject-with icmp-host-prohibited
-A FORWARD -j REJECT –reject-with icmp-host-prohibited
COMMIT

Third
…. try to Imagine 😀

Control Available Resources with ulimit

Besides you can check by using sysctl -p for kernel share maximum memory etc.
Use these params to setup your max open files, max locked memory, max user process etc. For an example :
~# ulimit -a
~# ulimit -n 1048576
~# ulimit -l unlimited
~# ulimit -u unlimited

Or defining them into /etc/security/limits.conf like these:
*               soft    memlock         unlimited
*               hard    memlock         unlimited
*               soft    nofile          1048576
*               hard    nofile          1048576
*               soft    nproc           unlimited
*               hard    nproc           unlimited

But you are required pam_limit.so on your /etc/pam.d/su
session         required        pam_limits.so
or /etc/pam.d/common-session (debian only):
session         required        pam_limits.so
or /etc/pam.d/su
session         required        pam_limits.so         readenv=1

NOTED :

<item>
core
limits the core file size (KB)
data
maximum data size (KB)
Continue reading

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