How to Auto Start LAMPP

Problems with the Linux version of XAMPP, questions, comments, and anything related.

How to Auto Start LAMPP

Postby JonB » 24. January 2012 20:15

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)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How to Auto Start LAMPP

Postby deep64blue » 21. April 2012 21:29

Which distro is this for? It doesn't work on 64-bit Fedora 16.
Fedora 16 64-bit / XAMPP 1.7.7
deep64blue
 
Posts: 2
Joined: 19. July 2011 22:38

Re: How to Auto Start LAMPP

Postby JonB » 27. April 2012 16:46

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)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How to Auto Start LAMPP

Postby MrJxN » 15. July 2012 17:08

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
MrJxN
 
Posts: 3
Joined: 14. July 2012 21:41
XAMPP Version: 5.6.3
Operating System: Ubuntu12 thru VirtualBox on W7

Re: How to Auto Start LAMPP

Postby kimmy » 21. September 2012 17:56

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
kimmy
 
Posts: 15
Joined: 21. September 2012 17:50
XAMPP Version: 5.6.3
Operating System: unity 64bit

Re: How to Auto Start LAMPP

Postby JonB » 21. September 2012 22:57

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)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How to Auto Start LAMPP

Postby kimmy » 21. September 2012 23:33

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.
kimmy
 
Posts: 15
Joined: 21. September 2012 17:50
XAMPP Version: 5.6.3
Operating System: unity 64bit

Re: How to Auto Start LAMPP

Postby timmyrico » 22. September 2012 08:55

No directory exists.
timmyrico
 
Posts: 1
Joined: 22. September 2012 08:02
XAMPP Version: 1.7.5
Operating System: Windows 7

Re: How to Auto Start LAMPP

Postby kimmy » 22. September 2012 12:53

timmyrico wrote:No directory exists.


I did mine direct from the files i used no terminal

@ /etc/ rc.local its there
kimmy
 
Posts: 15
Joined: 21. September 2012 17:50
XAMPP Version: 5.6.3
Operating System: unity 64bit

Re: How to Auto Start LAMPP

Postby JonB » 22. September 2012 13:43

@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
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How to Auto Start LAMPP

Postby marcm712 » 28. October 2012 16:17

Hi. Thank you for instruction. Finally guide that works well on my Debian 6.
I look forward for guide to stop during shutdown. :)
marcm712
 
Posts: 1
Joined: 28. October 2012 15:58
XAMPP Version: 5.6.3
Operating System: Deban 6.0.6

Re: How to Auto Start LAMPP

Postby JonB » 10. November 2012 14:07

@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)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How to Auto Start LAMPP

Postby kimmy » 14. January 2013 02:37

edit Scrub that found it :D
kimmy
 
Posts: 15
Joined: 21. September 2012 17:50
XAMPP Version: 5.6.3
Operating System: unity 64bit

Re: How to Auto Start LAMPP

Postby angela_zou » 23. January 2013 07:44

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
angela_zou
 
Posts: 13
Joined: 30. November 2011 06:28
XAMPP Version: 1.8.3-2
Operating System: Mac OS X Leopard

Re: How to Auto Start LAMPP

Postby kimmy » 06. June 2013 20:26

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.
kimmy
 
Posts: 15
Joined: 21. September 2012 17:50
XAMPP Version: 5.6.3
Operating System: unity 64bit

Next

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests