Aug 032009
 

While I was trying to allow some tool’s PHP file to perform the HTTP command PUT, the tool’s manual said to put the following code in the httpd.conf Apache configuration file:

<Directory /foo/bar>
Script PUT /some.php
</Directory>

And so I did. But when I tried to reload Apache’s configuration (/etc/init.d/apache2 reload), Apache complained with the following message:

Invalid command ‘Script’, perhaps misspelled or defined by a module not included in the server configuration
failed!

At this point in time, Google didn’t have any results for the error string, and this is why I am actually writing this blog entry.

Searching for Apache2’s directive Script got me to this Apache doc where you can see that the directive Script is part of the module mod_actions.
As already mentioned in the error message, a module was not included, now I knew that it would probably be the mod_actions module. Enabling the module by symlinking it from mods-enabled to mods-available made the error message disappear and everything working just fine:

ln -s /etc/apache2/mods-available/actions.load /etc/apache2/mods-enabled/actions.load
ln -s /etc/apache2/mods-available/actions.conf /etc/apache2/mods-enabled/actions.conf

Hope this helps to offer a quick solution for the error message.

Btw, while looking for fixes, I stumpled across this page, which offers further information about how to use Apache’s Script directive.

  2 Responses to “Invalid command ‘Script’ in Apache configuration”

  1. Thanks for bringing this to my attention, Gabriel. I often get the “ln” argument order wrong 🙂
    I updated the post, it is correct now.

  2. Thanks for the tip!
    You may want to change the order of the parameters for the ln commands, though.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

*