[Sưu tầm] Auto Start LAMPP (XAMPP) at Startup in Ubuntu Linux

Table of Contents

Hướng dẫn chỉnh tự động bật LAMPP khi khởi động Server Linux

Creating a script to start XAMPP automatically in Ubuntu 18.04 or later

Tạo file services để khởi động LAMPP, ở đây tui dùng vim để edit, bạn có thể dùng nano hay gì tùy sở thích của bạn =))

vim /etc/systemd/system/xampp.service

Chép nội dung sau vào

[Unit]
Description=XAMPP

[Service]
ExecStart=/opt/lampp/lampp start
ExecStop=/opt/lampp/lampp stop
Type=forking

[Install]
WantedBy=multi-user.target

image

Xong thì lưu lại và thoát thôi

Instruct Ubuntu to execute LAMPP service at the startup

systemctl enable xampp.service

Sau khi xong thì khởi động lại máy thử, trong trường hợp của mình thì khởi động lại vẫn không được :')

Mình mới quyết định gán quyền chạy cho file services

chmod +x /etc/systemd/system/xampp.service

Sau đó mình cd vô thư mục /etc/systemd/system/ rồi chạy lại lệnh systemctl enable xampp.service, khởi động lại thì thấy ok. Không biết tại sao luôn :')

Mấy thứ tâm linh không đùa được đâu =))

Tham khảo

  1. https://www.computernetworkingnotes.com/linux-tutorials/auto-start-xampp-at-startup-in-ubuntu-linux.html
  2. https://safeeronline.wordpress.com/2013/08/24/auto-start-xampp-on-linux-ubuntu-startup-lampp/

Leave a Reply

Your email address will not be published. Required fields are marked *