How can I make xampp auto-start on reboot?

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

How can I make xampp auto-start on reboot?

Postby kengrome » 20. April 2006 06:17

I followed the instructions below which I found at:

http://www.apachefriends.org/en/faq-xampp-linux.html

... but xampp still fails to start on reboot like these instructions say it will:

After I rebooted my Linux box XAMPP stopped running! How can I fix this?

Correct. That's normal Linux behaviour (which applies to any other Unix-like system. It's the admin's job to make sure a particular application is started at bootup.

There is no real standard way to configure the boot process of a Linux system, but most of them should allow you to start XAMPP at boot time using the following steps.

1. First, find out your default runlevel.
Simply type egrep :initdefault: /etc/inittab.
You should no see a line containing a number between two colons.
In most cases 3 or 5 (2 if you're using Debian).

2. Go into the directory which configures this runlevel. If for example your runlevel is 3, then you have to change into the /etc/rc.d/rc3.d directory.

If your system didn't provide /etc/rc.d/rc3.d please try also /etc/init.d/rc3.d and /etc/rc3.d.

3. Now carry out the actual configuration by typing:

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

Now XAMPP should start and stop automatically if you boot or shutdown your machine.


Like I said, this did not work, and all I need is for xampp to start every time the computer is rebooted -- so my programmers can get to work immediately.

Does ANYONE have a definitive solution to make xampp start on reboot every time??? Or is this something that's never going to be possible on linux?
kengrome
 
Posts: 6
Joined: 20. April 2006 05:43

Postby jgbrown » 20. April 2006 12:49

It's quite possible. I have XAMPP starting automatically on the Ubuntu 5.10 server I've built.

What Linux distribution do you use?
User avatar
jgbrown
 
Posts: 13
Joined: 19. April 2006 02:38

Postby kengrome » 20. April 2006 13:27

I use PCLinuxOS.
kengrome
 
Posts: 6
Joined: 20. April 2006 05:43

Postby jgbrown » 20. April 2006 14:33

Two problems here: (1) the instructions in the FAQ are (I'm pretty certain) incorrect, and (2) I'm a moron. I solved this problem several weeks ago, and promptly forgot there was even a problem.

According to the instructions in the FAQ, you're supposed to link the lampp command:
Code: Select all
ln -s /opt/lampp/lampp S99lampp
ln -s /opt/lampp/lampp K01lampp

If you go to a command line as root and execute /opt/lampp/lampp, what happens? You get the help text for lampp. No joy there.

What's needed is a way to pass the start and stop parameters. So, create two new shell scripts.

/usr/local/bin/lamppstart.sh
Code: Select all
#!/bin/bash
/opt/lampp/lampp start
# EOF


/usr/local/bin/lamppstop.sh
Code: Select all
#!/bin/bash
/opt/lampp/lampp stop
# EOF


Be certain to mark both as executable:
Code: Select all
chmod +x /usr/local/bin/lamppstart.sh
chmod +x /usr/local/bin/lamppstop.sh


Change to the directory that controls the default runlevel, and link:
Code: Select all
ln -s /usr/local/bin/lamppstart.sh S99lampp
ln -s /usr/local/bin/lamppstop.sh K01lampp


Try that, and see if things turn out better.

JGB
User avatar
jgbrown
 
Posts: 13
Joined: 19. April 2006 02:38

Postby Oswald » 20. April 2006 15:40

Dear JGB!

The FAQ is correct! ;)

The booting process adds the missing "start" and "stop" to the command.

So if the boot script (on most systems /etc/init.d/rc) sees the symbolic link S99lampp it will call "S99lampp start". And if you shut your system down it will add a "stop" to "K01lampp".

Many greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby jgbrown » 20. April 2006 15:50

Okay. It's no surprise to me to find yet another Linux topic on which I am ignorant.

I do know that my method works, on Ubuntu at least. If there is some peculiarity about PCLinuxOS that accounts for the failure of the FAQ instructions when applied on that OS, the shell scripts could be a workaround.

Thanks...

JGB
User avatar
jgbrown
 
Posts: 13
Joined: 19. April 2006 02:38

Postby kengrome » 20. April 2006 16:01

Hi Oswald,

Thanks for your post. If the FAQs are correct, why don't they work for me on PCLinuxOS? Is there something unusual about this type of Linux that prevents your FAQ suggestion from working for me?

I have another question too, will it require the root user to login before xampp auto-starts (assuming we can eventually get it working) or will xampp start at boot even if another user is the first to login?

I know these questions are probably naive to you but there's a reason, I haven't been around Linux for very long. I have a solid 20 years of computer experience, but I have only been dealing with Linux (and the command line) for a couple months ... and I'm not afraid of it but some issues really need to be spelled out for me in simple terms so I can learn and understand.
kengrome
 
Posts: 6
Joined: 20. April 2006 05:43

Postby Oswald » 20. April 2006 17:10

Dear kengrome!

Thanks for your post. If the FAQs are correct, why don't they work for me on PCLinuxOS? Is there something unusual about this type of Linux that prevents your FAQ suggestion from working for me?


The boot process of Linux (or Unix) is not strictly definded. Every Unix and Linux vendor has it own way of booting. Most are using the so called "System V init" way of booting. But this is also only a "way" of booting. And not a strict standard.

I have another question too, will it require the root user to login before xampp auto-starts (assuming we can eventually get it working) or will xampp start at boot even if another user is the first to login?


Everything is done before someone logs in. So it doesn't matter who is the first one logging in.

To find out more: Search Google with system v init. There are many good explanations of this boot method.

Grettings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby jgbrown » 20. April 2006 17:22

In the little time I had to research this today, I did learn that PCLinuxOS is based on Mandrake. Does Mandrake use the System V boot method?

JGB
User avatar
jgbrown
 
Posts: 13
Joined: 19. April 2006 02:38

Postby Oswald » 20. April 2006 17:39

Dear JGB!

Yes, about 99% of all Linux distributions using the Sys V init method. (If your system has the file /etc/inittab it's using Sys V init.)

But - and that's the problem - there are many ways of implementing Sys V init. The only fixed fact is /etc/inittab. Everything else can (and do) differ from Linux distro to Linux distro. :(

Greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby jgbrown » 20. April 2006 17:59

Thanks very much for the lesson, Oswald. Apologies for having stuck my ignorant nose into the matter, but at least I come away a bit wiser.

JGB
User avatar
jgbrown
 
Posts: 13
Joined: 19. April 2006 02:38

Postby Oswald » 20. April 2006 21:34

Dear JGB!

This time I've to correct you: "ignorant nose". Absolutely no no. The first time I saw the start and stop symbolics links pointing on the same file, I also thought: This must be a stupid error. How could the same script start and stop a specific daemon? Later I learned about the magic "start" and "stop" parameter.

So there are two ways to get out of this: 2 ignorant noses or 2 very clever noses learning something. ;)

I prefer the second one. ;)

