When I needed to do this, I wrote out a "restart request" file in a 
certain directory.  Then had a job run from crontab every 1 or 5 minutes 
or whatever, that if it found a restart request file, it would (as root) 
restart the webserver, and remove the restart request file.

I think you may have problems trying to restart apache using the user 
apache runs as, but I'm not really sure how OSX compares to Linux on that.

-Ryan


Douglas Hyde wrote:
> I am new to CFEXECUTE. I am trying to use cfexecute to restart apache2.2 on
> max OSX (unix file structure) when a new virtual host is added or when the
> aliases are updated within a host (eg, new directories are added that must
> be aliased). Apache doesn't recognize these changes until restart. So I have
> written code to add the new virtual host/alias settings in the vhosts
> directory of apache - this is working fine. My challenge is getting
> cfexecute to restart apache in order to pick up the new configurations. Here
> is what I have tried:
>
> <!---now set absolute path to a file on the web server to reboot--->
> <cfset script_path = "/Library/Apache2/bin/apachectl">
> <!---now set arguments--->
> <cfset script_arguments = "restart">
> <!---now set absolute path to a file on the web server to act as a log;
> something like--->
> <cfset script_log = "/Library/WebServer/Documents/script_log.txt">
> <cfexecute name="#script_path#" arguments="#script_arguments#"
> outputfile="#script_log#"></cfexecute>
>
> So, it looks like apache is restarting - the problem I am having is that it
> tries to spit out the file that the cfexecute is contained in, rather than
> writing to the file in outputfile. I have manually created the
> "script_log.txt" in the target directory, and have set permissions to allow
> the file to be overwritten. But nonetheless, a window pops up asking me to
> download the file that the cfexecute command is contained in. I have also
> tried switching from outputfile to variable, and then dumping the variable
> to a file, but I still have the same problem. To be frank, I really don't
> need the file, its just a behaviour of cfexecute I need to manage. Any
> thoughts on why it dumps? I thought of wrapping the cfexecute in
> cfsavecontent, but don't think I should have to.
>
> Cheers,
> Doug



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289494
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to