start xampp at boot

Joined
Jun 12, 2008
Messages
14
Reaction score
0
Points
1
Hi,

I am running xampp for Mac on my dev machine. I like it a lot because of its easy setup but I have a problem- I can't get xampp to start at boot, which is bad because I use my mac as a demo server to show my web design to my clients. My Mac is set to reboot automatically after a power failure, unlike to web server comes with OS X, xampp won't restart without my intervention.

I wrote a shell script to start xampp, but it requires sudo which requires the root password. then I use AppleScript to start the shell script like this:

do shell script "sudo ./Desktop/xamppBash"

Once I run the AppleScript, the Terminal comes up, waiting for a password, here is where I get stuck. :( Does anyone know how I can use AppleScript to enter the password? or better yet, can someone also tell me a easier way to start xampp at boot? It's driving me CRAZY :Shouting:

Thanks in advance.

BTW, My Mac is a G4 mini
 
Joined
Nov 28, 2007
Messages
25,564
Reaction score
486
Points
83
Location
Blue Mountains NSW Australia
Your Mac's Specs
Silver M1 iMac 512/16/8/8 macOS 11.6
You do not give OS but if using Leopard, or Tiger, have you tried going to User>Log In Items and see if you can select it there.
 
OP
M
Joined
Jun 12, 2008
Messages
14
Reaction score
0
Points
1
You do not give OS but if using Leopard, or Tiger, have you tried going to User>Log In Items and see if you can select it there.

My bad. It's Tiger 10.4.11. Hum, I don't think there is User>Log In Items. :(
 
OP
M
Joined
Jun 12, 2008
Messages
14
Reaction score
0
Points
1
Since I got no help, here I answered my own question. In case someone else has the same question, here it is.

It's so simple and obvious. Open Script editor, type in this line:

do shell script "sudo /Applications/xampp/xamppfiles/mampp start" password "YOUR ADMIN PWD" with administrator privileges

Save it as an application. Go to System Preferences->Account->Login items, add this app to the list. Voila, once you reboot, Your xampp is served.

It works on both my Mac Tiger 10.4.11 and Leopard 10.5.3.
 
Joined
Mar 24, 2009
Messages
1
Reaction score
0
Points
1
Thanks for this - exactly what I was looking for.

But I wish there was a way to not have my admin password saved on my machine like that. Any ideas?
 
Joined
May 6, 2009
Messages
1
Reaction score
0
Points
1
use lingon

There are actually two problems with the previous recommendations. 1) they require you store and update your admin password in cleartext form on the machine
2) They require you to log in.

If you want to set up custom scripts that run when your computer boots, I would recommend an application called Lingon. I use it on Leopard 10.5.6, but presumably it works on Tiger as well.

Open Lingon, Click the new plus sign -> New User Daemon, call it whatever you want under "What" put:

/Applications/xampp/xamppfiles/xampp start

(no need to use sudo, it will already run with god powers). Now enable it and restart your machine. If you look in your process tree, you should see xampp running as root.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top