install oci8 on RedHat

2010-11-29 / Server / 153 Comments

RED HAT ENTERPRISE LINUX 5
ORACLE 10g R2

1.Download
1.1.instantclient-basic-linux-x86-64-10.2.0.3-20070103.zip
1.2.instantclient-sdk-linux-x86-64-10.2.0.3-20070103.zip
1.3 oci8-1.4.4.tgz (http://pecl.php.net/package/oci8)

2.Make Dir
#mkdir /opt/oracle

3.unzip all file int /opt/oracle
#unzip instantclient-basic-linux-x86-64-10.2.0.3-20070103.zip
#unzip instantclient-sdk-linux-x86-64-10.2.0.3-20070103.zip

4.crate symbol links

#ln -s libclntsh.so.10.1 libclntsh.so
#ln -s libocci.so.10.1 libocci.so

5.add oracle instant client to system id

#echo /opt/oracle/instantclient_10_2 > /etc/ld.so.conf.d/oracle-instantclient

6.compile oci   (in section redhat need to intsalled php)

#pecl install oci8-1.4.4.tgz  ; type instantclient,/opt/oracle/instant_10_2 after pecl show prompt

8.enable oci8.so in php.ini

#nano /etc/php.ini

and insert “extension=oci8.so”  below section   “; Dynamic Extensions ; ”

9.reboot service httpd
#service httpd restart

NOTICE:
set LD_LIBRARY_PATH to /opt/oracle/instantclient_10_2

install php-pear
Read More

How to make and install samba server on solaris

2010-11-09 / Computer, Programming, Unix/Linux / 90 Comments

1.Download Soure at : http://www.samba.org/samba/download/
Now(2010-11-09) I get a lasted version “samba 3.5.6″ (file : samba-3.5.6.tar.gz)

2.Put in your’s solaris (I put via WinSCP.)

3.Extract gz and tar
3.1 Extract gz via cmd “gunzip samba-3.5.6.tar.gz ”

3.2 Extract tar via cmd “gunzip samba-3.5.6.tar”

4.after step 3 you got a new directory name “samba-3.5.6″

in samba-3.5.6 in source directory  “samba-3.5.6/source3″ for samba version 3 and “samba-3.5.6/source4″ for version 4

execute “./configure”  and “./make”

Oop. I use samba-3.5.6 when I make it’s,I  get this error.

“make: Fatal error in reader: Makefile, line 1396: Extra `:’, `::’, or `:=’ on dependency line”
and I found a solution for It.

A. Execute configuration by this command

./configure --with-automount --without-ldap --enable-socket-wrapper \
--with-quotas --with-sys-quotas --with-acl-support --with-aio-support \
--without-pam --enable-shared --prefix=/usr/local/opt/samba-3.5.2

B.In Makefile

B.1 search for -lthread and insert -lintl after (4 times)

B.2 remove “-Wl,-z,defs” (2 times)

B.3 search for option -G and replace with “-fPIC -shared”

B.4 search for “SHELL=” and replace “/bin/sh” with “/bin/bash”

B.5 edit file “include/config.h” and comment #define HAVE_IPV6 1

เรียบร้อย ^^

จากนั้นใช้คำสั่ง gmake -j และ gmake -j install

C1. สร้างไฟล์ comfig ไว้ใน /etc/sfw/ โดยจะมีตัวอย่าง อยู่ คือไฟล์ smb.conf-example
C2. สร้าง Password ให้กับ user โดย user นี้จะใช้ user เดียวกับ OS คำสั่งคือ smbpasswd -a “username” ไฟล์อยู่ที่ /usr/sfw/bin
C3. สร้าง Script Auto run ไว้ที่ /etc/rc3.d

#!/sbin/sh
#
# Copyright (c) 2001 by Sun Microsystems, Inc
# All rights reserved.
#
#ident  “@(#)samba      1.1     01/09/24 SMI”

case “$1″ in
start)
[ -f /etc/sfw/smb.conf ] || exit 0

/usr/sfw/sbin/smbd -D
/usr/sfw/sbin/nmbd -D
;;
stop)
pkill smbd
pkill nmbd
;;
*)
echo “Usage: $0 { start | stop }”
exit 1
;;
esac
exit 0

จากนั้นลองเทส โดยเรียก scritp นี้

Ref : http://panoramicsolution.com/blog/?p=134

Read More

How to make and install nano text edit on solaris 10 (sparc)

1.download source code  nano at http://www.nano-editor.org/download.php

2.extract tar and gz
2.1 #gunzip nano.x.x.tar.gz
2.2 #tar -vxf nano.x.x.tar

3.create a MakeFile

#cd /nano.x.x

#./configure –prefix=/usr

for install “nano” to /usr/bin (after make install)

4.Make File

#make

(binary output is ./src/nano)

5.Install

#make install

Read More

How to set permission for root to login ssh

2010-11-09 / Unix/Linux / 65 Comments

edit file /etc/ssh/sshd_config

change “PermitRootLogin no” to “PermitRootLogin yes”

Read More

How to find large file size on Unix

2010-11-06 / Computer, Server / 381 Comments

ใช้ Code ตามนี้หาเลย

find / -type f -size +1000000k -exec ls -lh {} \; | awk ‘{ print $9 ” : ” $5 }’

+1000000k บอกว่า ไฟล์มากกว่า 1 GB
awk ‘{ print $9 ” : ” $5 }’  print ข้อความของ -exec ls -lh {}

-exec ls -lh {} คือ Execute ls option -lh
{} คือ ทำเป็น Array โดยเริ่มที่ Index ที่ 1 (index 0 คือ output ของทั้ง Line)

Read More