starting Xampp automatically at boot

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

starting Xampp automatically at boot

Postby slylock » 25. April 2006 19:18

I have Xampp running on Solaris 10 and it's great! Just one question, as I'm a newbie at Solaris: what's the recommended way to have xampp started at bootup?
slylock
 
Posts: 2
Joined: 25. April 2006 18:51

Postby slylock » 15. August 2006 01:54

I tried following the Linux instructions, i.e. created S99xampp and K01xampp in /etc/rc3.d that point to the /opt/xampp/xampp script, but it didn't work. Perhaps that rc stuff is no longer applicable to Solaris 10?
slylock
 
Posts: 2
Joined: 25. April 2006 18:51

Postby krelvinaz » 15. August 2006 08:46

Even though Solaris 10 now moved most of the rc type scripts to a more advanced system (SMF), you can still run Legacy rc scripts with Solaris 10.

You can use something like below:


Code: Select all
case "$1" in
'start')
        cd /opt/xampp
        ./xampp start
        ;;
'stop')
        cd /opt/xampp
        ./xampp stop
        ;;

'reload')
        cd /opt/xampp
        ./xampp reload
        ;;
*)
        echo "Usage: $0 { start | stop | reload}"
        exit 1
esac
exit 0


Place the script in a file like /etc/rc3.d/S98xampp

Make sure it has execute permissions

Code: Select all
# chmod 0750 /etc/rc3.d/S98xampp


And you might want to add a link of it to other rc levels for proper shutdown.

Code: Select all
# ln -s /etc/rc3.d/S98xampp /etc/rc0.d/K03xampp
# ln -s /etc/rc3.d/S98xampp /etc/rc1.d/K03xampp


and you should be set.

You can always test the script by simply calling it directly.

Code: Select all
# /etc/rc3.d/S98xampp start
# /etc/rc3.d/S98xampp stop
# /etc/rc3.d/S98xampp reload
Kevin
User avatar
krelvinaz
 
Posts: 79
Joined: 02. October 2005 05:46
Location: Mesa, AZ USA

Run as Service on Solaris 8

Postby rkaralius » 05. May 2007 05:25

I created this because I am used to using /etc/init.d/<program> <action> to start and stop applications. any one is welcome to use it.

Tested on Solaris 8 & should also work with 9 and 10!



Code: Select all
#!/bin/sh
#
# Update Path to your installed path, path="/opt/xampp"
#
# xampp service autorun/stop
#
# To install service create this file as /etc/init.d/xampp
#
# chmod +x /etc/init.d/xampp
#
# to stop at run level 0 number 16
# ln -s /etc/init.d/xampp /etc/rc0.d/K16xampp
#
# to stop at run level 1 number 16
# ln -s /etc/init.d/xampp /etc/rc1.d/K16xampp
#
# to stop at run level 2 number 16
# ln -s /etc/init.d/xampp /etc/rc2.d/K16xampp
#
# to start at run level 3 number 50
# ln -s /etc/init.d/xampp /etc/rc3.d/S50xampp
#
# be sure to disable apache, remove any Sxxapache files from the
# /etc/rcX.d/ directories. files that start with S only...
#
# the functions start(S) and stop(K) are run at run level change
# example: to only start\stop apache
# change start\stop lines from $path/xampp start and $path/xampp stop
# to $path/xampp startapache and $path/xampp stopapache

path="/opt/xampp"

case "$1" in

'start')
     # Starts XAMPP
$path/xampp start
     ;;

'stop')
     # Stops XAMPP
$path/xampp stop
     ;;

'restart')
     # Stops and starts XAMPP
$path/xampp restart
     ;;

'startapache')
     # Starts only the Apache
$path/xampp startapache
     ;;

'startssl')
     # Starts the Apache SSL support. This command activates the
     # SSL support permanently, e.g. if you restart XAMPP
     # in the future SSL will stay activated
$path/xampp startssl
     ;;

'startmysql')
     # Starts only the MySQL database
$path/xampp startmysql
     ;;

'startftp')
     # Starts the ProFTPD server. Via FTP you can upload files
     # for your web server (user "nobody", password "xampp").
     # This command activates the ProFTPD permanently, e.g.
     # if you restarts XAMPP in the future FTP will stay activated
$path/xampp startftp
     ;;

'stopapache')
     # Stops the Apache
$path/xampp stopapache
     ;;

'stopssl')
     # Stops the Apache SSL support. This command deactivates the
     # SSL support permanently, e.g. if you restarts XAMPP
     # in the future SSL will stay deactivated
$path/xampp stopssl
     ;;

'stopmysql')
     # Stops the MySQL database
$path/xampp stopmysql
     ;;

'stopftp')
     # Stops the ProFTPD server. This command deactivates the
     # ProFTPD permanently, e.g. if you restarts XAMPP in the
     # future FTP will stay deactivated
$path/xampp stopftp
     ;;

*)
     echo "Usage: /etc/init.d/xampp <action>"
     echo ""
     echo "start        Start XAMPP (Apache, MySQL and eventually others)"
     echo "startapache  Start only Apache"
     echo "startssl     Start only SSL support"
     echo "startmysql   Start only MySQL"
     echo "startftp     Start only ProFTPD"
     echo ""
     echo "stop         Stop XAMPP (Apache, MySQL and eventually others)"
     echo "stopapache   Stop only Apache"
     echo "stopssl      Stop only SSL support"
     echo "stopmysql    Stop only MySQL"
     echo "stopftp      Stop only ProFTPD"
     echo ""
     echo "reload       Reload XAMPP (Apache, MySQL and eventually others)"
     echo "reloadapache Reload only Apache"
     echo "reloadmysql  Reload only MySQL"
     echo "reloadftp    Reload only ProFTPD"
     echo ""
     echo "restart      Stop and start XAMPP"
     echo "security     Check XAMPP's security"
     echo ""
     echo "shell        Starts a new shell configured for XAMPP use."
     echo ""
     echo "Update Path at top to your installed path, path="/opt/xampp""
     echo ""
     ;;

esac
rkaralius
 
Posts: 1
Joined: 05. May 2007 04:55


Return to XAMPP for Solaris

Who is online

Users browsing this forum: No registered users and 4 guests