2008年6月30日 星期一

在RHEL5架設DNS Server

RHEL5跟以往RHEL4與RHEL3在架設DNS Server時,有些不一樣,
不一樣的地方在於,ㄟ~~configure file怎麼都沒看到哩,
還有預設的zone files哩,怎麼都沒有呀?!要我自己產生嗎?
OH MY GOD! 那有可能呀!所幸今天在高人的指點下,
找到了這些檔案身在何處呀!果然是高手高手高高手呀!

01- 安裝system-config-bind這隻套件
02- 到/usr/share/system-config-bind/profiles/下就可以找到named.conf與zone files.
03- 接下來把named.conf copy到 /var/named/chroot/etc/
04- 再把zone files copy到 /var/named/chroot/var/named/
05- 最後把將 /usr/share/doc/bind-*/sample/var/named/named.root copy到/var/named/chroot/var/named/

這樣就大功告成啦!剩下的就是自己改named.conf與新增網域正反解的zone files囉!
文張轉載自 http://go-linux.blogspot.com/2007/06/rhel5dns-server.html

2008年6月25日 星期三

How to set size limits for messages in Exchange Server

This article was previously published under Q322679

On This Page
SUMMARY
MORE INFORMATION
Global setting
Connector setting
SMTP virtual server setting
User mailbox setting
Examples of effective size limits
Example 1
Example 2

SUMMARY
This article describes the different kinds of limits that you can set on message size in Microsoft Exchange 2000 Server and in Microsoft Exchange Server 2003. It also explains how you can set these limits.

Note If you have configured a size limit on either the Send or Receive sizes in global settings, the More Restrictive limit applies to both incoming and outgoing e-mail messages.

MORE INFORMATION
Size limits for messages depend on various settings. Settings can vary across users. You can customize the settings for the Exchange 2000 or Exchange 2003 organization, a specific connector, a specific virtual server, and an individual user.

Senders may receive a non-delivery report (NDR) that is similar to the following example if their messages are larger than their size limits:

Your message did not reach some or all of the intended recipients.
Subject: Test
Sent: 7/18/2002 2:40 PM
The following recipient(s) could not be reached:
Test Recipient on 7/18/2002 2:41 PM
This message is larger than the current system limit or the recipient's mailbox is full. Create a shorter message body or remove attachments and try sending it again.

Global setting
This setting determines the maximum size of the messages in the Exchange 2000 organization; the messages can be incoming, outgoing, or internal.

To configure the global setting, follow these steps:
1.Start Exchange System Manager. To do this, click Start, point to Programs, point to Microsoft Exchange, and then click System Manager.
2.Expand Global Settings.
3.Right-click Message Delivery, and then click Properties.
4.Click the Default tab to configure the global settings.

Connector setting

The settings for each connector control the maximum size of outgoing messages that users can send through the connector.

To configure the connector settings, follow these steps:

1.Click Start, point to Programs, point to Microsoft Exchange, and then click System Manager.
2.Expand Administrative Groups, and then expand Administrative Group Name, where Administrative Group Name is the name of your administrative group.
3.Expand Routing Groups, and then expand Routing Group Name, where Routing Group Name is the name of your routing group.
4.Expand Connectors, right-click the connector that you want to configure, and then click Properties.
5.On the Content Restrictions tab, under Allowed sizes, click to select the Only messages less than (KB) check box, and then type the size (in KB) that you want to permit.

SMTP virtual server setting
This setting determines the maximum size of a message that is permitted to pass through a virtual server. The virtual server advertises the limit by means of the Extended Simple Mail Transfer Protocol (ESMTP) SIZE command verb (RFC 1870).

Note The protocol size restriction is meant to reject messages on boundaries with other e-mail systems. These restrictions are effective for individual servers and should not be used as methods to limit the message size in an Exchange enterprise server group. Administrators can set the message delivery option in the global settings to limit and to control the message size restriction across an organization that uses Exchange 2000 or Exchange 2003. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

326154 The OAB does not replicate if you set a message size restriction at the transport level

