บทความ

กำหนดให้ส่งเมลได้ 1 โดเมน

สภาพแวดล้อม: CentOS-7-x86_64-Minimal-1511 Postfix+dovecot # cd /etc/postfix แก้ไขที่ไฟล์ main.cf # vim main.cf เพิ่มคำสั่งที่บรรทัดสุดท้าย transport_maps = hash :/etc/postfix/transport :wq! ออกมา แก้ไขที่ไฟล์ transport # vim transport เพิ่มคำสั่งที่บรรทัดสุดท้าย ชื่อโดเมนที่เราต้องการติดต่อ ตัวอย่าง... gmail.com : # หมายความว่าส่งได้เฉพาะเมลของ gmail.com * discard : # หมายความว่าถ้าส่งไปที่อื่นให้ discard ออกให้หมด :wq! ออกมา บันทึก db # postmap /etc/postfix/transport รีสตาร์ทเซอร์วิส postfix # systemctl restart postfix จากการทดสอบส่งหลายๆ โดเมน เมลจะถูกส่งไปเฉพาะโดเมนที่เรากำหนดนั่นคือ gmail.com และจากการเฝ้าดู 3 4 วัน เมลจะไม่ถูกส่งไปที่อื่น แต่พอปิดใช้งาน #gmail.com : # หมายความว่าส่งได้เฉพาะเมลของ gmail.com #* discard : # หมายความว่าถ้าส่งไปที่อื่นให้ discard ออกให้หมด ปรากฎว่าเมลถูกส่งไปโดเมนอื่นด้วย ซึ่งมันไม่ควรเป็นแบบนั้น มันควรถูกลบทิ้งไปเลย หาวิธีต่อไปครับ

วิธีแก้ปัญหา putty เป็นภาษาต่างดาวหรือเครื่องหมาย ???

รูปภาพ
ทำงานบน OS: CentOS-7-x86_64-Minimal-1511 ทดสอบบนแพกเกจ vsftpd แก้ไขไฟล์ .bashrc # vim .bashrc กดปุ่ม Insert เพื่อแก้ไข เลื่อนเคอเซอร์ลงบรรทัดล่างสุด พิมพ์ export LANG=th_TH ลงไปบรรทัดล่าง แล้วเซฟออกมา :wq! ------------------------------------------------------------ # .bashrc # User specific aliases and functions alias rm =' rm -i' alias cp =' cp -i' alias mv =' mv -i' # Source global definitions if [ -f /etc/bashrc ] ; then         . /etc/bashrc fi export LANG= th_TH ------------------------------------------------------------ แล้วไปกำหนดที่ putty ที่ Settings... ตรง Appearance เป็นฟอนต์ Fixedsys, 10-point ตรง Translation เป็น Use font encoding เสร็จแล้ว Save > Apply ออกมา การแสดงผลฝั่ง putty การแสดงผลฝั่ง FileZilla การแสดงผลฝั่ง WinSCP แต่ยังแก้ปัญหาใน บราวเซอร์และ windows ไม่ได้ ...หาต่อไป ถ้าได้จะมาบันทึกไว้ครับ

แก้ปัญหา Directory Index เป็นภาษาต่างดาว

รูปภาพ
เวลาเรียกดูไดเรคทอรี่งานที่เราเก็บไว้ ตามลิงค์ที่เราทำ แล้วมันเป็นภาษาต่างดาว เราจะแก้ไขดังนี้ เข้าไปแก้ไขไฟล์ httpd.conf # vim /etc/httpd/conf/httpd.conf # First, we configure the "default" to be a very restrictive set of # features. # <Directory   / >     Options FollowSymLinks     AllowOverride None # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # This should be changed to whatever you set DocumentRoot to. # <Directory   "/var/www/html" > # # Possible values for the Options directive are "None", "All", # or any combination of: #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. #

เปลี่ยนชื่อเครื่อง Linux Mint

