2015年2月8日 星期日

CentOS Mail 安裝紀錄

最近幫客戶處理一個很煩麻的事,因為現在的廠商只會推事情,不會處理事情,一切問題只會推給客戶,證明自己沒有錯,一切的錯都是別人,所以只好處理了。

(1) Sendmail 安裝

目前CentOS 6.4在安裝過程預設可以安裝Sendmail,所以要安裝sendmail.cf這個檔案

如果沒有 /usr/share/sendmail-cf/cf 這個目錄,代表沒有安裝sendmail-cf,使用yum線上更新方式進行安裝。
[root@smtp~]# yum install sendmail-cf
[root@smtp~]# yum install cyrus-sasl-md5 cyrus-sasl-plain cyrus-sasl
[root@smtp~]# vi /etc/mail/sendmail.mc

52行 dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
53 行 dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
#刪掉上面兩行前面的 dnl
#注意:TRUST_AUTH_METH、define 前面不要留有空格

116行 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
#前面加上 dnl, 把這行註解起來(dnl = do not load)
#或改成下面這樣也可以
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
 
[root@smtp~]# cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bak

 將 sendmail-cf 的資料轉成實際可使用的設定檔:
[root@smtp~]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[root@smtp~]# vi /etc/mail/access


Connect:snjh.tc.edu.tw RELAY
Connect:192.168.0 RELAY

[root@smtp~]# makemap hash /etc/mail/access < /etc/mail/access
加入想收取的網域名稱如
[root@smtp~]# vi /etc/mail/local-host-names
==================================================
xxx.edu.tw
mail.xxx.edu.tw

==================================================[root@smtp~]# /etc/rc.d/init.d/saslauthd start service saslauthd restart
[root@smtp~]# /etc/rc.d/init.d/sendmail start  service sendmail restart
[root@smtp~]# chkconfig saslauthd on
[root@smtp~]# chkconfig sendmail on

驗證SASL是否有誤
使用telnet方式檢查,出現AUTH  LOGIN PLAIN代表驗證成功

[root@smtp~]# telnet  localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Tue, 20 Sep 2011 19:22:52 -0400
ehlo localhost
250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN     //Sendmail有驗證功能
250-DELIVERBY
250 HELP

2015年1月11日 星期日

Windows XP 播放DVD有影無聲

最近客戶反應他的電腦播DVD沒有聲音,但是其他的都有聲音,剛開始想到以前的光碟機是要接一條音效線到電腦主機板才會有聲音,但是現在的技術已經是不需要了,所以就想找一下其他問題,後來發現是少裝了「影音解碼器」軟體,真是XD



Vista Codec Package 是由「Shark007」 這個網站所出產的萬用影音解碼包,也是一套適用於 Windows XP 和 Windows Vista 的影音解碼器!如果你目前看影片有聲無影,或者是有影無聲,那麼安裝這解碼器是必須的。


Step 1.
如果你是 Windows Vista 或是 XP 用戶,請下載這個解碼器,下載完成後,點兩下滑鼠左鍵執行安裝程式。而安裝過程是繁體中文的介面,所以就不再描述囉!

Stpe 2.
而在安裝後,若要使用windows media player播放所有的影音,則需進行一下設定,按下【開始】→【所有程式】→【Win7codecs】→【Settings Application】,並點選【Help】,再按下【WMP FileType Associations】即可。
相關技術來源:海芋小站Skark007

2014年12月22日 星期一

EXSI 5.5 轉移Linux 網卡啟動失敗 Device eth0 does not seem to be present, delaying initialization

 因為原先的EXSI 5.5的伺服器硬體掛點了,所以又複製一台 Linux 虛擬主機,結果開機後發現網路卡未啟動,執行 ifup eth0 出現下列訊息。

# ifup eth0
Device eth0 does not seem to be present, delaying initialization.
 經查詢發現因為"再製"出來的虛擬機會變更新的 MAC Address,所以造成 Linux 判斷成另一張網卡

下列兩種方法任選一種就可以解決。

方法一:
 (1) 我們可以先用下列指令查看系統目前抓到哪幾張網卡
 # cat /proc/net/dev
 Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:       0        0    0    0    0     0          0         0        0        0    0    0    0     0       0          0
  eth1:     0        0    0    0    0     0          0         0        0        0    0    0    0     0       0          0
 這裡可以發現網卡代號已經變成 eth1

 (2) 編輯 /etc/udev/rules.d/70-persistent-net.rules
 # vi /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:64:f9:37", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:64:f9:39", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

 可以將 eth1 修改為 eth0,重新開機。


 3) 編輯 /etc/sysconfig/network-scripts/ifcfg-eth0
 # vi /etc/sysconfig/network-scripts/ifcfg-eth0
 將"HWADDR="參數修改成正確的 MAC Address,或刪除此參數,若沒有這個參數應該在上一個步驟重新開機後會自動啟動網卡。

 4) 修改完成後,就可以順利啟動網卡。
 # ifup eth0


