顯示具有 Linux 標籤的文章。 顯示所有文章
顯示具有 Linux 標籤的文章。 顯示所有文章

2024年2月20日 星期二

photon os

https://github.com/vmware/photon/wiki/Downloading-Photon-OS

VMware Player 開 OVA 

啟動 docker 

systemctl start docker 啟動 Docker 服務

開機系統自動啟動 Docker 服務,systemctl enable docker


photon 安全更新

tdnf updateinfo info
tdnf upgrade --security

yum update tdnf

photon 更新
tdnf update -y
tdnf upgrade
tdnf check-update
tdnf distro-sync

2024年1月19日 星期五

Librenms Docker Windows

Version:

Windows 11p 22631.3007

Docker v4.26.1

Docker Compose version v2.23.3-desktop.2


建一個 docker 用的目錄

D:\dockerDATA\

再建一個 Librenms 專用目錄

D:\dockerDATA\Librenms\


下載官方範本 https://codeload.github.com/librenms/docker/zip/refs/heads/master

解開 docker-master\examples\compose 中的 4 個檔 (.env, compose.yml, msmtpd.env) 到 D:\dockerDATA\Librenms\


powershell>

cd D:\dockerDATA\Librenms\

docker compose -f compose.yml up -d


maridb 無法啟動出錯 

2024-01-19 15:09:11 2024-01-19 08:09:11+01:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

2024-01-19 15:09:11     command was: mysqld --innodb-file-per-table=1 --lower_case_table-names=0 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --verbose --help

2024-01-19 15:09:11     2024-01-19  8:09:11 0 [ERROR] The server option 'lower_case_table_names' is configured to use case sensitive table names but the data directory resides on a case-insensitive file system. Please use a case sensitive file system for your data directory or switch to a case-insensitive table name mode.


powershell>

docker compose down

cd D:\dockerDATA\Librenms\

fsutil.exe file queryCaseSensitiveInfo ./db

目錄區分大小寫屬性停用

fsutil.exe file setCaseSensitiveInfo ./db enable

目錄區分大小寫屬性啟用


參考來源:

https://github.com/librenms/docker

https://learn.microsoft.com/zh-tw/windows/wsl/case-sensitivity

2022年9月30日 星期五

Docker for Windows, 建立一個容器 MySQL 備份和還原

安裝 Docker for Windows

條件 Windows 10 Build 10586 以上,需啟用 Hyper-V 和容器功能

重開機

更新 powershell > wsl --set-default-version 2

重開機
參考:https://learn.microsoft.com/zh-tw/windows/wsl/install

安裝 Docker


https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-win-amd64

再重開機

參考:https://skychang.github.io/2017/01/06/Docker-Docker_for_Windows_10_First/


下載容器 img 並直接建立容器 mysqlc 和啟動

docker run --name mysqlc -p 3306:3308 -e MYSQL_ROOT_PASSWORD=Dev123 -d mysql


進 mysql 進一個 db 測試還原時 db 是否還在
mysql -u root -p
create database DevDb; -- 創建資料庫
show databases; -- 顯示資料庫

mysql 操作參考:https://ithelp.ithome.com.tw/articles/10272193

備份容器(包含容器資料)
看容器 ID
docker ps

將目前的容器做成 img
docker commit -p 2f839180729f mysqlc

再把 img save
docker save -o bk.tar mysqlc

還原 img load
docker load -i bk.tar

啟動容器
docker run --name mysqlc -p 3306:3308 -e MYSQL_ROOT_PASSWORD=Dev123 -d mysqlc


2022年2月17日 星期四

AWS 調整磁碟區大小後 擴展 Linux disk

檢查 確認是 ext4

df -hT 

lsblk

選 /dev/nvme0n1 磁碟的第 1 個 part

sudo growpart /dev/nvme0n1 1


參考:https://docs.aws.amazon.com/zh_tw/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

2021年7月20日 星期二

AWS EBS Linux LVM restore mount

 #看開機自動 mount 的 disk

cat /etc/fstab


#看目前主機的實體 disk

lsblk

ls /etc/nvme*

ls /etc/sd*


#看已 mount 的 disk

df -h


#看沒有 mount 的 lv

fdisk -l


#mount

mkdir /tmp/bktest

mount /dev/mapper/BKVG-bklv /tmp/bktest



PS:#查目前有沒有什麼程序在執行 ps -ef | grep ora

