显示标签为“Linux”的博文。显示所有博文
显示标签为“Linux”的博文。显示所有博文

2010年12月25日星期六

SuSe Linux 9 平台下安装IBM MQ 6.0.2.0过程

建立用户组mqm和mqbrkrs,把root帐号也归属到这两个组。建立帐号mqm,它的主用户组是mqm,附属组是mqbrkrs和root。
MQServer:/tmp/mq/432 # ls -l
total 782236
drwxr-xr-x   6 root root       1408 Mar 26 00:42 .
drwxr-xr-x   3 root root        176 Mar 26 00:39 ..
-r--r--r--   1 root 12201  56517147 May 20  2005 IBMJava2-SDK-1.4.2-0.0.i386.rpm
-rw-rw-r--   1 root 12201    963879 May 20  2005 MQSeriesClient-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201  84765428 May 20  2005 MQSeriesConfig-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    719764 May 20  2005 MQSeriesFTA-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201 163979050 May 20  2005 MQSeriesIES30-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201   3681759 May 20  2005 MQSeriesJava-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201  37483080 May 20  2005 MQSeriesKeyMan-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    130189 May 20  2005 MQSeriesMan-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    111975 May 20  2005 MQSeriesMsg_Zh_CN-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    116214 May 20  2005 MQSeriesMsg_Zh_TW-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    136622 May 20  2005 MQSeriesMsg_de-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    128491 May 20  2005 MQSeriesMsg_es-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    130044 May 20  2005 MQSeriesMsg_fr-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    128327 May 20  2005 MQSeriesMsg_it-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    122076 May 20  2005 MQSeriesMsg_ja-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    116664 May 20  2005 MQSeriesMsg_ko-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    127411 May 20  2005 MQSeriesMsg_pt-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201   7877738 May 20  2005 MQSeriesRuntime-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    229101 May 20  2005 MQSeriesSDK-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201   1307081 May 20  2005 MQSeriesSamples-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201   5089089 May 20  2005 MQSeriesServer-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201     21376 May 20  2005 MQSeriesTXClient-6.0.0-0.i386.rpm
-rw-r--r--   1 root root  432261120 Feb 22 11:48 MQforLinux601.tar
drwxrwxr-x   3 root 12201        72 May 20  2005 PreReqs
drwxrwxr-x  14 root 12201       352 May 20  2005 READMEs
-r--r--r--   1 root 12201       261 May 20  2005 copyright
-r--r--r--   1 root 12201   3988581 May 20  2005 gsk7bas-7.0-3.15.i386.rpm
drwxrwxr-x   4 root 12201       144 May 20  2005 lap
drwxrwxr-x   2 root 12201       704 May 20  2005 licenses
-rwxr-xr-x   1 root 12201      4770 May 20  2005 mqlicense.sh
-rwxr-xr-x   1 root 12201     35314 May 23  2005 readadd.txt
MQServer:/tmp/mq/432 #
MQServer:/tmp/mq/432 # ./mqlicense.sh -accept
Licensed Materials - Property of IBM
                
 5724-H72
 (C) Copyright IBM Corporation 1994, 2005 All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.
Agreement accepted:  Proceed with install.
MQServer:/tmp/mq/432 #
MQServer:/tmp/mq/432 # rpm -ivh MQSeriesRuntime-6.0.0-0.i386.rpm MQSeriesSDK-6.0.0-0.i386.rpm MQSeriesServer-6.0.0-0.i386.rpm MQSeriesClient-6.0.0-0.i386.rpm MQSeriesSamples-6.0.0-0.i386.rpm MQSeriesJava-6.0.0-0.i386.rpm MQSeriesMan-6.0.0-0.i386.rpmPreparing...                ########################################### [100%]
   1:MQSeriesRuntime        ########################################### [ 14%]
   2:MQSeriesSDK            ########################################### [ 29%]
   3:MQSeriesServer         ########################################### [ 43%]
   4:MQSeriesClient         ########################################### [ 57%]
   5:MQSeriesSamples        ########################################### [ 71%]
   6:MQSeriesJava           ########################################### [ 86%]
   7:MQSeriesMan            ########################################### [100%]