To configure the Simple Mail Transfer Protocol (SMTP) virtual server setting, follow these steps:
1.Click Start, point to Programs, point to Microsoft Exchange, and then click System Manager.
2.Expand Administrative Groups, and then expand Your Administrative Group Name, where Your Administrative Group Name is the name of your administrative group.
3.Expand Servers, and then expand Your Server Name, where Your Server Name is the name of your server.
4.Expand Protocols, and then expand the SMTP node.
5.Right-click SMTP Virtual Server Name, where SMTP Virtual Server Name is the name of your SMTP virtual server, and then click Properties.
6.Click the Messages tab to set the maximum size that you want to permit.

User mailbox setting
This setting determines the maximum size of a message that users can send or receive through their mailboxes. User mailbox settings are enforced by the information store instead of by the message categorizer. The information store prevents an oversized message from being sent to Transport if the message size exceeds the user mailbox maximum message size setting.

To configure an individual user's mailbox settings, follow these steps:
1.
Start the Active Directory Users and Computers snap-in, and then locate the user account that you want to configure.
2.
Right-click the user's account, and then click Properties.
3.
Click the Exchange General tab, and then click Delivery Restrictions to set the maximum size that you want to permit.

Note The size of SMTP messages that are sent between routing groups and to the Internet increase by about 30 percent if they contain binary attachments or other 8-bit data.

Examples of effective size limits
Example 1
In this example, the following size limits have been configured:
•The global setting is set to 5 MB.
•The Exchange SMTP connector is set to 3 MB.
•The SMTP virtual server is set to 4 MB.
•The user mailbox setting is set to 2 MB.

Because of these settings, users in the Exchange 2000 or Exchange 2003 organization can send and receive messages that are a maximum of 5 MB. Users can send messages through the connector that are a maximum of 3 MB. All mail that passes through the SMTP Virtual Server (sending or receiving) is limited to 4MB. The individual user, whose mailbox setting is 2 MB, is also limited to sending and receiving messages that are a maximum of 2 MB.

Example 2

In this example, the following size limits have been configured:
•The global setting is set to 2 MB.
•The Exchange 2000 SMTP connector is set to 5 MB.
•The SMTP virtual server is set to 2 MB.
•The user mailbox setting is set to 3 MB.

The global setting is 2 MB. Therefore, all the users who are using the default global setting in the Exchange 2000 Server organization or in the Exchange Server 2003 organization are limited to sending and receiving messages that are a maximum of 2 MB. If an individual user has a mailbox setting of 3 MB, that user overrides the global setting.

Note All Internet e-mail messages use the global setting for limits on sending and on receiving. The message categorizer evaluates the sender's sending limit and the recipient's receiving limit. In example 2 earlier, a user with a user mailbox limit of 3 MB could receive messages from another user with a 3-MB sending limit. Because Internet users use the global setting, they can send only a 2-MB message.

APPLIES TO
•Microsoft Exchange Server 2003 Enterprise Edition
•Microsoft Exchange Server 2003 Standard Edition
•Microsoft Exchange 2000 Server Standard Edition


Keywords: kbinfo KB322679

2008年6月20日 星期五

JBoss 程式 ReLoad

JBoss 在布署程式完成啟動後
若布署的程式變動,只需要Touch /opt/app/GLORY.war/WEB-INF/web.xml 這個檔案,JBoss 就會ReLoad 這一個程式

2008年6月16日 星期一

JDK安裝

1.OS:Linux (RH4 or Fedora皆可)
2.下載 j2sdk-1_4_2_13-linux-i586-rpm.bin
3.安裝chmod 755 j2sdk-1_4_2_13-linux-i586-rpm.bin
4.執行./j2sdk-1_4_2_13-linux-i586-rpm.bin
5.版權說明,最後要輸入yes
6.rpm -Uvh j2sdk-1_4_2_13-linux-i586.rpm
7.cd /usr/java/j2sdk1.4.2_13/bin
8../java -version 可以看安裝的版本為何
java version "1.4.2_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_13-b06)
Java HotSpot(TM) Client VM (build 1.4.2_13-b06, mixed mode)

/etc/hosts.deny 用法