2021年3月8日 星期一

檔案加密

在電腦上的硬碟或某一個資料要加密(Google Drive 也可以)

Ubuntu 裝 EncFS

sudo apt-get install encfs






參考來源:

https://hant.kaifa99.com/Windows/article_11163

https://linuxconfig.org/user-data-encryption-with-fuse-based-encfs-filesystem


Window、MacOS(OS X)用的 GUI

https://encfsmp.sourceforge.io/download.html


參考來源:https://dailydoseoftech.com/how-to-use-encfs-encryption-on-windows-10/

2019年11月8日 星期五

SUSE

SUSE 可以用 tracepath 取代 tracert,traceroute

2019年2月26日 星期二

SUSE Linux Enterprise Server 15 (SLES 15)

檢查 OS 版本
#cat /etc/os-release

更新
#zypper update

查 PHP 版本
#php -v

安裝 PHP 5
must add php repository to server. For example add php5.6 repository to SLES12SP3 you must add below command:

#zypper addrepo http://download.opensuse.org/repositories/devel:/languages:/php:/php56/SLE_12_SP3/devel:languages:php:php56.repo

查目前工作
#ps -aux

登入 MySQL
#mysql -u root -p

MySQL 指令 查版本
>SHOW VARIABLES LIKE "%version%";

建立 DB (utf8_general_ci)
>CREATE DATABASE mydatabase CHARACTER SET utf8 COLLATE utf8_general_ci;

LAMP 安裝參考:https://en.opensuse.org/SDB:LAMP_setup

2018年10月4日 星期四

Linux Performance Commands

for virtual memory and CPU
vmstat for IO and CPU utilization
iostat for network
netstat
參考來源:
1.https://blogs.oracle.com/openomics/system-performance-issues-check-the-io
2.https://geekflare.com/linux-performance-commands/

disk io test

磁碟測速工具 hdparm 讀取測試

#sudo hdparm -tT /dev/sda1

dd 寫入測試 (用 dd 指令寫檔到 /tmp 目錄測試)

#dd if=/dev/zero of=/tmp/bench bs=1M count=1024 && rm /tmp/bench

參考來源:https://blog.toright.com/posts/5051/linux-disk-io-%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6.html

2017年4月12日 星期三

RHEL-7.3 on AWS

Windows Putty 登入 RHEL-7.3 on AWS
https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/putty.html?icmpid=docs_ec2_console

切換 root
#sudo su -

安裝 KDE 

# yum groupinstall 'KDE'

參考:https://linuxconfig.org/installation-of-kde-desktop-manager-on-rhel-7-linux-server

安裝 XRDP

Step 1. Install EPEL and nux Desktop repository rpms by automatic. (recommended)
# yum localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

Step 2. The following command to install xrdp, and you will get the following output, make sure you are getting package from the newly created repository.
# yum -y install xrdp tigervnc-server

Step 3. Once it is installed, lets start the xrdp service.
# systemctl start xrdp.service

Step 4. The xrdp will listen on 3389, lets confirm this by issuing following command.
# netstat -antup | grep xrdp

Step 5. By default, services wont auto start after system reboot, issue the following command to enable the service at system start up.
# systemctl enable xrdp.service

Step 6. Next is to create iptables rule to allow rdp connection from the external machines, following command will add the exception for xrdp port (3389).(如果步驟 6 沒成功,先重開機再試)
# firewall-cmd --permanent --zone=public --add-port=3389/tcp
# firewall-cmd --reload

參考:http://blog.sina.com.tw/william_liao/article.php?entryid=661556

安裝  Chrome (root 登入 KDE)

安裝完成之後,你會發現在應用程序裡雙擊chrome沒有任何的反應,打開目錄 /usr/share/applications 右擊 Google Chrome 圖標點屬性,在命令這一行的最後輸入: --no-sandbox


Redhat 文件參考:https://access.redhat.com/documentation/zh_tw/red-hat-enterprise-linux/?version=pdf/

2015年10月28日 星期三

Zimbra

環境:
ISO 檔 -> CentOS-7-x86_64-Minimal-1503-01.iso
VM -> CPU:1CORE,RAM:4G,HD:200G,網卡:VMXNET 3

OS版本 -> CentOS Linux release 7.1.1503 (Core)
cat /etc/centos-release

打開啟用網路、設定IP(192.168.10.99)、hostname(zmail.gg168.com)
nmtui

