#aptitude install sudo
#change /etc/sudoes
www-data ALL=NOPASSWD: /usr/sbin/chpasswd
Reading
Wednesday, April 2, 2014
Monday, March 31, 2014
ERROR: Wrong 'suhosin.session.encrypt' option value and it wasn't possible to set it to required value ()
how to troubleshooting config roundcubemail v.0.9
Edit file php.ini and add this line bottom file
#vim /etc/php5/apache2/php.ini
For Err: date.timezone: NOT OK(not set)
----------------------Edit-----------------------------
date.timezone = "Asia/Bangkok"
---------------Adding Bottom line--------
suhosin.session.encrypt = 0
For Err: Intl: NOT AVAILABLE (See http://www.php.net/manual/en/book.intl.php)
Just install intl package
#aptitude install php5-intl
#/etc/init.d/apache2 restart
Edit file php.ini and add this line bottom file
#vim /etc/php5/apache2/php.ini
For Err: date.timezone: NOT OK(not set)
----------------------Edit-----------------------------
date.timezone = "Asia/Bangkok"
---------------Adding Bottom line--------
suhosin.session.encrypt = 0
For Err: Intl: NOT AVAILABLE (See http://www.php.net/manual/en/book.intl.php)
Just install intl package
#aptitude install php5-intl
#/etc/init.d/apache2 restart
Wednesday, March 26, 2014
unknown option '$TTL' and unexpected token near end of file
วิธีแก้ไข Err. bind(DNS) ใน Debain
- unknown option '$TTL'
- unexpected token near end of file
คำสั่งตรวจสอบค่าคอนฟิก ที่ Zone file ที่มีปัญหา
1. named-checkconf db.domain.co.th
-----------------------------------
#db.domain.co.th:1: unknown option '$TTL'
#db.domain.co.th:47: unexpected token near end of file
//---------------------------------------
2. named-checkzone domain.co.th /var/named/db.domain.co.th
--------------------------------------
zone domain.co.th/IN: NS 'hostxxx.domain.co.th' has no address records (A or AAAA)
zone domain.co.th/IN: not loaded due to errors.
//--------------------------------------
How to fix BIND does not permit underscores "_" unless you specificy the whole domain name
};
คำสั่งปฏิบัติการ
1. rndc flush
2. rndc reload
3. เข้าไปแก้ไข Serail Number ที่ Zone File นั้นก่อน restart service DNS
4. /etc/init.d/bind9 reload (Restart service DNS)
ตัวอย่าง การแก้ไข
root@sip40:/etc/bind# rndc flush
root@sip40:/etc/bind# rndc reload
server reload successful
root@sip40:/etc/bind# named-checkzone domain.co.th db.domain.co.th
zone domain.co.th/IN: NS 'hqbackup01.domain.co.th' has no address records (A or AAAA) ** แสดงโดเมนที่ไม่สามารถโหลดได้ เราต้องเข้าไปแก้ไขตรวจสอบดูว่า ยังใช้งานอยู่ไหม
zone domain.co.th/IN: not loaded due to errors.
root@sip40:/etc/bind# vim db.domain.co.th ** เข้าไปแก้ไข และปรับค่า Serial ใหม่
root@sip40:/etc/bind# /etc/init.d/bind9 reload
Reloading domain name service...: bind9.
root@sip40:/etc/bind# named-checkzone domain.co.th db.domain.co.th
zone domain.co.th/IN: loaded serial 2014032701
OK
//--------------------------------------------------------------
แล้วกลับไปตรวจสอบอีกครั้ง
1. named-checkconf db.domain.co.th
-----------------------------------
#db.domain.co.th:1: unknown option '$TTL'
#db.domain.co.th:47: unexpected token near end of file
//---------------------------------------
**** ยังเจอ err. อยู่เหมือนเดิม แต่เมื่อลองไป nslookup จากเครื่องอื่น กลับสามารถ solve domain ได้ ถือว่า ok
2. named-checkzone domain.co.th db.domain.co.th
-----------------------------------
zone domain.co.th/IN: loaded serial 2014032701
OK
//--------------------------------
*** ใช้งานได้แล้ว
Reference:
rndc flush & rndc reload
Command Check DNS
- unknown option '$TTL'
- unexpected token near end of file
คำสั่งตรวจสอบค่าคอนฟิก ที่ Zone file ที่มีปัญหา
1. named-checkconf db.domain.co.th
-----------------------------------
#db.domain.co.th:1: unknown option '$TTL'
#db.domain.co.th:47: unexpected token near end of file
//---------------------------------------
2. named-checkzone domain.co.th /var/named/db.domain.co.th
--------------------------------------
zone domain.co.th/IN: NS 'hostxxx.domain.co.th' has no address records (A or AAAA)
zone domain.co.th/IN: not loaded due to errors.
//--------------------------------------
How to fix BIND does not permit underscores "_" unless you specificy the whole domain name
# named-checkzone abc.com. /var/named/abc.com.hosts
/var/named/abc.com.hosts:60: express_www1.abc.com: bad owner name (check-names)
/var/named/abc.com.hosts:61: express_www2.abc.com: bad owner name (check-names)
zone abc.com/IN: loaded serial 2020122401
OK
Add this to the option []
------
vim /etc/named.conf
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
.
.
check-names master ignore;
check-names slave ignore;
check-names response ignore;
# systemctl restart named
# systemctl status named
# named-checkzone abc.com. /var/named/abc.com.hosts -> recheck if show bad owner name (check-names) but it is OK!
ref:
1. rndc flush
2. rndc reload
3. เข้าไปแก้ไข Serail Number ที่ Zone File นั้นก่อน restart service DNS
4. /etc/init.d/bind9 reload (Restart service DNS)
ตัวอย่าง การแก้ไข
root@sip40:/etc/bind# rndc flush
root@sip40:/etc/bind# rndc reload
server reload successful
root@sip40:/etc/bind# named-checkzone domain.co.th db.domain.co.th
zone domain.co.th/IN: NS 'hqbackup01.domain.co.th' has no address records (A or AAAA) ** แสดงโดเมนที่ไม่สามารถโหลดได้ เราต้องเข้าไปแก้ไขตรวจสอบดูว่า ยังใช้งานอยู่ไหม
zone domain.co.th/IN: not loaded due to errors.
root@sip40:/etc/bind# vim db.domain.co.th ** เข้าไปแก้ไข และปรับค่า Serial ใหม่
root@sip40:/etc/bind# /etc/init.d/bind9 reload
Reloading domain name service...: bind9.
root@sip40:/etc/bind# named-checkzone domain.co.th db.domain.co.th
zone domain.co.th/IN: loaded serial 2014032701
OK
//--------------------------------------------------------------
แล้วกลับไปตรวจสอบอีกครั้ง
1. named-checkconf db.domain.co.th
-----------------------------------
#db.domain.co.th:1: unknown option '$TTL'
#db.domain.co.th:47: unexpected token near end of file
//---------------------------------------
**** ยังเจอ err. อยู่เหมือนเดิม แต่เมื่อลองไป nslookup จากเครื่องอื่น กลับสามารถ solve domain ได้ ถือว่า ok
2. named-checkzone domain.co.th db.domain.co.th
-----------------------------------
zone domain.co.th/IN: loaded serial 2014032701
OK
//--------------------------------
*** ใช้งานได้แล้ว
Reference:
rndc flush & rndc reload
Command Check DNS
Monday, March 24, 2014
Friday, March 21, 2014
Script Convert Ms outlook.psd to Thunderbird
to convert read link below
Convert
http://www.howtoforge.com/convert_outlook_pst_files_to_thunderbird_and_evolution_on_linux
Convert
http://www.howtoforge.com/convert_outlook_pst_files_to_thunderbird_and_evolution_on_linux
Tuesday, March 18, 2014
zimbra whitelist
Add zimbra whitelist
Reference: wiki.zimbra.com
PLEASE NOTE:
WHITELISTING SPECIFIC IP ADDRESS & HOSTNAME CAN INCREASE SPAM EMAILS IN CASE OF THE CLIENT MACHINE (IP) THAT YOU WHITELIST IS INFECTED BY VIRUS, ALSO IF THE WHITELISTED IP/HOSTNAME IS ALREADY BLACKLISTED, THEN BLACKLIST RULES WILL BE CONSIDERED FIRST.
Workaround1: whitelist specific user/complete domain
Edit the Spamassassin config file "/opt/zimbra/conf/salocal.cf.in" add below lines to the end of the file to whitelist a complete domain or specific user.
Example:
Note: All 3 workarounds will not survive upgrades, will have to take backup of above changes and redo the same changes after the upgrade.
Reference: wiki.zimbra.com
PLEASE NOTE:
WHITELISTING SPECIFIC IP ADDRESS & HOSTNAME CAN INCREASE SPAM EMAILS IN CASE OF THE CLIENT MACHINE (IP) THAT YOU WHITELIST IS INFECTED BY VIRUS, ALSO IF THE WHITELISTED IP/HOSTNAME IS ALREADY BLACKLISTED, THEN BLACKLIST RULES WILL BE CONSIDERED FIRST.
Workaround1: whitelist specific user/complete domain
Edit the Spamassassin config file "/opt/zimbra/conf/salocal.cf.in" add below lines to the end of the file to whitelist a complete domain or specific user.
whitelist_from *@domain.com whitelist_from user@domain.comAfter the above changes restart zmmtactl and zmamaviasdctl services and test the issue.
zmmtactl restart && zmamavisdctl restartWorkaround2: Whitelist IP Addresses/Hostnames while using RBL restrictions
Example:
[zimbra@zcs ~]$ vi /opt/zimbra/conf/postfix_rbl_override [zimbra@zcs ~]$ cat /opt/zimbra/conf/postfix_rbl_override -> add IP/hostnames you want to whitelist in this file. 10.137.27.80 OK 10.137.27.88 OK zcs711.us.zimbralab.com OK zcs714.us.zimbralab.com OK [zimbra@zcs ~]$ postmap /opt/zimbra/conf/postfix_rbl_override [zimbra@zcs ~]$ vi /opt/zimbra/conf/postfix_recipient_restrictions.cf [zimbra@zcs ~]$ cat /opt/zimbra/conf/postfix_recipient_restrictions.cf %%contains VAR:zimbraServiceEnabled cbpolicyd, check_policy_service inet:127.0.0.1:10031%% reject_non_fqdn_recipient permit_sasl_authenticated permit_mynetworks reject_unauth_destination check_client_access hash:/opt/zimbra/conf/postfix_rbl_override reject_unlisted_recipient %%contains VAR:zimbraMtaRestriction reject_invalid_hostname%% %%contains VAR:zimbraMtaRestriction reject_non_fqdn_hostname%% %%contains VAR:zimbraMtaRestriction reject_non_fqdn_sender%% %%contains VAR:zimbraMtaRestriction reject_unknown_client%% %%contains VAR:zimbraMtaRestriction reject_unknown_hostname%% %%contains VAR:zimbraMtaRestriction reject_unknown_sender_domain%% %%explode reject_rbl_client VAR:zimbraMtaRestrictionRBLs%% %%contains VAR:zimbraMtaRestriction check_policy_service unixrivate/policy%% permit [zimbra@zcs ~]$ zmmtactl restart Rewriting configuration files...done. postfix/postfix-script: refreshing the Postfix mail system Stopping saslauthd...done. Starting saslauthd...done. [zimbra@zcs ~]$Workaround3: Whitelist Hostname/IP addresses without restarting any services
[[root@v01 ~]# mkdir /etc/zimbra_custom --> create a directory inside /etc [root@v01 ~]# chown zimbra:zimbra /etc/zimbra_custom --> change user and group ownership to zimbra [root@v01 ~]# ls -ld /etc/zimbra_custom/ drwxr-xr-x 2 zimbra zimbra 4096 Jan 26 18:23 /etc/zimbra_custom/ [root@v01 ~]# su - zimbra --> switch to zimbra [zimbra@v01 ~]$ touch /etc/zimbra_custom/test_whitelist --> create a file [zimbra@v01 ~]$ nano /etc/zimbra_custom/test_whitelist --> ad list of domains or specific user that you want to whitelist [zimbra@v01 ~]$ cat /etc/zimbra_custom/test_whitelist v01.vinay.com OK 10.112.233.180 OK [zimbra@v01 ~]$ /opt/zimbra/postfix/sbin/postmap /etc/zimbra_custom/test_whitelist --> create a hash file using zimbra postmap [zimbra@v01 ~]$ ls -l /etc/zimbra_custom/ total 12 -rw-r----- 1 zimbra zimbra 18 Jan 26 18:24 test_whitelist -rw-r----- 1 zimbra zimbra 12288 Jan 26 18:24 test_whitelist.db --> .db file will be created [zimbra@v01 ~]$ [zimbra@v01 ~]$ postconf |grep smtpd_recipient_restrictions --> check the current recipient restrictions smtpd_recipient_restrictions = reject_non_fqdn_recipient, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unlisted_recipient, reject_invalid_helo_hostname, reject_non_fqdn_sender, permit [zimbra@v01 ~]$ postconf -e smtpd_recipient_restrictions="reject_non_fqdn_recipient, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unlisted_recipient, check_sender_access hash:/etc/zimbra_custom/test_whitelist, reject_invalid_helo_hostname, reject_non_fqdn_sender, permit" --> add the hash file to current recipient restrictions [zimbra@v01 ~]$ postconf |grep smtpd_recipient_restrictionssmtpd_recipient_restrictions = reject_non_fqdn_recipient, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unlisted_recipient, check_sender_access hash:/etc/zimbra_custom/test_whitelist, reject_invalid_helo_hostname, reject_non_fqdn_sender, permit [zimbra@v01 ~]$
Note: All 3 workarounds will not survive upgrades, will have to take backup of above changes and redo the same changes after the upgrade.
Monday, March 10, 2014
Check Download/Upload Internet on Ubuntu
เป็นโปรแกรมไว้ใช้ตรวจสอบมีการใช้งาน Internet / Network ไปเท่าไร ด้วยโปรแกรมเล็ก ๆ ต่อไปนี้
1.
5. nload Install
Ref: askubuntu.com
1.
iftop2. tcptrack3. slurm4. bmon -shows 5. nload Install
Ref: askubuntu.com
Tuesday, February 25, 2014
disable service apparmour
Disable & remove Apparmour
#sudo /etc/init.d/apparmour stop
#sudo /etc/init.d/apparmor teardown
#sudo update-rc.d -f apparmor remove
#sudo /etc/init.d/apparmour stop
#sudo /etc/init.d/apparmor teardown
#sudo update-rc.d -f apparmor remove
Wednesday, February 12, 2014
บันทึกคอนฟิก switch 3com 5500G
อ้างอิง nisolution.co.th : LINK
- คำสั่งที่ใช้ในการ Save Configuration
è ตัวอย่างการใช้คำสั่ง
<5500-ei>save -> ใช้คำสั่ง Save จากนั้นกดปุ่ม Enter5500-ei>
The configuration will be written to the device.
Are you sure?[Y/N] y -> ตอบ Y เพื่อทำการ Save จากนั้นกดปุ่ม Enter
Please input the file name (*.cfg)
[flash:3comoscfg.cfg]: -> เลือกชื่อไฟล์ที่ต้องการ Save Configuration ถ้าต้องการ Save ไว้ที่ไฟล์อื่นก็สามารถพิมพ์ชื่อไฟล์เข้าไปได้หรือกด Enter ผ่านไปโดยจะทำการ Save ไว้ที่ไฟล์ 3comoscfg.cfg
- คำส่งที่ใช้ในการ Factory Default
è ตัวอย่างการใช้คำสั่ง
<5500-ei>reset saved-configuration -> คำสั่งที่ใช้ในการ Factory Default จากนั้นกด Enter5500-ei>
The saved configuration will be erased.
Are you sure?[Y/N] y -> ถ้ามั่นใจแล้วตอบ Y แล้วกด Enter
Configuration in flash memory is being cleared.
Please wait …
<5500-ei>reboot -> จากนั้นใช้คำสั่ง reboot เพื่อ Restart อุปกรณ์5500-ei>
This will reboot device. Continue? [Y/N] y -> ตอบ y อีกครั้งเพื่อทำการ Reboot
หลังจากสั่ง Reboot ตัวอุปกรณ์แล้วจากนั้น Switch จะกลับมาเป็นค่า Default ที่มาจากโรงงานโดยค่า Configuration เดิมจะหายหมด โดยเราจะต้องทำการตั้งค่าเริ่มต้นของระบบใหม่ไม่ว่าจะเป็น Password ของ Admin สิทธ์ในการเข้าถึงต่างๆ เวลาของระบบ รวมถึงค่า Configuration ต่างๆ
DHCP multisubnet on Linux dhcp server
Edit config
------dhcpd.conf---------
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
# internal subnet.
subnet 192.168.x.0 netmask 255.255.255.0 {
range 192.168.x.90 192.168.x.150;
option domain-name-servers 192.168.x.xx, 192.168.x.x;
option routers 192.168.x.254;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.x.255;
}
# Other Subnet
subnet 192.168.2.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
option routers 192.168.2.1;
option domain-name-servers 192.168.x.xx, 192.168.x.x;
range 192.168.2.10 192.168.2.120;
}
host computer {
hardware ethernet 00:E0:7D:FD:04:AB;
fixed-address 192.168.x.xx;
}
configure switch 3com 5500G-ei ให้ DHCP Relay
Subscribe to:
Posts (Atom)