/etc/hosts.deny
vsftpd:192.168.1.0/255.255.255.0
sshd:192.168.1.0/255.255.255.0

IPTABLES

Chkconfig iptables on
Service iptables restart
Iptables –L 列出設定
Iptables –F 清除設定
Service iptables save 存檔

AutoMount 用法

Chkconfig autofs on
Vi /etc/auto.master
/data /etc/auto.misc –timeout=60
vi /etc/auto.misc
* -ro,soft,intr 192.168.0.250:/home/rhome/&
mkdir /home/rhome
chmod 777 /home/rhome
service autofs restart

拯救 LVM File System 方式

週六, 二月 18, 2006, 11:58 AM - 技術小技巧, Linux
因為誤砍 /etc 導致無法正常登入與開關機.. 拯救過程如下:
1. 使用 原本安裝光碟開機.. [F5] 知道使用 linux rescue 方式啟動
2. 因為使用 LVM 所以會發現找不到開機區, 所以進入 # 模式
3. 透過 Google 老師指點找到 http://wiki.linuxquestions.org/wiki/LVM 文章
4. 依樣在 # 模式下輸入:
a. lvm vgsvcan
b. lvm vgchange -a y <-- 這樣就可以看到 /dev/VdGroup* 的設備
c. cd /mnt
d. mkdir root
f. mount /dev/VolGroup00/LogVol00 /mnt/root <-- 這樣就可以將原本的 / 對應到 /mnt/root 內
5. cd /mnt/root 之後就可以開始修改 /etc 拯救了..
6.fsck /dev/VolGroup00/LogVol00 做磁碟修復檢查
以上內容來自 <http://web.ichiayi.com/blog/index.php?m=02&y=06&entry=entry060218-115828>

LVM 建立與使用

Fdisk /dev/hda
N +200M
T (dev/hdaxx) code=8e
P w
Partprobe
Pvcreate /dev/hdaxx /dev/hdaxx
Pvdisplay
Vgcreate vg00 /dev/hdaxx /dev/hdaxx
Vgdisplay
Lvcreate –l +100M -n lv00 vg00
Mke2fs –j /dev/vg00/lv00
Mount –t ext3 /dev/vg00/lv00 /media/lvm
Df –h

加大VG
vgextend vg00 /dev/hdaxx /dev/hdaxx

加大LV
lvextend -L +100M /dev/vg00/lv00

線上動態變更磁碟大小
ext2online /dev/vg00/lv00 該磁碟必須為已掛載狀態才能更新

REDHAT 5 後改用此指令
resize2fs  /dev/vg00/lv00   

因為resize2fs 只有 ext2, ext3, ext4,  如果是XFS 格式則改用

xfs_growfs /dev/vg00/lv00
若沒有安裝可以用以下指令
yum install xfsprogs.x86_64 –assumeyes

Crontab

Croutab –u username –e
分 時 日 月 星期 指令
1 15 * * * echo “hole!!” 每天的下午3:01分秀出 helo!!

Dovecot 建立

Chkconfig dovecot on
Vi /etc/dovecot.conf
找到#protocols = imap imaps
並改成protocols = pop3
service dovecot restart
netstat –ntlup grep 110

imaps
vi /etc/dovecot
找到pop3將”#”去除並加入iamps
找到iamps_listen 加上192.168.1.196
找到 ssl_cert_file= 並將兩行值皆改為
/usr/share/ssl/certs/dovecot.pem
cd /usr/share/ssl/certs/ 將原有dovecot.pem 刪除
make dovecot.pem
service dovecot restart
netstat –ntlup grep dovecot

不允許192.168.0.0/24網段進行存取
iptable –A INPUT –p tcp –dport 110 –s 192.168.0.0/255.255.255.0 –j REJECT
iptable –A INPUT –p tcp –dport 993 –s 192.168.0.0/255.255.255.0 –j REJECT
service iptables save

Quota 建立