安裝 perl
 yum install perl

安裝 VMwareTools mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cp /mnt/cdrom/VMwareTools-9.10.0-2476743.tar.gz /tmp/
cd /tmp
tar -zxvpf VMwareTools-9.10.0-2476743.tar.gz
 cd vmware-tools-distrib/
./vmware-install.pl

刪除 VMwareTools 安裝檔、壓縮檔
 rm -rf vmware-tools-distrib VMwareTools-9.10.0-2476743.tar.gz

reboot 鳥哥最常用來重新開機的指令(或關機),可以配合寫入緩衝資料的 sync 指令動作
sync; sync; sync; reboot

檢查是否有執行
 /etc/init.d/vmware-tools status

yum install sudo sysstat libidn gmp libtool-ltdl compat-glib vixie-cron perl libstdc++.i686 nc unzip perl-core wget nmap sqlite -y

安裝 ifconfig
yum provides ifconfig
yum whatprovides ifconfig
yum install net-tools
# #安裝 traceroute
yum install  traceroute

vi /etc/hosts
只留這一行>>192.168.10.99 zmail.gg168.com zmail

chkconfig postfix off
service postfix stop
chkconfig sendmail off
service sendmail stop
vi /etc/sudoers
chkconfig iptables off
service iptables stop
chkconfig ip6tables off
service ip6tables stop

vi /etc/sysconfig/selinux
>>SELINUX=disabled

關防火牆 http://note.tc.edu.tw/932.html
service firewalld stop

下載安裝 zimbra
cd /tmp
wget https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
tar -zxvpf  zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
./install.sh

安裝完成後選項
6-4) Admin Password                           UNSET>>Password for admin@zimbra.168gg.com (min 6 characters): [SBmeBXtA] password
1-6) TimeZone:                                Asia/Taipei >> 57

檢視狀態
zimbra@zimbra:/~$ zmcontrol status

檢視憑證
/opt/zimbra/bin/zmcertmgr  viewdeployedcrt all |grep notAfter

安裝參考網址:
http://www.unixmen.com/install-zimbra-collaboration-suite-8-6-0-centos-7/
http://blog.revivalx.com/2015/03/10/how-to-install-zimbra-collaboration-suite-8-6-0-on-centos-7/
https://itservices.stanford.edu/service/emailcalendar/desktop/outlook/gal

2015年3月4日 星期三

Simple Invoices(CentOS 7)

環境參考本站的 CENTOS 7.0.1406 64bit LAMP

安裝參考:http://www.simpleinvoices.org/install

1.先切換到 www 目錄
#cd /var/html/www/

2.下載 Simple Invoices (版本超久沒更新)
#wget http://download.simpleinvoices.org/simpleinvoices/downloads/simpleinvoices.2011.1.zip

3.解壓縮;刪除壓縮檔
#unzip simpleinvoices.2011.1.zip;rm -rf simpleinvoices.2011.1.zip

4.修改 config.ini 
#vi simpleinvoices/config/config.ini


5.修改可寫入權限(Simple Invoices 會寫 Log、備份 DB…等)
chmod -Rv 777 tmp*

PS:若有權限上的問題應該是 SELinux 的問題,關掉是比較省麻煩,但較不安全,關掉方式可參考 http://blog.zwiegnet.com/linux-server/disable-selinux-centos-7/;要安全一點就設定 SELinux

6.輸 http://您的網址或IP/simpleinvoices 即可以進入 Web 安裝畫面


2015年3月3日 星期二

CENTOS 7.0.1406 64bit LAMP

OS:CentOS-7.0-1406-x86_64-Minimal.iso

#yum -y install rp-pppoe.x86_64

停止、關閉開機執行 NetworkManager
#systemctl stop NetworkManager.service
#systemctl disable NetworkManager.service

查看網卡名稱,我的叫 ens33
#ifconfig

設定 PPPOE
#pppoe-setup

重啟網路就會自動撥了
#/etc/init.d/network restart

以上 PPPOE 安裝參考:http://blog.kevinlinul.idv.tw/?p=174

安裝 MariaDB
#yum -y install mariadb-server mariadb

啟用、開啟開機執行 MariaDB
#systemctl start mariadb.service
#systemctl enable mariadb.service 

設定 MariaDB
#mysql_secure_installation

安裝 Apache
#yum -y install httpd

