I am trying to get Apache2.4 to run compiled fastcgi programs on an Ubuntu 14.04-based system. I am using mod_fastcgi and am getting the errors
FastCGI: can't start server "/var/www/fcgi/fhello.fcgi" (pid 29037), execle() failed: Permission denied
[Sun Jun 14 14:16:23.322632 2015] [:warn] [pid 29022] FastCGI: server "/var/www/fcgi/fhello.fcgi" (pid 29037) terminated by calling exit with status '255'
my apache config block looks like
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
FastCgiWrapper /var/lib/apache2/fastcgi
FastCgiServer /var/www/fcgi/fhello.fcgi -socket /var/www/fcgi/fhello.sock -user www-data -group www-data
ScriptAlias /fhello "/var/www/fcgi/fhello.fcgi"
<Directory /var/www/fgci>
Require all granted
Options ExecCGI
</Directory>
</IfModule>
if it helps the fhello code is
#include "fcgi_stdio.h" /* fcgi library; put it first*/
#include <stdlib.h>
int count;
void initialize(void) {
count=0;
}
int main(void) {
/* Initialization. */
initialize();
/* Response loop. */
while (FCGI_Accept() >= 0) {
printf("Content-type: text/html\r\n"
"\r\n"
"<title>FastCGI Hello! (C, fcgi_stdio library)</title>"
"<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>"
"Request number %d running on host <i>%s</i>\n",
++count, getenv("SERVER_HOSTNAME"));
}
return 0;
}
www-data owns and has exec rights to the program, and has write permissions to the fcgi dir for the sock file. This is my first time setting up anything to run as fastcgi besides perl forever ago and I seem to be lacking in the google-fu to find effective information on this subject.
If anyone can point out what I am doing wrong or what I have missed, please do so.