Last active
September 16, 2021 16:54
-
-
Save onwp/4ea88ad941d0ab92568c5d10023d6e75 to your computer and use it in GitHub Desktop.
Run xampp as a service automatically on ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run the command below first: | |
sudo nano /etc/systemd/system/xampp.service | |
If you have gedit, you can use gedit instead of nano | |
Copy and Paste Below Into the text editor and save | |
[Unit] | |
Description=XAMPP | |
[Service] | |
ExecStart=/opt/lampp/lampp start | |
ExecStop=/opt/lampp/lampp stop | |
Type=forking | |
[Install] | |
WantedBy=multi-user.target | |
Run systemctl status xampp.service to check the status | |
Now you can run: | |
systemctl start xampp | |
and start the service. You can use stop instead of start if you'd like stop xampp. | |
And when you want to restart xampp (both apache and mysql) you can run | |
systemctl restart xampp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment