How to make XAMPP start automatically on linux startup?

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

How to make XAMPP start automatically on linux startup?

Postby Shillos » 29. February 2004 09:40

Just wondering cos i'm a newbie on this. Please let me know how to make XAMPP start automatically on startup so i'll not need every time to start it up manually. Thanks!
Shillos
 
Posts: 1
Joined: 29. February 2004 09:29

Postby DJ DHG » 29. February 2004 11:05

User avatar
DJ DHG
AF Moderator
 
Posts: 2455
Joined: 27. December 2002 13:50
Location: Kiel

Boot Instructions = Command Not Found

Postby DrumLib » 18. January 2005 02:17

When I follow the instructions, all I get is "Command Not Found."

* First, find out your default runlevel.
* Simply type egrep :initdefault: /etc/inittab.

In terminal, as root, the egrip line gives me Command Not Found

So I poke around the internet, and I poke around Mandrake 10.1 and I find the file. The default runlevel is 5. So I switch to the /etc/rc.d/rc5.d directory.

Out of curiosity I try the egrip thing again: Command Not Found.

OK, back to the instructions. I "carry out the actual configuration by typing:"

ln -s /opt/lampp/lampp S99lampp

I hit <enter> and ....drumroll.... Command Not Found

Has anyone figured out how to get this to start at boot?
Vitamin Price Comparison
(including price based on standardized dose)
DrumLib
 
Posts: 4
Joined: 10. January 2005 19:46

Postby Dave_L » 18. January 2005 07:00

ln -s /opt/lampp/lampp S99lampp
ln -s /opt/lampp/lampp K01lampp


Those commands create symbolic links to /opt/lampp/lampp, one named "S99lampp" (for starting XAMPP), and one named "K01lampp" (for stopping XAMPP).

I wonder if that FAQ is up to date. The script /opt/lampp/lampp expects a valid parameter such as "start" or "stop", and will simply print usage instructions if no parameter is supplied.

Maybe it should be done this way:

Create /opt/lampp/lampp_start, with contents:

Code: Select all
#!/bin/bash
/opt/lampp/lampp start


Create /opt/lampp/lampp_stop, with contents:

Code: Select all
#!/bin/bash
/opt/lampp/lampp stop


Create links in runlevel directory:

Code: Select all
ln -s /opt/lampp/lampp_start S99lampp
ln -s /opt/lampp/lampp_stop K01lampp


The files lampp_start and lampp_stop must be executable, e.g. 755.

This works correctly on SimplyMEPIS 2004.06. At least it starts XAMPP on boot; I don't know whether it's stopping it.
User avatar
Dave_L
 
Posts: 212
Joined: 23. October 2004 00:43

Postby DrumLib » 18. January 2005 12:02

It works!!! Thank you, and thanks for explaining about the parameters and the symbolic links, Dave.

Here is what worked for me with Mandrake 10.1. There are probably much better ways to do it, and hopefully others will add to this thread, but even this might be of some use to another frustrated newbie coming from a Windows background:

I started to make the lampp_start and lampp_stop files in Quanta web editor, but when I tried to save them in the /opt/lampp/ directory, the Linux security nanny wouldn't let me do it. Now, I'm sure this is VERY bad security karma, but I opened the "Terminal" program and typed "su" at the prompt and hit <enter>. Then, I entered the root password at the prompt and became root. As root, I have the power to tell the security nanny to leave the /opt/lampp/ directory alone by typing this in and hitting <enter>:

chmod -R 777 /opt/lampp/

Now it let me save the Quanta files (lampp_start and lampp_stop) to the /opt/lampp/ directory. There are no extensions like in Windows, so, for example, I just typed lampp_start and saved it as "All files, Plain text document." Then, I went back to the "Terminal" (I'm still root) and changed to the directory where I saved the files and made them executable.

To change directory:
cd /opt/lampp

To make the files executable:
chmod 755 lampp_start
hit <enter> and then do the next one:
chmod 755 lampp_stop

All that's left is to make the symbolic links to the files. Now as a Linux dummy who hates the command line, I don't know how to navigate from /opt/lampp/ to my runlevel directory, so I close the "Terminal" program so I can start at the beginning. Then I open a fresh "Terminal" and log in as root (see above), curse the command line and the security nanny, and then I change to my runlevel directory (runlevel 5 (rc5.d) is for Mandrake 10.1, it might be different if you use a different distribution):

cd /etc/rc.d/rc5.d

Now that we are in the runlevel directory type:
ln -s /opt/lampp/lampp_start S99lampp
hit <enter> and then do the next one:
ln -s /opt/lampp/lampp_stop K01lampp

That's it! I closed the terminal, rebooted and everything starts up fine. Finally, after three days (the first two struggling with mandrake's server installation), I have a fully functional server for web development (I want to play with Drupal). Thanks again, Dave.