Many greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby kengrome » 21. April 2006 04:54

So Oswald ... is there some information I can collect for you (on my PCLinuxOS system) that would give you any clues about how you/we can possibly get xampp to auto-start on my PCLinux boxes?

As JGB pointed out PCLinuxOS is based on Mandrake. And I confirmed a few minutes ago that it does indeed have the /etc/inittab file, which you said is an indicator that it use the "System V init method".

Do you want me to post the contents of the /etc/inittab file here so you can take a look at it? How about any other files you might need to look at?

I can navigate to any file or folder in the system and post snapshots of folder contents -- or the content of specific files -- if this will help you to help me. Please just let me know how to proceed and I'll do everything I can so we can make this work ... :)
kengrome
 
Posts: 6
Joined: 20. April 2006 05:43

Postby Oswald » 21. April 2006 06:04

Dear kengrome!

Okay. Somewhere in your /etc/inittab there are some line like this:

Code: Select all
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6


Could you send (not post here, because it's to long) me the file /etc/init.d/rc? Or whatever file in your case is metioned here.

Greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby kengrome » 21. April 2006 09:28

Hi Oswald, the lines in the /etc/inittab file that are similar to the ones you posted above refer to the /etc/rc.d/rc file. Therefore I sent you the contents of the /etc/rc.d/rc file as a personal message. Thank you very much for taking the time to help me with this ... :)
kengrome
 
Posts: 6
Joined: 20. April 2006 05:43

Next

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 29 guests