You are not logged in.
I installed lighttdp and fcgi following the wiki without editing any configuration file. However my cgi app does not run when I go to http://localhost/app.fcgi Instead it downloads the file. What should I do?
Last edited by costis (2014-11-12 03:53:13)
Offline
Did the lighttdp testpage work? What do you mean you didn't edit any configuration files? The wiki directs you to configuration files that you are expected to edit: if you didn't edit them, I wouldn't expect it to work.
Please describe what you have actually done.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Apologies for my incomplete post.
I receive these:
$ cat /var/log/lighttpd/error.log
2014-11-12 02:10:07: (log.c.164) server started
2014-11-12 02:10:07: (mod_fastcgi.c.1112) the fastcgi-backend /srv/http/index.py failed to start:
2014-11-12 02:10:07: (mod_fastcgi.c.1116) child exited with status 2 /srv/http/index.py
2014-11-12 02:10:07: (mod_fastcgi.c.1119) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2014-11-12 02:10:07: (mod_fastcgi.c.1406) [ERROR]: spawning fcgi failed.
2014-11-12 02:10:07: (server.c.1022) Configuration of plugins failed. Going down.
I followed again the instruction doing exactly these:
su
pacman -S lighttpd fcgi
mkdir /etc/lighttpd/conf.d
cp /usr/share/doc/lighttpd/config/conf.d/fastcgi.conf /etc/lighttpd/conf.d
systemctl start lighttpd
and following this post I appended to /etc/lighttpd/conf.d/fastcgi.conf these lines:
fastcgi.server = ( "/" =>
((
"socket" => "/tmp/fastcgi.socket",
"bin-path" => "/srv/http/index.py",
"max-procs" => 1,
"bin-environment" => (
"REAL_SCRIPT_NAME" => ""
),
"check-local" => "disable"
))
)
The test page works, the error.log does not show any error messages, but not my .fcgi script does not run Instead when I go to http://localhost/script.fcgi it downloads it
Last edited by costis (2014-11-12 02:32:54)
Offline
Thanks, that's clearer. I've never used this myself in arch, but it looks like you skipped this section of the wiki:
https://wiki.archlinux.org/index.php/Lighttpd#CGI
You need to first set up (regular) cgi before fcgi.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks for the reply, this is good to know. Now it seems to work. I had to rename my file from http://localhost/script.fcgi to http://localhost/script.cgi and it seems to work somehow. Thanks!
# cat /etc/lighttpd/lighttpd.conf
# This is a minimal example config
# See /usr/share/doc/lighttpd
# and http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions
server.port = 80
server.username = "http"
server.groupname = "http"
server.document-root = "/srv/http"
server.errorlog = "/var/log/lighttpd/error.log"
dir-listing.activate = "enable"
index-file.names = ( "index.html" )
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".css" => "text/css",
".js" => "application/x-javascript",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".png" => "image/png",
"" => "application/octet-stream"
)
include "conf.d/cgi.conf"
#include "conf.d/fastcgi.conf"
# cat /etc/lighttpd/conf.d/cgi.conf
server.modules += ( "mod_cgi" )
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".rb" => "/usr/bin/ruby",
".erb" => "/usr/bin/eruby",
".py" => "/usr/bin/python",
".php" => "/usr/bin/php-cgi" )
index-file.names += ( "index.pl", "default.pl",
"index.rb", "default.rb",
"index.erb", "default.erb",
"index.py", "default.py",
"index.php", "default.php" )
Last edited by costis (2014-11-12 03:52:20)
Offline
Thanks, that's clearer. I've never used this myself in arch, but it looks like you skipped this section of the wiki:
https://wiki.archlinux.org/index.php/Lighttpd#CGIYou need to first set up (regular) cgi before fcgi.
Hmm. That section of the wiki may be incorrect. I've set up FCGI in the past without touching CGI or installing any additional packages. You can see approximately what my FCGI configuration has looked like here.
Offline