MQServer:/tmp/mq/432 # rpm -ivh --force --nodeps MQSeriesFTA-6.0.0-0.i386.rpm MQSeriesIES30-6.0.0-0.i386.rpm MQSeriesConfig-6.0.0-0.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesIES30          ########################################### [ 33%]
   2:MQSeriesFTA            ########################################### [ 67%]
   3:MQSeriesConfig         ########################################### [100%]
MQServer:/tmp/mq/432 #
MQServer:/tmp/mq/432 # ls -l
total 782236
drwxr-xr-x   6 root root       1408 Mar 26 00:42 .
drwxr-xr-x   3 root root        176 Mar 26 00:39 ..
-r--r--r--   1 root 12201  56517147 May 20  2005 IBMJava2-SDK-1.4.2-0.0.i386.rpm
-rw-rw-r--   1 root 12201    963879 May 20  2005 MQSeriesClient-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201  84765428 May 20  2005 MQSeriesConfig-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    719764 May 20  2005 MQSeriesFTA-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201 163979050 May 20  2005 MQSeriesIES30-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201   3681759 May 20  2005 MQSeriesJava-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201  37483080 May 20  2005 MQSeriesKeyMan-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    130189 May 20  2005 MQSeriesMan-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    111975 May 20  2005 MQSeriesMsg_Zh_CN-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    116214 May 20  2005 MQSeriesMsg_Zh_TW-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    136622 May 20  2005 MQSeriesMsg_de-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    128491 May 20  2005 MQSeriesMsg_es-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    130044 May 20  2005 MQSeriesMsg_fr-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    128327 May 20  2005 MQSeriesMsg_it-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    122076 May 20  2005 MQSeriesMsg_ja-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    116664 May 20  2005 MQSeriesMsg_ko-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    127411 May 20  2005 MQSeriesMsg_pt-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201   7877738 May 20  2005 MQSeriesRuntime-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201    229101 May 20  2005 MQSeriesSDK-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201   1307081 May 20  2005 MQSeriesSamples-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201   5089089 May 20  2005 MQSeriesServer-6.0.0-0.i386.rpm
-rw-rw-r--   1 root 12201     21376 May 20  2005 MQSeriesTXClient-6.0.0-0.i386.rpm
-rw-r--r--   1 root root  432261120 Feb 22 11:48 MQforLinux601.tar
drwxrwxr-x   3 root 12201        72 May 20  2005 PreReqs
drwxrwxr-x  14 root 12201       352 May 20  2005 READMEs
-r--r--r--   1 root 12201       261 May 20  2005 copyright
-r--r--r--   1 root 12201   3988581 May 20  2005 gsk7bas-7.0-3.15.i386.rpm
drwxrwxr-x   4 root 12201       144 May 20  2005 lap
drwxrwxr-x   2 root 12201       704 May 20  2005 licenses
-rwxr-xr-x   1 root 12201      4770 May 20  2005 mqlicense.sh
-rwxr-xr-x   1 root 12201     35314 May 23  2005 readadd.txt
MQServer:/tmp/mq/432 #
MQServer:/tmp/mq # mkdir 378
MQServer:/tmp/mq # mv 6.0-WS-MQ-LinuxIA32-RP0002.tar ./378
MQServer:/tmp/mq # ls -l
total 5278
drwxr-xr-x   4 root root     152 Mar 26 00:54 .
drwxrwxrwt  13 root root     544 Mar 26 00:53 ..
drwxr-xr-x   2 root root      96 Mar 26 00:54 378
drwxr-xr-x   6 root root     280 Mar 26 00:53 432
-rw-r--r--   1 root root 5396480 Feb 22 11:48 6.0.2.0-WS-MQ-LinuxIA32-LAIY96282.tar
MQServer:/tmp/mq # cd 378
MQServer:/tmp/mq/378 # ls -l
total 370121
drwxr-xr-x  2 root root        96 Mar 26 00:54 .
drwxr-xr-x  4 root root       152 Mar 26 00:54 ..
-rw-r--r--  1 root root 378634240 Feb 22 11:46 6.0-WS-MQ-LinuxIA32-RP0002.tar
MQServer:/tmp/mq/378 #
MQServer:/tmp/mq/378 # tar xvf 6.0-WS-MQ-LinuxIA32-RP0002.tar ./
gsk7bas-7.0-3.18.i386.rpm
IBMJava2-142-ia32-SDK-1.4.2-5.0.i386.rpm
MQSeriesClient-U806639-6.0.2-0.i386.rpm
MQSeriesConfig-U806639-6.0.2-0.i386.rpm
MQSeriesFTA-U806639-6.0.2-0.i386.rpm
MQSeriesIES30-U806639-6.0.2-0.i386.rpm
MQSeriesJava-U806639-6.0.2-0.i386.rpm
MQSeriesKeyMan-U806639-6.0.2-0.i386.rpm
MQSeriesMan-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_de-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_es-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_fr-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_it-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_ja-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_ko-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_pt-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_Zh_CN-U806639-6.0.2-0.i386.rpm
MQSeriesMsg_Zh_TW-U806639-6.0.2-0.i386.rpm
MQSeriesRuntime-U806639-6.0.2-0.i386.rpm
MQSeriesSamples-U806639-6.0.2-0.i386.rpm
MQSeriesSDK-U806639-6.0.2-0.i386.rpm
MQSeriesServer-U806639-6.0.2-0.i386.rpm
MQSeriesTXClient-U806639-6.0.2-0.i386.rpm
memo.ptf
readme.txt
readadd.txt
MQServer:/tmp/mq/378 # ls -l
total 740263
drwxr-xr-x  2 root root       1488 Mar 26 00:54 .
drwxr-xr-x  4 root root        152 Mar 26 00:54 ..
-rw-r--r--  1 root root  378634240 Feb 22 11:46 6.0-WS-MQ-LinuxIA32-RP0002.tar
-r--r--r--  1 root 12201  58425242 Sep 28  2006 IBMJava2-142-ia32-SDK-1.4.2-5.0.i386.rpm
-rw-r--r--  1 root 12201   1041870 Sep 28  2006 MQSeriesClient-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201  92867916 Sep 28  2006 MQSeriesConfig-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    742674 Sep 28  2006 MQSeriesFTA-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201 165192528 Sep 28  2006 MQSeriesIES30-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201   6825037 Sep 28  2006 MQSeriesJava-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201  37541482 Sep 28  2006 MQSeriesKeyMan-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    158230 Sep 28  2006 MQSeriesMan-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    133102 Sep 28  2006 MQSeriesMsg_Zh_CN-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    137261 Sep 28  2006 MQSeriesMsg_Zh_TW-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    157792 Sep 28  2006 MQSeriesMsg_de-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    149548 Sep 28  2006 MQSeriesMsg_es-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    151037 Sep 28  2006 MQSeriesMsg_fr-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    149446 Sep 28  2006 MQSeriesMsg_it-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    143167 Sep 28  2006 MQSeriesMsg_ja-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    139096 Sep 28  2006 MQSeriesMsg_ko-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    148484 Sep 28  2006 MQSeriesMsg_pt-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201   3482646 Sep 28  2006 MQSeriesRuntime-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201    227539 Sep 28  2006 MQSeriesSDK-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201   1360466 Sep 28  2006 MQSeriesSamples-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201   5179708 Sep 28  2006 MQSeriesServer-U806639-6.0.2-0.i386.rpm
-rw-r--r--  1 root 12201     44639 Sep 28  2006 MQSeriesTXClient-U806639-6.0.2-0.i386.rpm
-r--r--r--  1 root 12201   4021017 Sep 28  2006 gsk7bas-7.0-3.18.i386.rpm
-r--r--r--  1 root 12201     43127 Sep 28  2006 memo.ptf
-r--r--r--  1 root 12201     30584 Sep 28  2006 readadd.txt
-r--r--r--  1 root 12201    118226 Sep 28  2006 readme.txt
MQServer:/tmp/mq/378 # rpm -ivh MQSeriesIES30-U806639-6.0.2-0.i386.rpm MQSeriesSamples-U806639-6.0.2-0.i386.rpm MQSeriesSDK-U806639-6.0.2-0.i386.rpm MQSeriesJava-U806639-6.0.2-0.i386.rpm MQSeriesConfig-U806639-6.0.2-0.i386.rpm MQSeriesServer-U806639-6.0.2-0.i386.rpm MQSeriesMan-U806639-6.0.2-0.i386.rpm MQSeriesClient-U806639-6.0.2-0.i386.rpm MQSeriesRuntime-U806639-6.0.2-0.i386.rpm MQSeriesFTA-U806639-6.0.2-0.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesFTA-U806639    ########################################### [ 10%]
   2:MQSeriesIES30-U806639  ########################################### [ 20%]
   3:MQSeriesSamples-U806639########################################### [ 30%]
   4:MQSeriesSDK-U806639    ########################################### [ 40%]
   5:MQSeriesJava-U806639   ########################################### [ 50%]
   6:MQSeriesConfig-U806639 ########################################### [ 60%]
   7:MQSeriesServer-U806639 ########################################### [ 70%]
   8:MQSeriesMan-U806639    ########################################### [ 80%]
   9:MQSeriesClient-U806639 ########################################### [ 90%]
  10:MQSeriesRuntime-U806639########################################### [100%]
MQServer:/tmp/mq/# mkdir 53
MQServer:/tmp/mq/# mv 6.0.2.0-WS-MQ-LinuxIA32-LAIY96282.tar ./53
MQServer:/tmp/mq/# cd 53
MQServer:/tmp/mq/53/#  tar xvf 6.0.2.0-WS-MQ-LinuxIA32-LAIY96282.tar
MQServer:/tmp/mq/# cp /tmp/mq/53/lib/libmqmcs.so /opt/mqm/lib/libmqmcs.so   
MQServer:/tmp/mq/# cp /tmp/mq/53/lib/libmqmcs_r.so /opt/mqm/lib/libmqmcs_r.so
MQServer:/tmp/mq/# cp /tmp/mq/53/lib/libmqz.so /opt/mqm/lib/libmqz.so       
MQServer:/tmp/mq/# cp /tmp/mq/53/lib/libmqz_r.so /opt/mqm/lib/libmqz_r.so
MQServer:/tmp/mq/# su - mqm
MQServer:/tmp/mq/~> dspmqver
Name:        WebSphere MQ      
Version:     6.0.2.0           
CMVC level:  p600-200-060921   
BuildType:   IKAP - (Production)

Linux下检查系统开放的端口及服务

以下是在RHEL5中运行示例: [root@RHEL5 ~]# nmap -sT -O localhost
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2008-03-19 22:14 CST
mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns_servers
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1670 closed ports

