Page 1 of 2

How to Auto Start LAMPP

PostPosted: 24. January 2012 20:15
by JonB
I'm going to post 'auto-start' answer now -

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 :lol:

8)

Re: How to Auto Start LAMPP

PostPosted: 21. April 2012 21:29
by deep64blue
Which distro is this for? It doesn't work on 64-bit Fedora 16.

Re: How to Auto Start LAMPP

PostPosted: 27. April 2012 16:46
by JonB
What was the error you encountered?

It was tested on Fedora 15 32 bit. I can't think of any particular reason it should not work on Fedora 16 -- other than possibly SE Linux

Good Luck -
8)

Re: How to Auto Start LAMPP

PostPosted: 15. July 2012 17:08
by MrJxN
Tested on Ubuntu 12.04 32-bit:

No directory exists @ /etc/rc.d/ but the file rc.local is @ /etc/ so I added the line to this file, and it worked perfectly on system reboot.

Cheers!
MrJxN

Re: How to Auto Start LAMPP

PostPosted: 21. September 2012 17:56
by kimmy
MrJxN wrote:Tested on Ubuntu 12.04 32-bit:

No directory exists @ /etc/rc.d/ but the file rc.local is @ /etc/ so I added the line to this file, and it worked perfectly on system reboot.

Cheers!
MrJxN



Im using the same as the poster i quoted but it fails to start so here is my rc.local is it right ?

i did reboot and nothing

Code: Select all
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
/opt/lampp/lampp start

Re: How to Auto Start LAMPP

PostPosted: 21. September 2012 22:57
by JonB
perhaps if you put it before the 'exit 0'???

AFAIK - you no longer need the '0' there - it was to set the error returned to 0, false

Good Luck

8)

Re: How to Auto Start LAMPP

PostPosted: 21. September 2012 23:33
by kimmy
JonB wrote:perhaps if you put it before the 'exit 0'???

AFAIK - you no longer need the '0' there - it was to set the error returned to 0, false

Good Luck

8)


That done it thank you.

Re: How to Auto Start LAMPP

PostPosted: 22. September 2012 08:55
by timmyrico
No directory exists.

Re: How to Auto Start LAMPP

PostPosted: 22. September 2012 12:53
by kimmy
timmyrico wrote:No directory exists.


I did mine direct from the files i used no terminal

@ /etc/ rc.local its there

Re: How to Auto Start LAMPP

PostPosted: 22. September 2012 13:43
by JonB
@timmyrico -

Your profile says you are on Windows running 1.6.3a - that could be a reason it is not working also.

If that is not the case, please change your profile.

8)




ysf

Re: How to Auto Start LAMPP

PostPosted: 28. October 2012 16:17
by marcm712
Hi. Thank you for instruction. Finally guide that works well on my Debian 6.
I look forward for guide to stop during shutdown. :)

Re: How to Auto Start LAMPP

PostPosted: 10. November 2012 14:07
by JonB
@marcm712

OK, I should have posted this a long time ago. (my bad) I'm glad you were able use the startup tip :)

When I wrote that 'auto-start' fix, I really did not know much about how Linux processes are controlled by the OS kernel. It turns out that using 'shutdown' is all that is required for an orderly closing (AFAIK) If you pay attention to error logs and warnings, you will periodically see mention of 'signals'. These signals are the interprocess operating system communication tool for Linux and other Unix derivatives like Mac OS and Solaris. Properly shutting down is adequate, as the running processes (like httpd, mysqld etc) will get a signal that the OS is about to terminate in a certain fashion.

All processes are first notified that the system is going down by the signal SIGTERM.


http://linux.about.com/od/commands/l/bl ... hutdow.htm

Good Luck and have a good time with XAMPP.
8)

Re: How to Auto Start LAMPP

PostPosted: 14. January 2013 02:37
by kimmy
edit Scrub that found it :D

Re: How to Auto Start LAMPP

PostPosted: 23. January 2013 07:44
by angela_zou
I saw this neat trick on a tutorial:

Code: Select all
cd /etc/init.d
sudo nano lampp //file content follows in next section
sudo chmod +x lampp
sudo update-rc.d lamp defaults

//Put the following 2 lines inside the file, save, and exit
#!/bin/bash
/opt/lampp/lampp start

Re: How to Auto Start LAMPP

PostPosted: 06. June 2013 20:26
by kimmy
Has any one got this to work on xampp 1.8.1 yet ? as the file path not there :(

No directory exists @ /etc/rc.d/ or rc.local is @ /etc/

Edit i was having a silly moment.