Vi /etc/fstab
LABEL=/home1 /home ext3 defaults,usrquota,grpquo 0 0
Reboot
Quotacheck –auvg
Quotaon –auvg
Ls /home 是否有 aquota.user 及 aquota.group
Edquota g1 <<單為為KB block*soft >>
Filesystem blocks soft hard inodes soft hard
/dev/hda5 5000 3000 5000 8 0 0
設定完成,進行測試
dd if=/dev/zero of=test.txt bs=1024000 count=3 ->應該要出現警告
dd if=/dev/zero of=test.txt bs=1024000 count=5 ->應該要出現警告

Sendmail Server 建立

Chkconfig sendmail on
Vi /etc/mail/sendmail.mc
找到127.0.0.1複製並修改為192.168.1.196
m4 sendmail.mc > sendmail.cf
vi /etc/hosts
192.168.1.196 station00.example.com www00.exapmle.com
vi /etc/mail/access
192.168.1.196 RELAY
vi /etc/mail/local-host-names
station00.example.com
vi /etc/mail/virtusertabl
sysadmin@station00.example.com g2
service sendmail restart
netstat –ntlupgrep sendmail
cd /var/spool/mail
rm –rf *
echo “12345”mail g1@station00.example.com –s test1
ls 應該要有g1的檔案,可用cat看檔暗內容
echo “12345”mail sysadmin@station00.example.com –s test2
ls 應該要有g2的檔案,可用cat看檔暗內容

要求 SMTP 使用身份認証
vi /etc/mail/sendmail.mc
找到CRAM-MD5並將以下兩行的dnl去除
m4 sendmail.mc > sendmail.cf
chkconfig saslauthd on
service saslauthd restart
service sendmail restart
telnet 127.0.0.1 25
ehlo station00.example.com
應該要能看到250-AUTH DIGEST-MD5 CRAM-MD5 LOGIN PLAIN

smtp over ssl
vi /etc/mail/sendmail.mc
找到CACERT 並將以下四行dnl去除
m4 sendmail.mc > sendmail.cf
cd /usr/share/ssl/certs
make sendmail.pem

不允許192.168.0.0/24網段進行存取
iptable –A INPUT –p tcp –dport 25 –s 192.168.0.0/255.255.255.0 –j REJECT
service iptables save

NFS 建立

Chkconfig nfs on
Vi /etc/exprots
/data 192.168.1.0/255.255.255.0(rw)
service nfs restart
rpcinfo –p 127.0.0.1
showmount –e 192.168.1.196
mount –t nfs 192.168.1.196:/data /media/nfs
要確定/data目錄orther要有r及x權限(2775)

Samba Server 建立

Server
Chkconfig smb on
Vi /etc/samba/smb.conf
找到workgroup = MYGROUP
加上netbios name = ststion00
找到 hosts allow 將”#”去除,並確定網段192.168.1. 是否存在
找到[myshare]將”;”去除
path=/data
write list=g1
read list =g1 g2
smbpasswd –a g1
service smb restart
netstat –ntlup grep smbd
netstat –ntlup grep nmbd

Clinent
Ssmbclient –L //192.168.1.203 看遠端電腦的資源
mount –t smbfs –o username=antonio //192.168.1.203/linux /media/smb
開機自動掛載 vi /etc/fstab//192.168.1.203/linux /media/smb defaults,username=abc,password=xxx 0 0

Cups(Print) 建立

Chkconfig cups on
Vi /etc/cups/cups.conf
移到最後一行,將Listen 127.0.0.1:631 改為0.0.0.0:631
往上找到
區域內的Allow From 127.0.0.1改為本機IP
往上找到
區域內的Allow From 127.0.0.1 改為0.0.0.0
service cups restart
netstat –ntlupgrep 631

以瀏灠器開啟http://127.0.0.1:631

Squid(Proxy) 建立

Chkconfig squid on
Vi /etc/squid/squid.conf
找到http_port 3128改為8080
找到127.0.0.1加上一行
acl worklan src 192.168.1.0/255.255.255.0
往下找到https_access deny all,移到上一行加入
http_access allow homeland
service squid restart
netstat –ntlupgrep 8080
開啟瀏灠器,加上proxy設定,port 8080,並將快取空間設為0,再啟啟http://127.0.0.1確定可否看到畫面

