How to auto-start LAMPP on Linux distributions using the /etc/rc.d/rc.local file.
Using a root login, su or sudo, start a term session
Now, use your favorite text editor (mine is geany), but vi, gedit, or nano will also be cool, and edit '/etc/rc.d/rc.local'.
- Code: Select all
[root@localhost jonb]# geany /etc/rc.d/rc.local
add the LAMPP start command (/opt/lampp/lampp start) to the end of the file:
- Code: Select all
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
# 'touch/var/lock/subsys/local' was already part of my configuration and should NOT be added to yours
touch /var/lock/subsys/local
/opt/lampp/lampp start
Save the file - restart your box.
login
use term and check your LAMPP
- Code: Select all
[jonb@localhost ~]$ su
Password:
[root@localhost jonb]# /opt/lampp/lampp status
Version: XAMPP for Linux 1.7.4
Apache is running.
MySQL is running.
ProFTPD is running.
~ tada ~ It werky!
This works because you edited the file as 'root', and the rc.d/rc.local is run AFTER all other initialization has been done (the system is 'ready'), and BEFORE the login prompt is offered. (remembering that ONLY 'root' can start Apache). rc.d == 'run command.daemon' (it allows you to run commands)
https://www.linux.com/news/enterprise/s ... cd-scripts
I'll work out the shutdown in another episode, stay tuned
![Laughing :lol:](./images/smilies/icon_lol.gif)
![Cool 8)](./images/smilies/icon_cool.gif)