แสดงบทความที่มีป้ายกำกับ Ubuntu 20.04 แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Ubuntu 20.04 แสดงบทความทั้งหมด

วันศุกร์ที่ 18 มีนาคม พ.ศ. 2565

(Shortcut) Install MariaDB Server 10.3 on Ubuntu 20.04

# update package and install
sudo apt update
sudo apt install mariadb-server mariadb-client

sudo mysql_secure_installation

sudo mysql -u root -p
# system will ask 2 password
# 1 linux user password
# 2 mysql root password

วันพฤหัสบดีที่ 1 กรกฎาคม พ.ศ. 2564

(Shortcut) Uncomplicated Firewall on Ubuntu 20.04

ref https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/ ref https://www.cyberciti.biz/faq/how-to-configure-firewall-with-ufw-on-ubuntu-20-04-lts/ sudo lsof -i:[port-number] sudo lsof -i -P -n | grep LISTEN sudo ufw status sudo ufw status numbered sudo ufw delete [number] sudo ufw enable sudo ufw disable sudo ufw allow 80/tcp comment 'accept Apache' sudo ufw allow 443/tcp comment 'accept HTTPS Connections' sudo ufw allow from [ip]

วันพฤหัสบดีที่ 10 มิถุนายน พ.ศ. 2564

การติดตั้ง Postfix ใน Ubuntu 20.04 ปี 2021

อีกครั้งกับการที่ต้องมา Setup ตัว Postfix ซึ่งไม่ได้ทำบ่อยแล้วไม่มีความรู้เรื่องนี้เอาสะเลย ครั้งนี้จะต้องขึ้น Server Mail ให้ระบบอื่น ๆ เข้ามาเชื่อมต่อเพื่อส่งเมลออกไปยังที่อื่น ๆ ต่อไป แม้จะเคยทำมาแล้วแต่ก็ลืมไปหมด ครั้งนี้ได้โอกาสเลยเอามาเขียยลง Blog ไว้จะถ้ามีโอกาสได้ทำอีก ก็จะได้กลับมาหาอ่านไปกันเร็ว ๆ ได้ ในบทความนี้เราจะมาเริ่มแบบไม่รู้อะไรค่อย ๆ กันแก้ Error ต่าง ๆ ไปด้วย ไปเริ่มทำกันเลย

OS ที่ใช้จะเป็น Ubuntu 20.04 เพื่อให้ใช้ตัวนี้กันไปยาว ๆ ให้เราทำการติดตั้งให้เรียบร้อยตั้ง Date, Local, Network และทำการ Upgrade Package ให้เรียบร้อย
จากนั้นทำการติดตั้ง postfix อีเมล Server และ mailutils เพื่อใช้ทดสอบส่งอีเมลออกจาก Server
# Install postfix and mailutils
sudo apt install postfix mailutils
เมื่อติดตั้งเรียบร้อยแล้วให้ทำการ configuration ตัว postfix โดยใช้คำสั่ง dpkg-reconfigure postfix เพื่อช่วยให้เรา Config ง่ายขึ้น และผมจะใช้ค่า Config Default ตั้งตนไปก่อน เดียวมาทำความเข้าใจแต่ละส่วนที่หลัง ค่าอยู่หลัง : นั้นใช้ Default ระบบมาให้แต่แรกเดียวเราจะกลับมาแก้ที่ละอัน และตั้งค่าที่ configuration แล้วก็ให้ทำการ restart postfix อีก 1 รอบ
# Configure postfix
sudo dpkg-reconfigure postfix

# Config Value
# General type of mail configuration: Internet Site
# System mail name: enoti
# Root and postmaster mail recipient: sarankon
# Other destinations to accept mail for (blank for none): enoti, enoti, localhost.localdomain, , localhost
# Force synchronous updates on mail queue?: <No>
# Local networks: 127.0.0.0/8 [::ffff:127.0.0.0]/24 [::1]/128
# Mailbox size limit (bytes): 0
# Local address extension character: +
# Internet protocols to use: all

sudo systemctl restart postfix
ลองส่งอีเมลเลยว่าได้ไหม โดยใช้ mailutils ในการส่ง
# Test Send Mail
echo "Postfix Test" | mail -s "Subject Test" youremail@gmail.com