All I needed to do was to write this very simple Applescript:
|
|
|
I like xampp a lot, because it's a complete package. I used to configure the whole thing myself on the Mac, but it took a lot of time. Xampp, on the other hand, is just so easy to configure and install. The biggest problem I had was that Xampp has to be started manually, and this is bad because I use my Mac mini as a demo server to show my work to customers before going live. If there is a power failure and I am not around, the server won't start. After some head scratching, obfuscated further by reading too much on the net, I found an obvious and simple solution.
All I needed to do was to write this very simple Applescript: do shell script "sudo /Applications/xampp/xamppfiles/mampp start" password "YOUR ADMIN PWD" with administrator privileges
Save this as an application, put it in the Documents folder, then add it to System Preferences » Accounts » Login Items. Voila, restart you Mac, and your web pages are served.
•
[23,698 views]
Hint Options
Automatically start Xampp at login
You shouldn't need "sudo".
This should work just fine:
If you edit the sudoers file properly, though, then you shouldn't need to put your password in a file for everyone to see.
Couldn't you use launchd?
Seems like that would be a more elegant method of starting it and keeping it running.
Couldn't you use launchd?
I agree this is an ok hack to get fro point a-b and for your specific situation it might suit you perfectly but you should really read up on launchd for this and pull this hint before someone hurts themselves with it.
Couldn't you use launchd?
"this hint before someone hurts themselves with it."
Automatically start Xampp at login
Almost a year later, another way to start:
Using OS X 10.5.6 and XAMPP 1.0.1
To start XAMPP using Launchd, all you have to do is create a text file using something like TextWrangler or BBEdit in /Library/LaunchDaemons/ named:
org.apachefriends.xampp.plist
in this text file enter this text:
Set the permissions on the file to:
Owner: root Group: wheel
Owner: read+write Group: read Others: read
Restart your machine and XAMPP should start all services.
Or, you can start the launchd item with this terminal command
type in terminal:
launchctrl load /Library/LaunchDaemons/org.apachefriends.xampp.plist
This launchd item will also keep your site running, should something accidently quit or exit.
You can also use Lingon to create this LaunchD item. Use this command in Lingon to start XAMPP:
/Applications/XAMPP/xamppfiles/xampp start
Check this site for different startup command possibilities:
http://www.apachefriends.org/en/xampp-macosx.html#903
Full steps from the terminal to create this launchd item are as follows:
Open Terminal
type:
sudo -s
Enter your password (you need to be an admin)
type:
cd /Library/LaunchDeamons
type:
vi org.apachefriends.xampp.plist
hit the "i" key
paste this text in:
hit the "esc" key, then ":", then "wq" and hit return
Now type:
launchctrl load /Library/LaunchDaemons/org.apachefriends.xampp.plist
Check your XAMPP control app and you should see that they are running. Test it out by stopping apache, mysql, or ftp from the XAMPP Control. After a minute or so, it should auto start your processes and will reflect that change in the XAMPP application.
Hopefully I didn't miss anything, let me know if I did, or if you need help.
Rusty
Automatically start Xampp at login
excellent tutorial, but it's "launchctl" ;)
Automatically start Xampp at login
Under 10.6 launchd seems to object. Console reports;
14/10/2009 11:43:19 org.apachefriends.xampp[5182] XAMPP: Starting Apache... 14/10/2009 11:43:19 com.apple.launchd[1] (0x10011d740.anonymous.nohup[5197]) Bug: launchd_core_logic.c:8250 (23932):0 14/10/2009 11:43:19 com.apple.launchd[1] (0x10011d740.anonymous.nohup[5197]) Switching sessions is not allowed in the system Mach bootstrap. 14/10/2009 11:43:19 com.apple.launchd[1] (0x10011d740.anonymous.nohup[5197]) _vprocmgr_switch_to_session(): kr = 0x44c 14/10/2009 11:43:19 org.apachefriends.xampp[5182] XAMPP: [1mError 127! Couldn't start Apache![m 14/10/2009 11:43:19 org.apachefriends.xampp[5182] XAMPP: [1mStarting diagnose...[m 14/10/2009 11:43:19 org.apachefriends.xampp[5182] XAMPP: [1mSorry, I've no idea what's going wrong.[m 14/10/2009 11:43:19 org.apachefriends.xampp[5182] XAMPP: [1mPlease contact our forum http://www.apachefriends.org/f/[m 14/10/2009 11:43:19 org.apachefriends.xampp[5182] XAMPP: XAMPP-MySQL is already running. 14/10/2009 11:43:19 org.apachefriends.xampp[5182] XAMPP: XAMPP-ProFTPD is already running. 14/10/2009 11:43:19 org.apachefriends.xampp[5182] XAMPP for MacOS X started.
Automatically start Xampp at login
FWIW, I finally got both XAMPP apache and XAMPP mysql installs to run automatically on start up (I'm using OS 10.5.8 Leopard). These two posts set me in the right direction (very grateful to original posters!): http://hints.macworld.com/article.php?story=20080128103022907 ANDhttp://hunterford.me/mysql-startup-item-for-mac-os-x/ To start Xampp's Apache Server, I created the following daemon (this .plist file should be placed in the Library/LaunchDaemons/ folder):
To start Xampp's mysql install, I created the following daemon (again place this .plist file in the Library/LaunchDaemons folder):
This information was very difficult to locate for some reason. I hope it saves someone a lot of wasted time! ;) |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.82 seconds |
|