CahBojonegoro

Rawe Rawe Rantas, Malang Malang Putung

Start XAMPP at boot – Ubuntu way

with 6 comments

I Installed XAMPP inside Ubuntu JeOS in Virtual Box. Using this XAMPP, i create a blog to manage all note & tips my work that can’t be posted in public because of proprietary reason.
This lightweight JeOS is only having Operating System without any Graphical User Interface and i need to start XAMPP service automatically at start up of the VM. So, here i go.

( I installed XAMPP in /opt . Full path of lampp binary is /opt/lampp/lampp )

1. Create an init script in /etc/init.d/

cd /etc/init.d/
sudo vi lampp
copy and paste this lines:
#!/bin/bash
/opt/lampp/lampp start

2. Use update-rc.d to install init scripts to all runlevel.

sudo update-rc.d lampp defaults

In the next restart, XAMPP will automatically started. We can verify using this command.

user@jeos$ ps -ef | grep lampp
root      3842     1  0 20:42 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
root      3869     1  0 20:42 ?        00:00:00 /bin/sh /opt/lampp/bin/mysqld_safe –datadir=/opt/lampp/var/mysql –pid-file=/opt/lampp/var/mysql/jeos.pid
nobody    3903  3842  0 20:42 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody    3923  3869  0 20:42 ?        00:00:01 /opt/lampp/sbin/mysqld –basedir=/opt/lampp –datadir=/opt/lampp/var/mysql –user=nobody –pid-file=/opt/lampp/var/mysql/jeos.pid –skip-external-locking –port=3306 –socket=/opt/lampp/var/mysql/mysql.sock
nobody    3929  3842  0 20:42 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody    3930  3842  0 20:42 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody    3931  3842  0 20:42 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody    3932  3842  0 20:42 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody    3933  3842  0 20:42 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody    3957  3842  0 20:42 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5

we can enhanced the startup script to accept argument like start, stop, restart.

Advertisements

Written by cahbojonegoro

January 5, 2009 at 4:02 pm

Posted in Ubuntu, Unix

6 Responses

Subscribe to comments with RSS.

  1. Hi Having a problem with part 2, copy and paste. I am new to ubuntu, can you explane?

    Hop you have the time to reply.

    /Søren

    Søren Kjems

    September 11, 2010 at 11:28 am

  2. […] source article : disini […]

  3. hi i’m getting this

    nobody 2563 1282 0 12:51 ? 00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
    nobody 2564 1282 0 12:51 ? 00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log

    It works, but theres an error_log…
    plus when I did step 2, it says, LSB missing information.. what is that all about?

    Jenny

    June 30, 2011 at 1:55 pm

  4. One more step:

    cd /etc/init.d/

    /etc/init.d$ sudo chmod u+x lampp

    David

    January 5, 2012 at 7:14 pm

  5. For newbies one thing you forgot is to :
    chmod 755 lampp

    after creating the file

    hung5s

    January 17, 2013 at 7:27 pm

  6. can anyone help. After lampp boot I am able to send postfix email from server to gmail and from gmail to server as postfix, dovecot, saslauth is already started at boot but php script mail gives error and requires lampp to be restarted once and then php mail is sent continuously. Logs show postfix is started but no entry log error for uid nobody but once I restart lampp I get log entry uid nobody and php mail is sent thereon.

    rajeev

    August 12, 2014 at 6:32 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: