Turnkey LAMP and CGI

johan.klinge's picture

Hi,

I'm a newbie to Turnkey and have just set up LAMP as a virtual development environment for a website I support. Everything works great, except that the website uses cgi programs and I want to configure LAMP to run them. The cgi scripts are in directory /var/www/SITENAME/privat.  

Reading some other posts on the forum I changed the configuration for the default apache site to:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
 DocumentRoot /var/www/
 <Directory "/var/www/SITENAME/privat/">
  Options +ExecCGI
  AddHandler cgi-script .cgi
 </Directory>
LogLevel error
</VirtualHost>

But when running cgi script from the browser I get a 500 Internal Server Error and the apache logs says:

[error] [client IP] (2)No such file or directory: exec of '/var/www/SITENAME/privat/index.cgi' failed, referer: http://IP/SITENAME/
[Mon Feb 08 10:20:18 2010]
[error] [client IP] Premature end of script headers: index.cgi, referer: http://IP/SITENAME/

Any suggestions as to what I'm doing wrong would be appreciated.

Regards, /Johan

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options