Note on this command: ln -s /opt/lampp/lampp_stop K01lampp
The first letter is a lowercase l as in luck. The last part is K[zero][one]lampp

I should probably chmod my /opt/lampp/ directory back to whatever it is supposed to be. Does anyone know?

Tomorrow, I'll post some info to this thread on how to find your default runlevel. Is there a table somewhere that lists the runlevel and path info for different distributions?
Vitamin Price Comparison
(including price based on standardized dose)
DrumLib
 
Posts: 4
Joined: 10. January 2005 19:46

Postby keving » 15. February 2006 16:25

Hi

I have followed this but it is not working. When I run lampp_start manually I get that it must be run as root (which I assume is why it doesn't run itself.

Any Ideas?

Thanks
keving
 
Posts: 3
Joined: 15. February 2006 16:10

Postby keving » 15. February 2006 16:39

Sorry, that last post was a bit useless. I'm running Suse 10.

The script can be successfully run as root but not as a normal user. The script does not automatically start for anyone.
keving
 
Posts: 3
Joined: 15. February 2006 16:10

Postby Hitman » 26. February 2006 09:23

Hi I'm running SUSE 9.3 Professional

I added the line:
/opt/lampp/lampp start
to the file:
/etc/init.d/boot.local
using vi and XAMPP starts automatically when the machine boots. I found this page of the SUSE manual helpful.
Hitman
 
Posts: 3
Joined: 26. February 2006 09:10

Postby DeepBlue » 28. February 2006 09:47

[quote="DrumLib"]I started to make the lampp_start and lampp_stop files in Quanta web editor, but when I tried to save them in the /opt/lampp/ directory, the Linux security nanny wouldn't let me do it. Now, I'm sure this is VERY bad security karma, but I opened the "Terminal" program and typed "su" at the prompt and hit <enter>. Then, I entered the root password at the prompt and became root. As root, I have the power to tell the security nanny to leave the /opt/lampp/ directory alone by typing this in and hitting enter: chmod -R 777 /opt/lampp/[\quote]

Ouch.

Not a good idea - here's how I do things like that -

Open a command window
SU
password

now type in the name of the program you want to use - e.g. GEDIT or Quanta.

The program will launch as normal but it will be running as root so you can change files in protected directories. Obviously you have to be careful but I think this is better than making the directories world writable.

Alan
DeepBlue
 
Posts: 8
Joined: 01. December 2005 15:47
Location: Glenrothes

Postby keving » 28. February 2006 12:31

Hi I've been meaning to repost for a while now. I was failing 2 posts ago.

I have it sorted. This is on SuSe 10.

In /opt/lampp create a file called lampp_start

It should contain:

#!/bin/bash
/opt/lampp/lampp start

make sure it is executable and readable by everyone (I used "File Manager - Super User Mode" from the KDE Menu then right click and select properties).

Then create a link in /etc/init.d (this was where I was going wrong!)
In terminal as root

cd /etc/init.d
ln -s /opt/lampp.lampp_start -C xampp

Now if you go into Yast and select system then system services. At this point I selected expert mode, scrolled down to xampp and selected it to run at level 3 and level 5.

Now it runs every time the machine is turned on (or restarted etc) regardless of whether we are in X (GUI - ren level 5) or text only (run level 3).
keving
 
Posts: 3
Joined: 15. February 2006 16:10

Postby DeepBlue » 04. March 2006 18:49

Dave_L wrote:
ln -s /opt/lampp/lampp S99lampp
ln -s /opt/lampp/lampp K01lampp


Those commands create symbolic links to /opt/lampp/lampp, one named "S99lampp" (for starting XAMPP), and one named "K01lampp" (for stopping XAMPP).

I wonder if that FAQ is up to date. The script /opt/lampp/lampp expects a valid parameter such as "start" or "stop", and will simply print usage instructions if no parameter is supplied.


I used to be confused about that as well. It turns out that when you create these symbolic links in the init directory the S and K have special meanings. The S means call this command with the START parameter and the K means call it with the STOP parameter (K for Kill I guess). The number indicates the priority this task has so S99lampp means once the previous 98 items have been run call the command /opt/lampp/lampp start.

Basically you are telling it to start XAMPP near the end of the boot procedure and to stop it early on during shutdown.
DeepBlue
 
Posts: 8
Joined: 01. December 2005 15:47
Location: Glenrothes

Postby DeepBlue » 04. March 2006 19:07

Hitman wrote:Hi I'm running SUSE 9.3 Professional

I added the line:
/opt/lampp/lampp start
to the file:
/etc/init.d/boot.local
using vi and XAMPP starts automatically when the machine boots. I found this page of the SUSE manual helpful.


Yep that works - and to be complete you should add /opt/lampp/lampp stop to /etc/init.d/halt.local

Alan
DeepBlue
 
Posts: 8
Joined: 01. December 2005 15:47
Location: Glenrothes


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 9 guests