Apache Server 建立

必須安裝的套件 httpd-2.xxx.ent.i386.rpm
rpm –ivh httpd.xxx.rpm
chkconfig httpd on
service httpd start
相關設定 /etc/httpd/conf/httpd.conf
網頁存放處 DocumentRoot “/var/www.html”
預設瀏覽檔案DirectoryIndex index.html index.html.var
個人網頁是否開放UserDir disable,若要開放,請將此行註解掉並將 UserDir public_html註解取消
將/home/username目錄權限設為701,chmod 701 /home/antonio
個人網頁存放處 UserDir public_html
啟動時server數 StartServers 8
閒置的最少數 MinSpareServer 5
閒置的最大數MaxSpareServer 20
同時啟動最大數 ServerLimit 256
client開啟最大數(可超過ServerLimit)MaxClients 256
一個Process執行次數MaxRequestsPerChild 4000
以何身份執行User apache
以何群組執行Group apach
回應Server資訊別ServerTokens Full OS Min
是否反解用戶端名稱Hostnamelookup Off
netstat –ntlup grep 80

VirtualHost –Name Base
mkdir /var/www/vhost
mkdir /var/www/vhost/name_base
mkdir /var/www/vhost/name_base/station00
mkdir /var/www/vhost/name_base/www00
echo “This is http://www00.example.corp” > /var/www/vhost/name_base/www00/index.html
echo “This is http://statuin00.example.corp” > /var/www/vhost/name_base/station00/index.html
設定主要檔 vi /etc/httpd/conf/httpd.conf
找到NameVirtualHost 192.168.1.97:80(刪除註解並加入自己的IP)
設定兩個NameBase 的設定檔
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/www00.conf
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/station00.conf

vi /etc/httpd/conf.d/www00.conf

ServerAdmin root@www00.example.corp
DocumentRoot /var/www/vhost/name_base/www00
ServerName www00.example.corp


vi /etc/httpd/conf.d/station00.conf

ServerAdmin root@station00.example.corp
DocumentRoot /var/www/vhost/name_base/station00
ServerName station00.example.corp

Service httpd restart
可用tail –f /var/log/messages 來觀查啟動成功與否

VSFTP Server 建立

須要安裝的套件 vsftpd-2.0.xxx.rpm
rpm –ivh vsftpdxxx.rpm
chkconfig vsftpd on
service vsftpd start
相關設定 /etc/vsftpd/vsftpd.conf
匿名存取anonymous_enable= YES NO
匿名上傳anon_upload_enable=YES NO
改變上傳擁有者chown_uploads=YES NO
改變上傳擁有者名chown_username=nobody
預設匿名上傳檔案屬性anon_umask=077
系統帳號可否登入 local_enable=YES NO
不可登入的帳號 /etc/vsftpd.ftpusers 一行一個user name
限制local user登入ftp僅能在home directory內動
chroot_list_enable=YES NO
設定何使用者僅能在home directory內動
/etc/vsftpd/chroot_list
同一IP可建立幾個連線max_per_ip=1
伺服器最大服務數max_clients=5
匿名下載頻寬anon_max_rate=1024(Byte/Sec)
系統帳號下載頻寬local_max_rate=1024(Byte/Sec)
vsftp 服務的IP listen_address=192.168.1.254
系統帳號使用者的根目錄 local_root=/var/ftp/localuser
匿名帳號使用者的根目錄 anon_root=/var/ftp/anonuser
幾秒無動作就斷線idle_session_timeout=60 (sec)
對個別使用者進行設定 user_config_dir=/etc/vsftpd/user_config
    在/etc/vsftpd/user_config目錄中建立檔案,檔名同帳號,其內設定與前述相同。
    例如:某一個使用者(andy)的目錄要放在/var/www下
        建立 /etc/vsftpd/user_config/andy 內容為
        local_root=/var/www
    例如:某一個使用者(jack)的權限只能下載,不能上傳
        建立 /etc/vsftpd/user_config/jack 內容為
        download_enable=YES
        write_enable=NO
