CahBojonegoro

Rawe Rawe Rantas, Malang Malang Putung

Archive for the ‘Ubuntu’ Category

Start XAMPP at boot – Ubuntu way

with 2 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.

Written by cahbojonegoro

January 5, 2009 at 4:02 pm

Posted in Ubuntu, Unix