เปิด terminal ขึ้นมา พิมพ์คำสั่ง $ sudo nano /etc/hostname pw99ke แก้ไขเสร็จ Save Ctrl+X จากนั้น restart เครื่องครับ $ sudo reboot -------------- ถ้าบางทีมันขึ้น sudo: unable to resolve host pw99ke ให้แก้ไขไฟล์ hosts $ sudo nano /etc/hosts 127.0.1.1 localhost 127.0.1.1 pw99ke

วิธีตั้ง crontab ใน Ubuntu

หามาตั้งนาน วิธีตั้ง crontab ให้ sync เวลาจาก T ime S erver มาให้กับ web apps server ต้องขอขอบคุณคุณผดุงศิลป์ JI $ sudo nano /etc/crontab # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user  command 1 * * * * root ntpdate 192.168.xx.xx  //เพิ่มใหม่เข้ามา IP เป็นของ Time Server นะครับ 17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly 25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-pa

eth0 ไม่ทำงาน

หลังจาก ghost Ubuntu Web Server แล้ว ปัญหาหนึ่งที่เจอคือ network ไม่ยอมรีสตาร์ท วิธีที่ใช้เดิมจะต้องไปเปลี่ยน eth0 เป็น eth1 ใน $ sudo nano /etc/network/interfaces # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.xx.xxx netmask 255.255.255.0 gateway 192.168.xx.xxx --> เปลี่ยนเป็น auto eth1 iface eth1 inet static แต่ตอนนี้ไม่ต้องแล้ว ใช้วิธีดังนี้ ให้ลบหรือเปลี่ยนชื่อเพื่อแบ็คอัพไฟล์ /etc/udev/rules.d/70-persistent-net.rules ก่อน $ sudo mv /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules.org จากนั้นรีบู๊ต $ sudo reboot น่าจะใช้ได้เป็นปกติ ลิงค์ที่น่าสนใจ http://ubuntuforums.org/showthread.php?t=1540959 https://help.ubuntu.com/community/VirtualBox/Networking http://mylinuxramblings.wordpress.com/2010/06/03/installing-virtualbox-guest-additions-on-ubuntu-server-10-04/ http://blog.brettalton.com/2010/04/28/installing-guest-additio

ตั้งเวลาใน crontab

$ sudo crontab -e กำหนดใน Sync เวลาทุก 3 นาที 3 * * * * ntpdate 192.168.xx.xxx (ไอพีเซิร์ฟเวอร์เวลากลาง) ข้อมูลเพิ่มเติม วิธีการใช้งาน crontab ครับ step 1: เข้า terminal แล้วก็พิมพ์ crontab -e เพื่อสร้าง crontab ที่จะใช้งาน โดยครั้งแรกที่เรียก crontab ขึ้นมาจะเห็นเป็นไฟล์เปล่าๆ มีแค่ comment บอกรูปแบบการเขียน crontab คร่าวๆดังนี้ # m h dom mon dow command *** อธิบายเพิ่มเติมครับ *** Field มีค่า รายละเอียด m(minute) 0-59 เวลาเป็นนาที จะสั่งให้คำสั่งที่กำหนดทำงานทันทีเมื่อถึง h(hour) 0-23 เวลาเป็นชั่วโมง จะสั่งให้คำสั่งที่กำหนดทำงานทันทีเมื่อถึง dom(day of month) 1-31 เวลาเป็นวัน จะสั่งให้คำสั่งที่กำหนดทำงานทันทีเมื่อถึง mon(month) 1-12 เวลาเป็นเดือน จะสั่งให้คำสั่งที่กำหนดทำงานทันทีเมื่อถึง dow(day of week) 0-6 วันของแต่ละสัปดาห์ มีค่าดังนี้(อาทิตย์=0,จันทร์=1,...,เสาร์=6) command คำสั่ง เราสามารถกำหนดคำสั่งหรือ script ที่ต้องการรันลงไปได้ step 2: เขียนคำสั่งลงไป เช่น # m h dom mon dow command 0