Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Applescript to start Apache.

Applescript to start Apache.
Thread Tools
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Nov 20, 2005, 09:42 PM
 
Hello all,

I have never gotten into applescripts, but now I need one, and I'm not too sure where to begin.

I have a server set up here at home, and from it I serve several personal sites. In a few weeks I will be out of town on business, and will sending people to my site(s). I plan on leaving the sever running, but in the event of a power outage, I need an applescript that restarts apache and webmin via terminal once the machine reboots.

I installed a newer version of apache in a different location, so the system prefs option doesn't work for me.

The 2 commands I need to run are:

/etc/webmin/start

and

/usr/local/apache2/bin/apachectl start

I also assume the whole thing would need to begin with a sudo su

Can anyone offer up some tips?

Thanks,

-j
     
Dedicated MacNNer
Join Date: May 2001
Location: Ze goggles, zey do nothing
Status: Offline
Reply With Quote
Nov 20, 2005, 10:44 PM
 
http://www.applescript.net/

That is a great place to surf for Applescript tips.

You can invoke shell scripts via this command:

Code:
do shell script "scriptname"

You can then save it as a script and put it into you scripts folder and it will be accessible from the menubar.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:55 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2