方法二:
 (1) 我們可以先用下列指令查看系統目前抓到哪幾張網卡
 # cat /proc/net/dev
 Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 這裡可以發現網卡代號已經變成 eth1

 (2) 編輯 /etc/sysconfig/network-scripts/ifcfg-eth0
 # vi /etc/sysconfig/network-scripts/ifcfg-eth0
 DEVICE=eth0 -> 修改為 DEVICE=eth1
 HWADDR= -> 刪除或修改成正確的 MAC Address

 3) 因為裝置名稱已變更,所以 ifcfg-eth0 也要跟著更名
 # mv ifcfg-eth0 ifcfg-eth1

 4) 修改完成後,就可以順利啟動網卡。
 # ifup eth1

資料來源 Gavin's Linux學習手札

2014年8月12日 星期二

FreeBSD VMware Tools 原廠手冊安裝版


For FreeBSD virtual machines, you manually install or upgrade VMware Tools by using the command line.

Install the latest version of VMware Tools to enhance the performance of the virtual machine's guest operating system and improve virtual machine management. When you power on a virtual machine, if a new version of VMware Tools is available, you see a notification in the status bar of the guest operating system.

Power on the virtual machine.
Verify that the guest operating system is running.
Because the VMware Tools installer is written in Perl, verify that Perl is installed in the guest operating system.
For vSphere virtual machines, to determine whether you have the latest version of VMware Tools, in the vSphere Client inventory, select the virtual machine and click the Summary tab.

1

Select the menu command to mount the VMware Tools virtual disc on the guest operating system.

VMware Product
Menu Command
vSphere Client
Inventory > Virtual Machine > Guest > Install/Upgrade VMware Tools
vSphere Web Client
All Actions icon > Configuration > Install/Upgrade VMware Tools
Fusion
Virtual Machine > Install (or Upgrade) VMware Tools
Workstation
VM > Manage > Install (or Upgrade) VMware Tools
Player
Virtual Machine > Install (or Upgrade) VMware Tools
2

In the virtual machine, log in to the guest operating system as root and open a terminal window.
3

If the distribution does not automatically mount CD-ROMs, mount the VMware Tools virtual CD-ROM image.
For example, type mount /cdrom.
4

Change to a working directory (for example, /tmp).
cd /tmp
5

Untar the VMware Tools tar file.
tar zxpf /cdrom/vmware-freebsd-tools.tar.gz
6

If the distribution does not use automounting, unmount the VMware Tools virtual CD-ROM image.
umount /cdrom
7

Run the installer and configure VMware Tools.
cd vmware-tools-distrib
./vmware-install.pl
Usually, the vmware-config-tools.pl configuration file runs after the installer file finishes running.
8

Respond to the prompts by pressing Enter to accept the default values, if appropriate for your configuration.
9

Follow the instructions at the end of the script.
Depending on the features you use, these instructions can include restarting the X session, restarting networking, logging in again, and starting the VMware User process. You can alternatively reboot the guest operating system to accomplish all these tasks.

If you are using vCenter Server, the VMware Tools label on the Summary tab changes to OK.

資料來源 vSphere 

FreeBSD ZFS修正

由於伺服器的記憶體大於8GB,所以系統會一直出現下面的訊息
ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present;gdns2 kernel: to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf.

要求在/boot/loader.conf檔案裡新增一行
vfs.zfs.prefetch_disable=0
重新開機就可以了。

Extreme Core Switch Command

(1) enable ipforwarding 功能

(功能說明)允許VLAN是否可以forwarding到別的VLAN,如果不啟用就只能在自己的VLAN下使用,無法跟別的VLAN互通。

(使用說明)
# enable ipforwarding --> 全部的VLAN啟用 ipforwarding 功能
#enable ipforwarding vlan "vlan_name" --> 啟用單一個VLAN ipforwarding 功能
=====================================================================
(2) configure iproute 功能

(功能說明)增加/刪除某一個IP網段的路由到另一個網段的功能或設定default route。

(使用說明)
# configure iproute add 10.1.1.0/24  123.45.67.1    --> 增加某一個IP網段的路由功能
# configure iproute delete 10.1.1.0/24  123.45.67.1 --> 刪除某一個IP網段的路由功能
# configure iproute add default 10.1.1.0 --> 設定預設路由(default route)功能
=====================================================================
(3) configure bootprelay 功能

(功能說明)設定DHCP Relay功能。

(使用說明)
# configure bootprelay add 10.1.1.1   --> 設定 DHCP Server IP
# enable bootprelay all --> 設定全部的VLAN都可以使用 DHCP Relay
# enable bootprelay vlan "vlan_name" --> 設定某一個 VLAN 可以使用 DHCP Relay
=====================================================================


變更Outlook 2010 [附件] 資料夾設定為不同的位置

  1. 按一下 [開始],然後按一下 [執行]。
  2. 在 [開啟] 方塊中,輸入regedit,然後按一下[確定]
  3. 找出下列登錄機碼:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
  4. 在右邊視窗按兩下 [Personal]-->修改。
  5. 將值變更為您想要的路徑。例如:
    預設是 %USERPROFILE%\Documents 的附件,會將位置設至我的附件資料夾。
    改為E:\。
  6. 按一下 [登錄] 功能表的 [結束]。
  7. 重新啟動 Outlook。
當您開啟新的電子郵件附加檔案時,[插入檔案] 對話方塊會開啟您指定的資料夾。

資訊來源:微軟技術網站