ปกติแล้วเวลาเราทำการ Secure Shell เข้าไปเพื่อทำงานบ้างอย่าง พอเราออกมา Process พวกนั้นก็จะถูก Terminate ไปด้วย
หากเราต้องการจะให้มันทำงานต่อไปเรื่อยๆ แม้เราจะออกมาแล้วจะทำยังไง ผมได้ไปค้นหาข้อมูลดูก็เจอ 2 ตัวนี้คือ screen และ tmux
เท่าที่ผมรู้ตัว screen เป็นตัวเก่ามีมานานแล้ว พอลองไปเล่นที่เครื่องดูก็พบว่าติดตั้งไว้ให้อยู่แล้ว แต่พอหัดใช้สักพักรู้สึกงงๆ
ผมเลยลองเล่นอีกตัวที่เขาแนะนำมาคือ tmux ชื่อเต็มๆ คือ Terminal Multiplexer ครับ
วันพุธที่ 16 มกราคม พ.ศ. 2562
วันอาทิตย์ที่ 30 ธันวาคม พ.ศ. 2561
[Ubuntu] วิธีการติดตั้ง และ การตั้งค่า Apache 2 ใน Ubuntu 18.04
คำสั่งที่ใช้ในการติดตั้ง
1 2 3 4 5 | sudo apt install apache2 # สั่งให้เริ่มทำงาน และตั้งค่าให้เริ่มทำงานเมื่อเปิดเครื่อง sudo systemctl start apache2 sudo systemctl enable apache2 |
วันพุธที่ 26 ธันวาคม พ.ศ. 2561
[Ubuntu] การแก้ไข Hostname, Time และ Local ใน Ubuntu 18.04
คำสั่งที่ใช้ในการดู Hostname
เมื่อเราต้องการเปลี่ยน Hostname เราสามารถเข้าไปแก้ไขไฟล์ "/etc/hosts" หรือใช้คำสั่ง "hostnamectl" ก็ได้
การใช้คำสั่ง "hostnamectl" ก็จะเป็นการแก้ไขไฟล์ "/etc/hosts" นั้นเองแต่เป็นการทำผ่านคำสั่ง
1 2 3 4 5 | # ดูแค่ Hostname อย่างเดียว hostname # ดู Hostname และรายละเอียดอื่นๆ hostnamectl |
เมื่อเราต้องการเปลี่ยน Hostname เราสามารถเข้าไปแก้ไขไฟล์ "/etc/hosts" หรือใช้คำสั่ง "hostnamectl" ก็ได้
การใช้คำสั่ง "hostnamectl" ก็จะเป็นการแก้ไขไฟล์ "/etc/hosts" นั้นเองแต่เป็นการทำผ่านคำสั่ง
1 | sudo hostnamectl set - hostname [new- hostname ] |
***เมื่อเราทำการแก้ Hostname ใน Ubuntu 18.04 แล้วทำการ Reboot อาจพบว่า Hostname กลับมาเป็นเหมือนเดิม
ให้เราทำการแก้ไขไฟล์ "/etc/cloud/cloud.cfg" ค่า "preserve_hostname:" เป็น "true" จากนั้น Save ไฟล์ แล้วทำการ set hostname ใหม่วันเสาร์ที่ 22 ธันวาคม พ.ศ. 2561
Use Syntax Highlighter on Blogger
การใส่โค้ดลงไปใน Blogger นั้นไม่สวยงามเราจำเป็นต้องใช้ Syntax Highlighter
เพื่อช่วยให้ Code นั้นดูง่ายมีการแสดงเลขบรรทัดชัดเจนสวยงาน
รายการภาษาที่รองรับใน Version 3 ที่กำลังใช้งานอยู่ใน Blog นี้
_/\_ ขอบคุณ Cloudflare ดูไฟล์อื่นๆ หากต้องใช้งานได้ที่นี้
เวลาต้องการใช้งาน ก็แทรก <pre class="brush: {language}"> และ </pre> ปิดท้าย
Syntax Highlighter 4
เพื่อช่วยให้ Code นั้นดูง่ายมีการแสดงเลขบรรทัดชัดเจนสวยงาน
รายการภาษาที่รองรับใน Version 3 ที่กำลังใช้งานอยู่ใน Blog นี้
_/\_ ขอบคุณ Cloudflare ดูไฟล์อื่นๆ หากต้องใช้งานได้ที่นี้
วิธีการใช้งาน
ก่อนใช้งานเราจะต้องเพิ่ม Code ใน Template แบบนี้เวลาต้องการใช้งาน ก็แทรก <pre class="brush: {language}"> และ </pre> ปิดท้าย
1 2 3 | < pre class = "brush:html;highlight:[2]" title = "bash/shell" > ########## YOUR CODE ########## </ pre > |
Syntax Highlighter 4
[Linux Container] - How to Install & Basic
https://linuxcontainers.org/ เว็บที่สามารถไปอ่านได้ควรอ่าน
https://lxd.readthedocs.io/en/stable-3.0/ | Container, Network
แรกเริ่มเดิมทีไม่ได้สนใจเจ้า Linux Container เลยเพราะคิดว่าใช้ยาก หาข้อมูลภาษาไทยหาไม่เจอ เราจะเจอแต่ Docker เยอะเลย
เจ้าตัว Docker พยายามลองใช้หลายครั้งแล้ว ลงเรียนออนไลน์ก็แล้ว ส่วนตัวรู้สึกว่าการ Config ค่าใน Container ทำได้ไม่เหมือนกับที่เราลงกับเครื่องจริงๆ เลยลองหาข้อมูลดูว่ามีตัวเลือกอื่นๆ อีกไหม ซึ่งก็เจออยู่หลายตัว แต่ในนี้จะไม่ขอพูดถึง เพราะไม่ได้อ่านตัวอื่น เลือก Linux Container แล้วก็ศึกษาตัวเดียวนี้เลย และก็พบกับตัวเองว่าคำสั่งหลาย หรือทุกคำสั่งเลยมั้ง เราใช้ใน Container ได้เหมือนลงจริงๆ และก็ลองไปเรื่อยๆ จนคิดว่าเราน่าจะถูกจริตกับตัวนี้ที่สุดแล้วมั้งๆ
การติดตั้ง Linux Container ต้องใช้ Ubuntu นะเพราะเขาค่ายเดียวกันทำมาเพื่อกันและกันก็จะลงง่ายมาก
เมื่อติดตั้งเสร็จให้เราทำการ Initial ก่อน
คำสั่งมีอะไรบ้างอันนี้แบบไม่จัดกลุ่ม ให้เราพิมพ์
คำสั่ง lxd --help
คำสั่ง lxc --help
https://lxd.readthedocs.io/en/stable-3.0/ | Container, Network
แรกเริ่มเดิมทีไม่ได้สนใจเจ้า Linux Container เลยเพราะคิดว่าใช้ยาก หาข้อมูลภาษาไทยหาไม่เจอ เราจะเจอแต่ Docker เยอะเลย
เจ้าตัว Docker พยายามลองใช้หลายครั้งแล้ว ลงเรียนออนไลน์ก็แล้ว ส่วนตัวรู้สึกว่าการ Config ค่าใน Container ทำได้ไม่เหมือนกับที่เราลงกับเครื่องจริงๆ เลยลองหาข้อมูลดูว่ามีตัวเลือกอื่นๆ อีกไหม ซึ่งก็เจออยู่หลายตัว แต่ในนี้จะไม่ขอพูดถึง เพราะไม่ได้อ่านตัวอื่น เลือก Linux Container แล้วก็ศึกษาตัวเดียวนี้เลย และก็พบกับตัวเองว่าคำสั่งหลาย หรือทุกคำสั่งเลยมั้ง เราใช้ใน Container ได้เหมือนลงจริงๆ และก็ลองไปเรื่อยๆ จนคิดว่าเราน่าจะถูกจริตกับตัวนี้ที่สุดแล้วมั้งๆ
การติดตั้ง Linux Container ต้องใช้ Ubuntu นะเพราะเขาค่ายเดียวกันทำมาเพื่อกันและกันก็จะลงง่ายมาก
1 | sudo snap install lxd |
เมื่อติดตั้งเสร็จให้เราทำการ Initial ก่อน
1 2 3 4 | sudo lxd init # เพิ่มเข้ากลุ่ม LXD เวลาใช้งานจะได้ไม่ต้องค่อยพิมพ์ sudo sudo usermod --append -- groups lxd sarankon |
คำสั่งมีอะไรบ้างอันนี้แบบไม่จัดกลุ่ม ให้เราพิมพ์
คำสั่ง lxd --help
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | sudo lxd --help Description: The LXD container manager (daemon) This is the LXD daemon command line. It's typically started directly by your init system and interacted with through a tool like `lxc`. There are however a number of subcommands that let you interact directly with the local LXD daemon and which may not be performed through the REST API alone. Usage: lxd [flags] lxd [ command ] Available Commands: activateifneeded Check if LXD should be started help Help about any command import Import existing containers init Configure the LXD daemon shutdown Tell LXD to shutdown all containers and exit version Show the server version waitready Wait for LXD to be ready to process requests Flags: -d, --debug Show all debug messages --group The group of users that will be allowed to talk to LXD -h, --help Print help --logfile Path to the log file --syslog Log to syslog --trace Log tracing targets - v , --verbose Show all information messages --version Print version number Use "lxd [command] --help" for more information about a command . |
คำสั่ง lxc --help
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | sudo lxc --help Description: Command line client for LXD All of LXD's features can be driven through the various commands below. For help with any of those, simply call them with --help. Usage: lxc [ command ] Available Commands: alias Manage command aliases cluster Manage cluster members config Manage container and server configuration options console Attach to container consoles copy Copy containers within or in between LXD instances delete Delete containers and snapshots exec Execute commands in containers export Export container backups file Manage files in containers help Help about any command image Manage images import Import container backups info Show container or server information launch Create and start containers from images list List containers move Move containers within or in between LXD instances network Manage and attach containers to networks operation List, show and delete background operations profile Manage profiles project Manage projects publish Publish containers as images remote Manage the list of remote servers rename Rename containers and snapshots restart Restart containers restore Restore containers from snapshots snapshot Create container snapshots start Start containers stop Stop containers storage Manage storage pools and volumes version Show local and remote versions Flags: --all Show less common commands --debug Show all debug messages --force- local Force using the local unix socket -h, --help Print help --project string Override the source project -q, --quiet Don't show progress information - v , --verbose Show all information messages --version Print version number Use "lxc [command] --help" for more information about a command . |
วันพฤหัสบดีที่ 20 ธันวาคม พ.ศ. 2561
[Linux Container] - การติดตั้ง OCS2 และ OJS2 บน Linux Container
จุดประสงค์ตามรายการต่อไปนี้
ติดตั้ง Linux Ubuntu 18.04
ติดตั้ง Linux Container (LDX, LXC ใน Ubuntu 18.04)
ติดตั้ง Packages ผ่าน Snappy
เมื่อติดตั้งครั้งแรกให้ทำการตั้งค่าก่อนใช้งาน
เราจะเจอกับคำถามประมาณนี้
- ติดตั้ง Linux Container (LDX, LXC) และการใช้งานนิดหน่อย
- สร้างและใช้งาน Container ที่ลง CentOS 7
- เตรียมและติดตั้ง OCS and OJS ใน Container CentOS 7
- ลง httpd, php, php-mysqlnd และ mariadb-server
- ดาวน์โหลด OCS และ OJS
- ปรับสิทธิ์การเข้าถึงไฟล์ และติดตั้งผ่านเว็บเบราว์เซอร์
- ตั้งค่า Reverse Proxy ที่ Ubuntu
ติดตั้ง Linux Ubuntu 18.04
ติดตั้ง Linux Container (LDX, LXC ใน Ubuntu 18.04)
ติดตั้ง Packages ผ่าน Snappy
1 | sudo snap install lxd |
1 | sudo lxd init |
Would you like to use LXD clustering? ( yes /no ) [default=no]:_ Do you want to configure a new storage pool? ( yes /no ) [default= yes ]:_ Name of the new storage pool [default=default]:_ Name of the storage backend to use (btrfs, ceph, dir , lvm, zfs) [default=zfs]:_ Create a new ZFS pool? ( yes /no ) [default= yes ]:_ Would you like to use an existing block device? ( yes /no ) [default=no]:_ Size in GB of the new loop device (1GB minimum) [default=15GB]: 10 Would you like to connect to a MAAS server? ( yes /no ) [default=no]:_ Would you like to create a new local network bridge? ( yes /no ) [default= yes ]:_ What should the new bridge be called? [default=lxdbr0]:_ What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:_ What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:_ Would you like LXD to be available over the network? ( yes /no ) [default=no]:_ Would you like stale cached images to be updated automatically? ( yes /no ) [default= yes ]:_ Would you like a YAML "lxd init" preseed to be printed? ( yes /no ) [default=no]:_ |
ป้ายกำกับ:
Linux Container,
LXC,
LXD,
OCS,
OJS
ตำแหน่ง:
Thailand
สมัครสมาชิก:
บทความ (Atom)