啟用、開啟開機執行 Apache
#systemctl start httpd.service
#systemctl enable httpd.service

開啟防火牆 80、443 ports
#firewall-cmd --permanent --zone=public --add-service=http
#firewall-cmd --permanent --zone=public --add-service=https
#firewall-cmd --reload

安裝 PHP 與 DB 相關套件
#yum -y install php
#yum -y install php-mysql
#yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

重啟 Apache 讓套件生效
#systemctl restart httpd.service

檢視套件是否有成功安裝
#vi /var/www/html/info.php


安裝 下載套件、解壓縮套件
#yum install wget unzip

下載 phpmyadmin 4.3.11
#wget -O phpmyadmin.zip http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.3.11/phpMyAdmin-4.3.11-all-languages.zip?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Findex.php&ts=1425398362&use_mirror=nchc

解壓縮;更改目錄名稱;移除壓縮檔
#unzip phpmyadmin.zip; mv phpMyAdmin-4.3.11-all-languages/ phpdbadmin; rm -rf phpmyadmin.zip

到 phpdbadmin 目錄
#cd /var/www/html/phpdbadmin

複製 config.sample.inc.php 成 config.inc.php
#cp config.sample.inc.php config.inc.php

blowfish 加密
#vi config.inc.php
原 $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
改 $cfg['blowfish_secret'] = '隨便打'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

以上 LAM (MariaDB) P 安裝參考:http://ithelp.ithome.com.tw/question/10158428



其它參考如下

MariaDB
http://shaurong.blogspot.tw/2014/07/centos-7-mysql-mariadb.html

MySQL 安裝參考:
http://sharadchhetri.com/2014/07/31/how-to-install-mysql-server-5-6-on-centos-7-rhel-7/

2013年11月27日 星期三

du 計算檔案、資料夾大小

查詢掛載點下前 5 名佔用最多空間的資料夾 (單位為 KB)
#du -s /var/* | sort -rn | head -5

參考來源:http://www.weithenn.org/cgi-bin/wiki.pl?du-%E8%A8%88%E7%AE%97%E6%AA%94%E6%A1%88%E3%80%81%E8%B3%87%E6%96%99%E5%A4%BE%E5%A4%A7%E5%B0%8F

2013年10月7日 星期一

LINUX、AIX sh while script

LINUX
# watch -d -n 1 ‘netstat –ant'
-n 表示每一秒更新一次輸出。
-d 表示將有變更的部份以高亮標示(Highlight)

AIX
root@aix # vi watch.sh 

#!/bin/ksh
# $1 = 監控的間隔時間,以秒為單位.
# $2 = 請將所有要輸入的指令以雙引號(")或單引號(')包起來.
# Exit the watch.sh use Ctrl + C 
#

while true
do
  clear
  echo "Interval $1 sec, Command: $2"
  eval $2
  sleep $1
done

root@aix # chome +x watch.sh

#以下比方說要執行監控,每秒更新一次.
root@aix # ls -l /home/user | grep .profile
root@aix # ./watch.sh 1 "ls -l /home/user | egrep '.profile'"

參考來源:
http://xxooxp.blogspot.tw/2011/09/aixlinux-watch.html

2013年10月1日 星期二

nmon 監控系統(CPU,RAM,HD,LAN...)

32位元測試環境為 CentOS release 6.2 (Final)

# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
# yum install nmon
# nmon


參考網址如下:

Jamyy's Weblog-nmon - 整合多樣系統資訊的文字介面工具
http://jamyy.dyndns.org/blog/2012/08/3966.html

IT水電工-哆啦胖虎-在CLI上透過NMON監控整合系統資訊
http://iori.tw/%E5%9C%A8cli%E4%B8%8A%E9%80%8F%E9%81%8Enmon%E7%9B%A3%E6%8E%A7%E6%95%B4%E5%90%88%E7%B3%BB%E7%B5%B1%E8%B3%87%E8%A8%8A/

2012年3月30日 星期五

Procmail 收信備份

一、使用 Procmail 收信備份


1.建立備份目錄
mkdir /var/mailbk/
chmod 1777 /var/mailbk/


2.設定將信件存到 mailbk
vi /etc/procmailrc

在最後行加入下面文字
TODAY=`date +%Y%m%d`
:0 c:
/var/mailbak/$TODAY.$LOGNAME

3.觀看備份 Mail
mutt -f /var/mailbk/20110203.chair