PORT     STATE SERVICE
21/tcp   open  ftp
22/tcp   open  ssh
23/tcp   open  telnet
25/tcp   open  smtp
111/tcp  open  rpcbind
609/tcp  open  npmp-trap
631/tcp  open  ipp
1521/tcp open  oracle
2601/tcp open  zebra
6103/tcp open  RETS-or-BackupExec

No exact OS matches for host (If you know what OS is running on it, see http://www.insecure.org/cgi-bin/nmap-submit.cgi).
TCP/IP fingerprint:
SInfo(V=4.11%P=i686-redhat-linux-gnu%D=3/19%Tm=47E11FD8%O=21%C=1)

Nmap finished: 1 IP address (1 host up) scanned in 9.886 seconds
或者使用netstat -anp命令来查看:
[root@RHEL5 ~]# netstat -anp | grep LISTEN
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 127.0.0.1:2208              0.0.0.0:*                   LISTEN      1894/hpiod         
tcp        0      0 0.0.0.0:609                 0.0.0.0:*                   LISTEN      1699/rpc.statd     
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1669/portmap       
tcp        0      0 0.0.0.0:1521                0.0.0.0:*                   LISTEN      29463/tnslsnr      
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      25248/vsftpd       
tcp        0      0 0.0.0.0:23                  0.0.0.0:*                   LISTEN      25182/xinetd       
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1911/cupsd         
tcp        0      0 0.0.0.0:6103                0.0.0.0:*                   LISTEN      29394/ora_d000_ora1
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1971/sendmail: acce
tcp        0      0 127.0.0.1:2207              0.0.0.0:*                   LISTEN      1899/python        
tcp        0      0 :::2601                     :::*                        LISTEN      3039/zebra         
tcp        0      0 :::22                       :::*                        LISTEN      1925/sshd

[root@RHEL5 ~]# lsof -n -i | grep LISTEN
COMMAND     PID      USER    FD      TYPE     DEVICE    SIZE  NODE    NAME
portmap     1669     rpc     4u      IPv4     4861            TCP     *:sunrpc (LISTEN)
rpc.statd   1699     root    7u      IPv4     4930            TCP     *:npmp-trap (LISTEN)
hpiod       1894     root    0u      IPv4     5369            TCP     127.0.0.1:2208 (LISTEN)
python      1899     root    4u      IPv4     5405            TCP     127.0.0.1:2207 (LISTEN)
cupsd       1911     root    2u      IPv4     791632          TCP     127.0.0.1:ipp (LISTEN)
sshd        1925     root    3u      IPv6     5461            TCP     *:ssh (LISTEN)
sendmail    1971     root    4u      IPv4     5627            TCP     127.0.0.1:smtp (LISTEN)
zebra       3039     root    10u     IPv6     9912            TCP     *:discp-client (LISTEN)
xinetd      25182    root    5u      IPv4     879173          TCP     *:telnet (LISTEN)
vsftpd      25248    root    3u      IPv4     879367          TCP     *:ftp (LISTEN)
oracle      29394    oracle  17u     IPv4     285612          TCP     *:rets (LISTEN)
tnslsnr     29463    oracle  7u      IPv4     286748          TCP     *:ncube-lm (LISTEN)

2010年12月8日星期三

SUSE Linux 11 /etc/vsftpd.conf

SUSE11:/ # cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 0

SUSE11:/ # cat /etc/vsftpd.conf
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# If you do not change anything here you will have a minimum setup for an
# anonymus FTP server.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.

# General Settings
#
# Uncomment this to enable any form of FTP write command.
#
write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
dirmessage_enable=YES
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#
nopriv_user=ftpsecure
#
# You may fully customise the login banner string:
#
ftpd_banner="Welcome to FOOBAR FTP service."
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#
#ls_recurse_enable=YES
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#
#deny_email_enable=YES
#
# (default follows)
#
#banned_email_file=/etc/vsftpd.banned_emails
#
# If  enabled,  all  user  and  group  information in
# directory listings will be displayed as "ftp".
#
#hide_ids=YES

# Local FTP user Settings
#
# Uncomment this to allow local users to log in.
#
local_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
local_umask=022
#
# Uncomment to put local users in a chroot() jail in their home directory
# after login.
#
#chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#
#chroot_list_enable=YES
#
# (default follows)
#
#chroot_list_file=/etc/vsftpd.chroot_list
#
# The maximum data transfer rate permitted, in bytes per second, for
# local authenticated users. The default is 0 (unlimited).
#
#local_max_rate=7200


# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
#anonymous_enable=YES
#
# Anonymous users will only be allowed to download files which are
# world readable.
#
#anon_world_readable_only=YES
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#
#anon_upload_enable=YES
#
# Default umask for anonymus users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
#anon_umask=022
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#
#anon_mkdir_write_enable=YES
#
# Uncomment this to enable anonymus FTP users to perform other write operations
# like deletion and renaming.
#
#anon_other_write_enable=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#
#chown_uploads=YES
#chown_username=whoever
#
# The maximum data transfer rate permitted, in bytes per second, for anonymous
# authenticated users. The default is 0 (unlimited).
#
#anon_max_rate=7200


# Log Settings
#
# Log to the syslog daemon instead of using an logfile.
#
#syslog_enable=YES
#
# Uncomment this to log all FTP requests and responses.
#
#log_ftp_protocol=YES
#
# Activate logging of uploads/downloads.
#
#xferlog_enable=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#vsftpd_log_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note: This disables the normal logging unless you enable dual_log_enable below.
#
#xferlog_std_format=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#xferlog_file=/var/log/xferlog
#
# Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log.
#
#dual_log_enable=YES
#
# Uncomment this to enable session status information in the system process listing.
#
#setproctitle_enable=YES

# Transfer Settings
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
connect_from_port_20=YES
#
# You may change the default value for timing out an idle session.
#
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#
#data_connection_timeout=120
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# Set to NO if you want to disallow the  PASV  method of obtaining a data
# connection.
#
#pasv_enable=NO

# PAM setting. Do NOT change this unless you know what you do!
#
pam_service_name=vsftpd

# Set listen=YES if you want vsftpd to run standalone
#
#listen=YES

# Set to ssl_enable=YES if you want to enable SSL
ssl_enable=NO

# Limit passive ports to this range to assis firewalling
pasv_min_port=30000
pasv_max_port=30100

2010年12月7日星期二

SuSe Linux:ftp 500 OOPS: could not bind listening IPv4 socket

        往一台Suse Linux 9 ftp文件时,发现报错:500 OOPS:could not bind listening IPv4 socket,如下所示:
SuSe9#ftp 10.10.10.10Connected to localhost.
500 OOPS: could not bind listening IPv4 socket
检查vsftpd状态,可知已启用,如下所示:
SuSe9#chkconfig --list vsftpd
xinetd based services:
        vsftpd:             on

Suse Linux vsftpd服务默认是在xinetd模式下运行,检查/etc/vsftpd.conf文件可发现,listen=YES前面的#号符已去掉,即开启vsftpd运行在standalone模式(见以下红色部分),以下为完整的vsftpd.conf文件配置:
SuSe9#cat vsftpd.conf
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# If you do not change anything here you will have a minimum setup for an
# anonymus FTP server.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
# General Settings
#
# Uncomment this to enable any form of FTP write command.
#
write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
dirmessage_enable=YES
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#
#nopriv_user=ftpsecure
#
# You may fully customise the login banner string:
#
ftpd_banner="Welcome to FOOBAR FTP service."
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#
ls_recurse_enable=YES
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#
#deny_email_enable=YES
#
# (default follows)
#
#banned_email_file=/etc/vsftpd.banned_emails
#
# If  enabled,  all  user  and  group  information in
# directory listings will be displayed as "ftp".
#
#hide_ids=YES
# Local FTP user Settings
#
# Uncomment this to allow local users to log in.
#
local_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
local_umask=022
#
# Uncomment to put local users in a chroot() jail in their home directory
# after login.
#
#chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#
chroot_list_enable=YES
#
# (default follows)
#
#chroot_list_file=/etc/vsftpd.chroot_list
#
# The maximum data transfer rate permitted, in bytes per second, for
# local authenticated users. The default is 0 (unlimited).
#
#local_max_rate=7200

# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
#anonymous_enable=YES
#
# Anonymous users will only be allowed to download files which are
# world readable.
#
#anon_world_readable_only=YES
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#
#anon_upload_enable=YES
#
# Default umask for anonymus users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
#anon_umask=022
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#
#anon_mkdir_write_enable=YES
#
# Uncomment this to enable anonymus FTP users to perform other write operations
# like deletion and renaming.
#
#anon_other_write_enable=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#
#chown_uploads=YES
#chown_username=whoever
#
# The maximum data transfer rate permitted, in bytes per second, for anonymous
# authenticated users. The default is 0 (unlimited).
#
#anon_max_rate=7200

# Log Settings
#
# Log to the syslog daemon instead of using an logfile.
#
syslog_enable=YES
#
# Uncomment this to log all FTP requests and responses.
#
log_ftp_protocol=YES
#
# Activate logging of uploads/downloads.
#
xferlog_enable=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
vsftpd_log_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note: This disables the normal logging unless you enable dual_log_enable below.
#
xferlog_std_format=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
xferlog_file=/var/log/xferlog
#
# Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log.
#
dual_log_enable=YES
#
# Uncomment this to enable session status information in the system process listing.
#
#setproctitle_enable=YES
# Transfer Settings
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
connect_from_port_20=YES
#
# You may change the default value for timing out an idle session.
#
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#
#data_connection_timeout=120
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# Set to NO if you want to disallow the  PASV  method of obtaining a data
# connection.
#
#pasv_enable=NO
# PAM setting. Do NOT change this unless you know what you do!
#
pam_service_name=vsftpd
# Set listen=YES if you want vsftpd to run standalone
#
listen=YES

把listen=YES关闭,即把“listen=YES”修改为“#listen=YES”后ftp恢复正常,如下所示:
Suse9#ftp 10.10.10.10 Connected to gdCMs2.
220 "Welcome to FOOBAR FTP service."
Name (10.10.10.10:root):

2010年12月4日星期六

linux/unix平台下sqlplus 按Backspace键删除时出现^H的处理方法

    在linux/unix平台的sqplus中,输出字符后按Backspace键删除时,会出现^H,这对习惯了按Backspace键删除的用户来说,感觉非常别扭,虽然可以通过Ctrl+Backspace组合键实现删除功能。故障现象如下:

    可通过stty命令修改终端配置来实现Backspace删除功能。如下:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty erase ^h
若要恢复Ctrl+Backspace组合键删除功能,可执行以下命令:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty erase ^?
同时可通过stty -a查看所有的终端设置:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty -aspeed 38400 baud; rows 42; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

2010年11月14日星期日

linux/unix平台下sqlplus 按Backspace键删除时出现^H的处理方法

        在linux/unix平台的sqplus中,输出字符后按Backspace键删除时,会出现^H,这对习惯了按Backspace键删除的用户来说,感觉非常别扭,虽然可以通过Ctrl+Backspace组合键实现删除功能。故障现象如下:

可通过stty命令修改终端配置来实现Backspace删除功能。如下:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty erase ^h
若要恢复Ctrl+Backspace组合键删除功能,可执行以下命令:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty erase ^?
同时可通过stty -a查看所有的终端设置:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty -aspeed 38400 baud; rows 42; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

设置系统(Linux)对ping没有反应

操作系统平台:
[root@RHEL5 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
设置之前测试:

通过以下命令设置系统对ping没有反应:
[root@RHEL5 ~]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[root@RHEL5 ~]# echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
设置后立即生效,不间断测试如下:

2010年11月10日星期三

RHEL Server 5 PV管理实践系列之三--pvmove(搬迁数据)

当发现系统中某块硬盘有问题后,需要及时把数据转移到新硬盘中。在转移数据时,不要求卸载文件系统,但建议在数据转移前进行备份,以防转移进程中意外导致数据丢失。
    pvmove用来实现数据转移,根据数据量的多少,它可能要使用大量的时间,并可降低逻辑卷的性能,因此要在系统不太忙时操作。
    备注:新硬盘容量一定在大于旧硬盘中的数据容量,并且新旧硬盘必须在同一个VG中,如下所示:

现在假定/dev/hdb2这块“盘”存在故障,需要将数据转移到新“盘”/dev/hdb1中。首先把/dev/hdb1加入到oldvg中,如下:

为了模拟需要,现在/dev/hdb2上创建了一个LV:/dev/oldvg/lvol0,并创建为ext3文件系统挂载到/tmp/dvd上,并在上面创建了一个测试文件:

利用pvmove命令转移数据(所需时间视数据量大小而定),如下:

把块“盘”/dev/hdb2从oldvg中剔出(剔出后可以把这块“坏”盘从主机中拨出),如下所示:

查验:

RHEL Server 5 VG管理实践系列之七--删除VG

前提:被删除的VG不能有LV。删除一个含有LV的VG会报以下错误:

可通过以下命令查看testvg中包含的那个LV:

利用lvremove把此LV从testvg中删除:

最后通过vgremove命令删除testvg:

验证testvg是否被成功删除:

如何限制或者修改/dev/shm大小

在红帽企业版Linux的应用程序如果遵循POSIX或者使用GLIBC(2.2和更高版本),通常使用/dev/shm作共享内存(shm_open,shm_unlink)。/dev/shm是一个临时文件系统(tmpfs),可以从/etc/fstab中mount。因此,支持标准的参数例如"size",可以用来增加或者减少在/dev/shm上的tmpfs大小.(默认的,它的大小是系统RAM的一半)。
例如:为了将/dev/shm的大小增加到1GB,修改/etc/fstab的这行:默认的:

改为:

size参数也可以用G作单位:size=1G。
重新mount /dev/shm使之生效:

马上可以用"df -h"命令检查变化,如下所示:

RHEL Server 5 VG管理实践系列之六--激活/关闭VG

VG在始创建时缺省是被系统自动激活的,有时需要关闭某个VG。前提是此VG中没有处于“OPEN”状态的LV。如下所示:

    从vgchange命令输出可知,当VG中有打开的LV时,无法关闭该VG。从下面的vgdisplay -v testvg输出中可知“testvg”VG中确实有一个名为“/dev/testvg/testlv1”的LV处于available状态:

    尝试关闭“/dev/testvg/testlv1”LV,如下:

    提示该LV正被使用,无法关闭。从以下df -Th和ls -l /dev/testvg/testlv1命令输出可知,该LV正以ext3格式文件系统被挂载到/testlv1被系统使用:

    卸下该文件系统挂载点后再关闭LV,最后成功关闭VG,过程如下:

    此时查看“testvg”VG状态,从黑色部分可知,Cur LV=1,但Open LV=0,说明其下的“/dev/testvg/testlv1”LV处于休眠无效状态,即该VG也处于休眠无效状态:

RHEL Server 5 VG管理实践系列之五--修改VG属性

LVM2类型的VG始创建时缺省PE大小为4MB,VG容纳PV/LV数为无限制。一般如下所示:

有时实际需要,可能需要把缺省的PE Size=4MB调整为8MB,可以通过vgchange -s参数修改:

查看“testvg”VG的PE Size是否成功修改:

由上面黑色部分可知,PE Size=8MB,已成功修改。vgchange命令的详细参数可见:man vgchange。

RHEL Server 5 VG管理实践系列之四--从VG中移除PV

当需要从VG中移除PV时,前提是该PV必须未被使用。可以通过pvdisplay pv_name输出中的“Allocated PE”项确定,若“Allocated PE”=0,则表示该PV未被使用。如果此PV在使用,则应通过pvmove命令把数据移到其它PV上。
以上pvdisplay输出可知“/dev/hdb2”PV未被使用。

从下面可知,“/dev/hdb2”PV已经不属于“testvg”VG了:

RHEL Server 5 VG管理实践系列之三--显示VG信息

列出系统中所有的VG:

由上可知,系统中有两个VG:testvg和VolGroup00,类型为:lvm2。
显示VG简要信息:
显示VG详细属性信息:

    vgdisplay命令输出包括VG名称、格式类型、状态、当前含有LV/PV数、最大LV/PV数、VG大小、PE大小及数量、VG剩余空间及VG UUID。

RHEL Server 5 VG管理实践系列之二--往VG里添加PV

当一个VG空间不够时,可以往VG里添加PV以达到增大VG空间的效果。前提是往VG里添加的PV还未被使用。如下所示,“/dev/hdb2”PV还不属于任何VG,即还未被使用:

查看一下“/dev/hdb2”PV未添加到“testvg”VG之前testvg的大小:

通过以下命令把“/dev/hdb2”添加到“testvg”VG中:

查看一下“/dev/hdb2”PV添加到“testvg”VG之后testvg的大小:

由上可知,“testvg”VG空间由原来的13.97GB增加到14.43GB。

RHEL Server 5 VG管理实践系列之一--创建VG

创建VG前提:系统已成功创建PV。VG就是若干个PV的组合,也就是说一个VG包含一个PV或数个PV。以下为vgcreate命令格式详细说明:

以下命令创建一个名为testvg的VG:

vgcreate命令有三个参数,如下:
-l,--maxlogicalvolumes:设置VG允许最大的LV数,lvm1缺省最大值为256,lvm2缺省无限制;
-p,--maxphysicalvolumes:设置VG允许最大的PV数,lvm1缺省最大值为256,lvm2缺省无限制;
-s,--physicalextentsize:设置VG的PE大小,缺省为4MB。
下图是LVM1与LVM2的对比:

2010年11月9日星期二

RHEL Server 5 PV管理实践系列之二--删除PV

分两种情况:
一种是还未使用的PV,即通过pvdisplay显示pv属性关键字Allocatable=NO,如下:

这种情况可以使用不加任何参数的pvremove命令即可成功删除PV,如下:

检查是否被成功删除:

另一种情况是已经被使用的PV,即通过pvdisplay显示pv属性关键字Allocatable=yes,如下:

这种情况可以使用加-ff参数的pvremove命令强制删除(数据全部丢失),如下:

注:如果被强制删除的PV所在的VG里只有一个PV(即被强制删除的PV),在PV被强制删除后,VG也跟着被删除消失,如下:

RHEL Server 5 PV管理实践系列之一--创建PV

一、创建PV
1、设置分区类型
   设置用来创建PV的分区类型为:Linux LVM(code:0x8e),如下所示,/dev/hdb为一块未做任何处理(分区)的硬盘:

使用fdisk /dev/hdb命令创建Linux LVM分区过程如下所示:

通过fdisk -l发现系统已经创建一个大小为15000MB的Linux LVM类型的分区:/dev/hdb1,如下所示:

2、初始化PV(创建PV)
通过pvcreate /dev/hdb1初始化PV:

3、显示创建为LVM PV的设备

从lvmdiskscan结果可发现,/dev/hdb1已经被创建为PV了。
4、显示PV
列出系统中所有PV:

显示PV简要信息:

显示PV详细信息: