Tuesday, February 21, 2012

Add samba user

At this point you should be able to see the samba server from any windows system in the same workgroup but you won't be able to access the share; not until you add the user(s).

Samba authenticates its users through its local database. Once you have saved the changes to smb.conf , you need to add the users.

Since you enabled the encrypted password option in your smb.conf, you need to add the users with encrypted password.

Add your existing users to samba or create new users and then add them to samba.



[root@server2 samba]# smbpasswd –a agustin
New SMB password: ********
Retype new SMB password:********

Enter the password in 8 character length or more, if you enabled the user name length specification, then it must meet the requirement. Note that agustin is an existing user in the system.

Note. If the command fails it is because the password file does not exist. Retouch the file with the following command and try again.

[root@server2 samba]# touch /etc/samba/smbpasswd

Finally change the smbpasswd security to 644

[root@server2 samba]# chmod 644 smbpasswd

That command will make it read only!

Tuesday, December 27, 2011

Install Apache mod_proxy_balancer

Install Apache mod_proxy_balancer

#cd /u01/source
#tar xvzf httpd-2.2.21.tar.gz
#cd httpd-2.2.21
#./configure --prefix=/u01/apache --enable-so

#make
#make install

cd httpd-2.2.21/modules/metadata
#/u01/apache/bin/apxs -a -i -c mod_headers.c

cd httpd-2.2.21/modules/proxy
#/u01/apache/bin/apxs -a -i -c mod_proxy.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_ajp.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_balancer.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_connect.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_http.c

if error when start apache, solve with running below
#/u01/apache/bin/apxs -a -i -c mod_proxy.c proxy_util.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_ajp.c proxy_util.c ajp_utils.c ajp_header.c ajp_msg.c ajp_link.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_balancer.c proxy_util.c


#cd /u01/apache/conf
#echo "Include conf/proxy-pass.conf" >> httpd.conf

#vi proxy-pass.conf

Header add Set-Cookie "ROUTEID=%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

BalancerMember http://localhost:6001 route=node1
BalancerMember http://localhost:6002 route=node2
ProxySet stickysession=ROUTEID


ProxyPass /context balancer://cluster/context
ProxyPassReverse /context balancer://cluster2/context

--start apache
#/u01/apache/bin/apachectl start

--stop apache
#/u01/apache/bin/apachectl stop

Wednesday, October 19, 2011

Apache as Load Balancer for Weblogic Server

1. gzip -d httpd*.tar.gz
2. tar -xvf httpd*.tar
3. ./configure --prefix=/u01/apache --enable-module=so --enable-rule=SHARED_CORE
4. make
5. make install
6. copy mod_wl.so to $apache_home/modules
7. vi $apache_home/conf/httpd.conf

8. add line to httpd.conf
-------
LoadModule weblogic_module modules/mod_wl.so
-------
Include conf/weblogic.conf
9. create file weblogic.conf


SetHandler weblogic-handler
weblogicCluster 192.168.10.1:7002,192.168.10.2:7002


10. start httpd
$apache_home/bin/apachectl start
11. check apache running
ps -ef | grep httpd

Wednesday, August 24, 2011

Search largest directory or file size

Here is command to seach largest directory size or file size in linux

Go to directory that want to search, here i try with root directory

[root@localhost /]# pwd
/

Run below command to sarch as tree

du -a | sort -nr | head -10



[root@localhost /]# du -a | sort -nr | head
4895036 .
2534040 ./u01
2491840 ./u01/app
2491824 ./u01/app/Middleware
1974680 ./usr
1178384 ./usr/share
944184 ./u01/app/Middleware/wls1033_generic.jar
691292 ./u01/app/Middleware/wlserver_10.3
663968 ./u01/app/Middleware/wlserver_10.3/server
481796 ./u01/app/Middleware/wlserver_10.3/server/lib


Run below command to search parent directory only

du -sm * | sort -nr | head

[root@localhost /]# du -sm * | sort -nr | head

2475 u01
1929 usr
129 lib
109 etc
58 var
37 sbin
21 lib64
9 bin
7 boot
6 root