設定何IP可不可登入 /etc/hosts.allow and /etc/hosts.deny
vsftpd:192.168.1.97 or vsftpd:192.168.1.0/255.255.255.0

在 Linux 使用 Samba + CUPS 分享印表機

在 Linux 環境中新增印表機
允許遠端連入 CUPS Web 管理介面
使用 Samba + CUPS 分享印表機給 Windows user 使用
建置虛擬 PDF Printer 分享給 Windows user 使用
範例環境:

Fecora Core 4 (kernel: 2.6.12.4)
cups-1.1.23-15.1
ghostscript-7.07-40
samba-3.0.14a-2
system-config-printer-0.6.131.3-1
新增印表機 (需求套件: system-config-printer)

執行 printconf (文字模式) 或 printconf-gui (圖形模式) 新增印表機

連接至本機 LPT 並列埠的第一台印表機為: /dev/lp0

連接至本機 USB 介面的第一台印表機為: /dev/usb/lp0

允許遠端連入 CUPS Web 管理介面 (需求套件: cups)

設定檔: /etc/cups/cups.conf


Order Deny,Allow
Deny From All
Allow From 192.168.1.0/24



AuthType Basic
AuthClass System
Order Deny,Allow
Deny From All
Allow From 192.168.1.0/24


Browsing On
BrowseProtocols cups
BrowseOrder Deny,Allow
Deny From All
BrowseAllow From @LOCAL
Listen 0.0.0.0:631

以瀏覽器登入管理: http://your.linux.ip:631

使用 samba + cups 分享印表機給 Windows user 使用 (需求套件: samba、cups)

設定檔: /etc/samba/smb.conf

[global]
workgroup = WORKGROUP
netbios name = FC4
hosts allow = 127. 192.168.1.
printcap name = /etc/printcap
load printers = yes
printing = cups
cups options = raw
security = share

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = yes
writable = no
printable = yes
use client driver = yes 要是沒有加上這個也會出現存取被拒