4.若沒有成功,檢查一下 /etc/postfix/main.cf
mailbox_command = /usr/bin/procmail -a "$EXTENSION"
5.把前一天的 Mail 自動壓縮,在 /usr/local/bin/ 新增檔案 bk-yesterday-mail 內容為:
#!/bin/sh
#取得前一天日期
today=`date +%Y%m%d`
yesterday=`expr $today - 1`
yesterday=$(date --date='1 days ago' +%Y%m%d)
#切換目錄
cd /var/mailbk/

#把前一天的備份壓縮
tar jcf mailbk.$yesterday.tar.bz2 $yesterday.*
#刪除備份
rm -f $yesterday.*
#檢查是否有壓縮成功
test ! -e "mailbak.$yesterday.tar.bz2" && exit 0
6.還原
cd /var/mailbk/
tar jxf mailbk.20110203.tar.bz2
cat 20110203.chair >>/var/spool/mail/chair

PS:Procmail 過濾 Mail 方式如下
參考來源:http://imomo.tw/phpbb/viewtopic.php?p=733&sid=3152da68716335ba7fdb75dc804def1f

#把收件者中有關於 ggyy 的文字都轉到廣告匣,但寄件人必須非 @domain.com 的網域才成立
:0H
* ^To:.*ggyy*
{
  :0H
  * !From:.*@domain.com*
  $HOME/mail/spam-mail
}


2012年3月28日 星期三

Centos 6.2 DNS Server

Centos 6.2 DNS Server (Bind)

先檢查是否已安裝
[root@www ~]# rpm -qa | grep '^bind'
bind-libs-9.7.0-5.P2.el6_0.1.x86_64   <==給 bind 與相關指令使用的函式庫
bind-utils-9.7.0-5.P2.el6_0.1.x86_64  <==這個是用戶端搜尋主機名稱的相關指令
bind-9.7.0-5.P2.el6_0.1.x86_64        <==就是 bind 主程式所需軟體
bind-chroot-9.7.0-5.P2.el6_0.1.x86_64 <==將 bind 主程式關在家裡面!

查詢是否安裝快取伺服器
rpm -q caching-nameserver
 (CentOS 4.x, 5.x 所提供的 caching-nameserver 軟體並不存在 CentOS 6.x 當中了喔!已經被涵蓋於 bind 軟體內!)

啟動服務
/etc/rc.d/init.d/named restart

設定開機自動執行
chkconfig named on

把防火牆關閉(若沒安裝可用 yum install system-config-firewall-tui)
system-config-firewall-tui

若允許防火牆,需改(建議先閉防火牆來測試,設定完後,再來開)
vi /etc/rc.d/rc.local

/sbin/iptables -I INPUT -p tcp --dport 53 -j ACCEPT
/sbin/iptables -I INPUT -p ucp --dport 53 -j ACCEPT
/sbin/iptables -I OUTPUT -p tcp --sport 53 -j ACCEPT
/sbin/iptables -I OUTPUT -p ucp --sport 53 -j ACCEPT

檢查是否有安裝成功(鳥哥教用 dig 測,可以去試看看)
host localhost 127.0.0.1
host localhost 61.63.33.172<-DNS 對外的 IP

備份設定檔
cp /etc/named.conf /etc/named.conf.bk

編輯主要設定檔: /etc/named.conf
vi /etc/named.conf

修改

# 減輕 bind 負載,並將未管轄網域轉到其他機器。
forwarders {
12         8.8.4.4; 8.8.8.8; 168.95.192.1;

13     };

#listen-on port 53 { 127.0.0.1; };
#listen-on-v6 port 53 { ::1; };
#allow-query     { localhost; };認證網域。

# 停用全域轉送 (Master 與 Slave 間的傳送)。
     allow-transfer { none; };
};


順便看一下是 named.conf 中是否有另外 include 檔案
我的是有 include "/etc/named.rfc1912.zones" 所以來看一下這內容寫什麼(應是 zone 內容設定)
vi /etc/named.rfc1912.zones

自行增加(黃色的部份) zone 內容

#正解
zone "domain.com" IN {
        type master;
        file "zone.domain.com";
        allow-update { none; };
};

zone "localhost.localdomain" IN {
        type master;
....
...
..
.
#反解

zone "10.168.192.in-addr.arpa" IN {
        type master;
        file "192.168.10";
};

在 /var/named/ 增加兩個檔案(橘色的部份是檔名)

1.增加 正解 的 zone

vi /var/named/zone.domain.com

內容為(綠色 E-MAIL 的意思是 chair@doamin.com)

$TTL    86400

@       IN      SOA     dns1.domain.com.    chair.domain.com. (

                                      2012032701 ; Serial: 區域版本編號[註1]

                                      3H         ; Refresh: 同步更新時間

                                      15M        ; Retry: 重試同步時間
                                      1W         ; Expire: 同步到期時間
                                      1D )       ; Negative Cache TTL Minimum: 最小快取存活時間
;# [註1] 其長度為 2^32 - 1,一般慣用年月日加兩碼亂數做辨別 (例如 2012082001),有跑 Slave 時請多加注意,若數字過長、超過上限則會以餘數計算

@        IN      NS      dns1.domain.com.
dns1    IN      A       61.63.33.172

www    IN      A       61.63.33.172
google33d19a20402ba06d IN CNAME google.com. ;申請 Google Apps 驗証網域擁有權用

chair   IN      MX      1       ASPMX.L.GOOGLE.COM.
chair   IN      MX      5       ALT1.ASPMX.L.GOOGLE.COM.
chair   IN      MX      5       ALT2.ASPMX.L.GOOGLE.COM.
chair   IN      MX      10      ASPMX2.GOOGLEMAIL.COM.
chair   IN      MX      10      ASPMX3.GOOGLEMAIL.COM.

2.增加 反解 的 zone
vi /var/named/192.168.10
內容為(綠色 E-MAIL 的意思是 chair@doamin.com)
$TTL    86400
@       IN      SOA     dns1.domain.com.    chair.chair.cgi.tw. (
                                      2012032701 ; Serial: 區域版本編號
                                      3H         ; Refresh: 同步更新時間
                                      15M        ; Retry: 重試同步時間
                                      1W         ; Expire: 同步到期時間
                                      1D )       ; Minimum: 最小快取存活時間

@       IN      NS      dns1.domain.com.
99      IN      PTR     dns1.domain.com.

(藍色這個 99 是指這台 dns1.domain.com 的內部 IP 192.168.10.99)

查看 log
tail -n 30 /var/log/messages | grep named
cat /var/log/messages | grep named


若有在 log 中有發現 couldn't add command channel 127.0.0.1#953: not found 錯誤訊息
表示 DNS 的 rndc key 沒有設定好!
先建立一把 rndc key ,然後加到 named.conf 中(請參考鳥哥 dns server settings )

部份內容參考:
http://linux.vbird.org/linux_server/0350dns.php
http://blog.pmail.idv.tw/?p=298
http://note.drx.tw/2008/08/serverdns-server-static-adsl.html


PS:
ESX 5 用 E1000 網卡,設定自動取得 IP 失敗
手動使用 DHCP 自動取得 IP 參數: dhclient
dhclient eth0

2012年1月19日 星期四

MailScanner 內容 附件 誤判

MailScanner 內容 附件 誤判 訊息如下

This is a message from the MailScanner E-Mail Virus Protection Service
----------------------------------------------------------------------
The original e-mail attachment "msg-21652-15.txt"
is on the list of unacceptable attachments for this site and has been
replaced by this warning message.

If you wish to receive a copy of the original attachment, please
e-mail helpdesk and include the whole of this message
in your request. Alternatively, you can call them, with
the contents of this message to hand when you call.

At Thu Jan 19 13:38:06 2012 the virus scanner said:
   MailScanner: No programs allowed (msg-21652-15.txt)

Note to Help Desk: Look on the grobest_com () MailScanner in /var/spool/MailScanner/quarantine/20120119 (message 8C708938101.22526).
--
Postmaster
testdomain.com
www.testdomain.com


vi /etc/MailScanner/filetype.rules.conf

出現"No programs allowed"的字樣,一共有2行

deny 前面加上 # 註解掉

#deny executable No executables No programs allowed
#deny ELF No executables No programs allowed

存檔離開

service MailScanner restart


重新啟動MailScanner之後
就可以正常收發信了

這行的意思是說,如果是執行檔的內容,就不給寄信
明明就是純文字的內容,因為文章的內容裡有歐洲字「Ü」
而且還出現了很多次,我在想是不是因為這樣的關係被判成執行檔的機械碼!


參考來源:MailScanner 內容誤判