ps. 可執行 testparm 測試 smb.conf 是否設定正確; 若無法列印, 系統記錄出現 raw 錯誤訊息時, 將 /etc/cups/mime.* 關於 raw 的設定取消註解符號 ( # ) 即可.

Microsoft Windows 的操作:

新增網路印表機, 瀏覽 \\FC4 (smb.conf 設定的 netbios name) 會顯示剛剛使用 printconf 加入的印表機名稱

建置虛擬 PDF Printer 分享給 Windows user 使用 (需求套件: ghostscript、samba)

設定檔: /etc/cups/cups.conf

[PDF] (註1)
path = /tmp/pdf
browseable = yes
writeable = yes
guest ok = yes
force user = nobody

[pdfprinter] (註2)
path = /var/spool/samba
printable = yes
printing = bsd (註3)
guest ok = yes
print command = /usr/bin/printpdf %s
use client driver = yes
lpq command =
lprm command =

Shell Script: /usr/bin/printpdf (需自行建立)

#!/bin/sh

NAME=`date +%F-%H%M%S`
SRCDIR=/var/spool/samba
OUTDIR=/tmp/pdf
ps2pdf "$SRCDIR/$1" "$OUTDIR/$NAME.pdf" 2>/tmp/printpdf.error
rm -f "$SRCDIR/$1"

最後記得要 chmod a+x /usr/bin/printpdf

註1. 在 /tmp/pdf 分享列印出來的 PDF 檔
註2. 設定虛擬印表機名稱為: pdfprinter
註3. 不加這行的話就會用到 [global] 裡的 printing = cups 設定, 會出現 client-error-not-found 的錯誤

Microsoft Windows 的操作:

於 Windows 新增印表機: \\FC4\pdfprinter
使用任何支援 PostScript 的 Driver 即可.
例如: Canon → Canon PS-IPU Color Laser Copier v52.3
(名字裡有 PS 或 PostScript 的即代表支援 PostScript; 當然, Color 就是彩色的囉 :)

列印後可至 \\FC4\PDF 查看列印結果 ( .pdf 檔 )

VMWare 安裝

第一章: Linux (Host OS 設定 )
第一節:vmware的安裝
首先關閉samba這樣安裝的時候 vmware 可以自動設定 samba /etc/rc.d/initd/smb stop
1. 從 www.vmware.com 下截 xxxx.rpm (最新的版本)
2. su 變成 root
3. rpm -ivh xxxx.rpm (這會自動安裝 vmware)
4. vmware-config.pl (配置 vmware)
這裡很簡單,基本上全部按 Enter 就可以了. 但有一個要注意的就是網卡的選擇:
如果你是 eth0+ppp0 上網的,那麼這裡選 eth0 就好了
如果是 eth0+eth1 上網,這裡你就要確定你選擇了:
如果是用 eth0 上網的,那麼這裡選擇 eth1 給 vmware 用
如果是用 eth1 上網的,那麼這裡選擇 eth0 給 vmware 用
如果你只有 eth0 或者 ppp0 那麼 vmware 會自動做個 vmnet 的 NIC 出來
這裡你選擇的網卡,就是將來做ipchain時需要forward的那個interface
samba configuration 的時候可以加入username & passowrd for samba
5. 從root中退出 exit
6. 複製你的 License 到 .vmware 這個目錄下 cp license .vmware/
如果你沒有 .vmware 這個目錄.那麼 mkdir .vmware license這幾個字都是小寫 7. 在 Xwindow 下開啟一個 terminal 然後打入 vmware

以上內容來自 <http://www.study-area.net/goldencat/vmware/vmware.htm>

FTP Batch Scripts

幾乎所有 OS 都有內建文字模式的 FTP Client, 這種小巧的 FTP Client 配合批次指令, 可一次處理多個 FTP 命令, 配合系統排程亦可達成自動化傳輸功能. 操作方法如下:
《Windows》

Command:

ftp -n -s:scriptfile.scr

Script file contents:

open ftp.site.addr
user
guest (account)
guest (password)
put file1
quit

《Linux - ftp》

Script file contents:

#!/bin/sh

ftp -n ftp.site.addr << EOF
user guest guest (account password)
prompt
verbose
put file1
quit
EOF

《Linux - lftp》

Command:

lftp -f scriptfile.scr

Script file contents:

open ftp.site.addr
user guest guest (account password)
put file1
quit

Rate limit:

open /etc/lftp.conf, adding:
set net:limit-rate 10240 (bytes per second)

※man lftp for more information

VSFTPD 問題

service vsftpd status
vsftpd dead but subsys locked
service vsftpd restart
Shutting down vsftpd: [FAILED]
Starting vsftpd for vsftpd: [ OK ]

if your frame shows "vsftp dead but subsys lock".
Please follow this procedure....

i had the same problem ...i got it working in the following way

just remove the vsftpd lock from /var/lock/subsys/

then in /etc/rc.d/init.d/ directory stop the xinetd daemon.
./xinetd stop

now restart the vsftpd service

service vsftpd restart

and now start the xinetd daemon again...
./xinetd start

Hope this works

事實上若還是無法排除問題,可以前往/etc/vsftpd/vsftpd.conf查看是否文件內部有打錯
編輯?vsftpd.conf ,只留一行Listen=yes
vi??vsftpd.conf
Listen=yes

再重新啟動 vsftpd ,如果ok,則一行一行在慢慢放回去,降子就可以知道是那一個設定出了問題


netstat -na --ip

just remove the vsftpd lock from /var/lock/subsys/
then in /etc/rc.d/init.d/ directory stop the xinetd daemon.
./xinetd stop
now restart the vsftpd service
service vsftpd restart
and now start the xinetd daemon again...
./xinetd start

following commands fixed the problem
service vsftpd stop
rpm --verify vsftpd
service vsftpd start

小筆記

大量建帳號
adduser erica
adduser jessie
adduser jackson
adduser rduser
echo "123123"passwd --stdin erica
echo "123123"passwd --stdin jessie
echo "123123"passwd --stdin jackson
echo "123123"passwd --stdin rduser


建立連結
ln -s /home/f84297673 /root/bea/glink/SEJW/F0391-84297673
來源捷徑存放位置


刪除使用者,並將相關的檔案刪除
userdel -r abcuser


查尋網路流量(這需要另外安裝sysstat的套件)
sar -n DEV 1 999

分辨出哪個檔案是最大
alias kk='du -cms * sort -rn head -11'


設定Linux 時間 date -s "2007/7/16 09:41:00"
ntpdate time.stdtime.gov.tw 網路校時
clock -r 讀取BIOS時間
clock -w 將目前時間寫入BIOS
ntpdate time.stdtime.gov.tw ;clock -w

Vi /etc/crontab 讓server 自動去校時
10 5 * * * root /usr/sbin/ntpdate time.stdtime.gov.tw && /sbin/hwclock -w


VSFTP
use_localtime=YES (NO)
是否使用本地時間?vsftpd 預設使用 GMT 時間(格林威治),所以會比台灣晚 8 小時,建議設定為 YES 吧!


找出那個Process讓Device出現device is busy
範例 #umount /mnt出現
umount: /mnt: device is busy
找出兇手的方法
#fuser /mnt
/mnt: 2028c


以20070804為當前日期,取得當前日期
hwall_`date +%G%m%d`.txt 取得目前的日期 ex:hwall_20070804.txt
date1=`date --date='2 days ago' +%Y%m%d` 取得目前的日期,前兩天 ex:date1=20070802
date2=`date --date='1 days ago' +%Y%m%d` 取得目前的日期,前一天 ex:date1=20070803
date3=`date --date='1 month ago' +%Y%m%d` 取得目前的日期,前一個月
date4=`date --date='3 minute ago ' +%H%M` 取得目前的時,前3分鐘
ex:date3=20070704

也可以改用 +/- 比如date4=`date --date='3 minute ago ' +%H%M`
可以改成  date4=`date --date='-3 min' +%H%M`


查檔案內容
grep -r CSCW9645110200 * 尋找所在目錄下所有檔案,內容包含CSCW9645110200 的列出,注意!!不能設定副檔名



Linux 編譯網卡

[root@linux src]# tar -zxvf /root/e100-3.4.14.tar.gz
[root@linux src]# cd e100-3.4.14
[root@linux e100-3.4.14]# cd src 放在那邊並不重要,只要您找的到就好
[root@linux src]# make <<最主要的執行程序 [root@linux src]# cp e100.ko /lib/modules/`uname -r`/kernel/drivers/net [root@linux src]# cd /lib/modules/`uname -r` [root@linux 2.6.13-1.1532_FC4]# depmod -a Uname -r 取得目前OS的版本 >> 2.6.9-1.667smp
執行完最後一個步奏就重新開機,開機的過程就可以看到有找到新的硬體設備


Samba utf8 設定
一直聽說 Samba UTF-8 有問題.
但是因為資料實在太多. 要從 Big5 轉換到 UTF-8 看來是遙遙無期.
不過看到有人解決掉這個麻煩的事.. 趕快記錄下來 :p
以下轉載自: Samba也要utf8
smb.conf
[global]
dos charset = UTF8
unix charset = UTF8
display charset = UTF8
再來用smbmount也都ok了, 但中文就是一直會缺字, 我smbmount用的參數為iocharacter=utf8,codepage=cp950, 後來才發現原來codepage設錯了, cp950是big5的codepage number, 如果是utf8環境的話, 要用codepage=65001

Vim 編輯

:1,$s/word1/word2/gc
:1,$s/bea705/bea705_RD/gc
從第一行到最後一行尋找 word1 字串,並將該字串取代為 word2 !且在取代前顯示提示字元給使用者確認 (conform) 是否需要取代!
:1,$s/word1/word2/g
從第一行到最後一行尋找 word1 字串,並將該字串取代為 word2 !
:n1,n2s/word1/word2/g
n1 與 n2 為數字。在第 n1 與 n2 行之間尋找 word1 這個字串,並將該字串取代為 word2 !舉例來說,在 100 到 200 行之間搜尋 vbird 並取代為 VBIRD 則:
『:100,200s/vbird/VBIRD/g』。 摘自 鳥哥的Linux私房菜