Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lighttpd with cgi-bin apps does not work for me
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
awx
n00b
n00b


Joined: 26 Jan 2005
Posts: 51

PostPosted: Mon Feb 27, 2006 2:45 pm    Post subject: lighttpd with cgi-bin apps does not work for me Reply with quote

I hope someone here can help me with this problem. I don't know a whole lot about cgi-bin stuff or lightttpd so there's probably an easy answer to this, but....

I want to run apcupsd and cgiirc using lighttpd as the web server but this doesn't work. FYI, phpsysinfo does work fine thru lighttpd with php 5.0.5 though it is not a cgi-bin app.

The history here is this:
  • I had apache2 installed, it worked.
  • Installed apcupsd and it worked with apache2.
  • Installed lighttpd and switched from apache2 to it, apcupsd stopped working (the web part only).
  • Removed apache2 and all dependencies.
  • installed cgiirc and it does not work


By "not working", I mean the URL that worked when apache2 was running (for instance http://arts-antec/apcupsd/) now returns a 404 error with lighttpd. I've tried calling the files directly but that hasn't worked either, (calling http://arts-antec/apcupsd/multimon.cgi results in a 403 error).

Lighttpd was installed with +fastcgi but I'm not really sure what is best. This server is only rarely used by me so performance is not important. I could remove fastcgi if it would help.

Things that I have tried:
  • searching the Gentoo forums
  • editting /etc/vhosts/webapp-config to specify lighttpd as server
  • remerging cgiirc
  • looking through lighttpd config files for something relating to my problem (including the mod_cgi and mod_fastcgi configs but I don't have any idea what should be in those).


What can I do to get these two apps working?
Back to top
View user's profile Send private message
awx
n00b
n00b


Joined: 26 Jan 2005
Posts: 51

PostPosted: Wed Mar 01, 2006 9:58 pm    Post subject: Reply with quote

anyone? any ideas of things to try?
Back to top
View user's profile Send private message
tutaepaki
Apprentice
Apprentice


Joined: 11 Nov 2003
Posts: 279
Location: New Zealand

PostPosted: Wed Mar 01, 2006 10:05 pm    Post subject: Reply with quote

Have you tried a simple cgi script like printenv.cgi in the cgi directory to see if that works? The will either eliminate, or confirm lighthttpd as the source of the problem.
Back to top
View user's profile Send private message
awx
n00b
n00b


Joined: 26 Jan 2005
Posts: 51

PostPosted: Wed Mar 01, 2006 10:13 pm    Post subject: Reply with quote

I don't have any cgi by that name. If it matters, I no longer have gentoo-webroot-default (or whatever it's name is) installed. Where can I get this cgi?

My /var/www/localhost/cgi-bin/ dir only contains a "cgiirc-0.5.7" directory.
Back to top
View user's profile Send private message
tutaepaki
Apprentice
Apprentice


Joined: 11 Nov 2003
Posts: 279
Location: New Zealand

PostPosted: Wed Mar 01, 2006 10:32 pm    Post subject: Reply with quote

It doesn't have to be that one in particular. Try something like:
Code:
#!/usr/bin/perl
#
print "Content-type: text/html\n\n";
print "<html><head><title>A test cgi</title></head>\n";
print "<body><h1 align=\"center\">A test cgi</h1>\n";
print "<h2>This is a test page to see if lighthttpd does CGIok</h2>\n";
print "</body></html>\n";

exit;


Did you change the "server.document.root" parm? By default, it's set to /var/www/localhost/htdocs. So you won't be able to access any cgi in /var/www/localhost/cgi-bin. (you'll get a 404)
Back to top
View user's profile Send private message
awx
n00b
n00b


Joined: 26 Jan 2005
Posts: 51

PostPosted: Wed Mar 01, 2006 10:43 pm    Post subject: Reply with quote

No, I did not change the root pref in lighttpd.

I copied that HTML code into a new doc with nano and saved it to /var/www/localhost/cgi-bin/text.cgi and it can be accessed from this URL "http://arts-kurobox/cgi-bin/test.cgi". So it is working.

Also, apcupsd does not put it's files in /var/www/localhost/cgi-bin. Instead, they are in /var/www/localhost/htdocs/apcupsd/ as 4 xxx.cgi files. cgiirc is in cgi-bin but it also put an empty folder in htdocs with only two .webapp files.
Back to top
View user's profile Send private message
awx
n00b
n00b


Joined: 26 Jan 2005
Posts: 51

PostPosted: Wed Mar 01, 2006 10:53 pm    Post subject: Reply with quote

Ahh, I am able to call cgi-irc with this URL http://arts-kurobox/cgi-bin/cgiirc-0.5.7/irc.cgi

But will I have to hardcode the version number into my URL like that? Is that what's intended?

apcupsd still cannot be called, either with the old URL which worked with apache nor by calling the .cgi files directly.
Back to top
View user's profile Send private message
tutaepaki
Apprentice
Apprentice


Joined: 11 Nov 2003
Posts: 279
Location: New Zealand

PostPosted: Wed Mar 01, 2006 11:30 pm    Post subject: Reply with quote

You could either create an index page with links to the pathname with the version in it, or create a symbolic link in the cgi bin directory. Call it something like cgiirc and link it to the real directory.

It looks like your docroot is set to /var/www/localhost, so you should specify /htdocs/apcupsd/xxxx.cgi to access the apcupsd cgi scripts.
Back to top
View user's profile Send private message
awx
n00b
n00b


Joined: 26 Jan 2005
Posts: 51

PostPosted: Wed Mar 01, 2006 11:31 pm    Post subject: Reply with quote

tutaepaki wrote:
It looks like your docroot is set to /var/www/localhost, so you should specify /htdocs/apcupsd/xxxx.cgi to access the apcupsd cgi scripts.

But that doesn't work. :(
Back to top
View user's profile Send private message
tutaepaki
Apprentice
Apprentice


Joined: 11 Nov 2003
Posts: 279
Location: New Zealand

PostPosted: Thu Mar 02, 2006 7:39 pm    Post subject: Reply with quote

Possibly it could be permissions on the directories/files? The ID your lighthttpd server runs as will need read/execute on the apcupsd dirs & files.
Back to top
View user's profile Send private message
awx
n00b
n00b


Joined: 26 Jan 2005
Posts: 51

PostPosted: Thu Mar 02, 2006 7:41 pm    Post subject: Reply with quote

tutaepaki wrote:
Possibly it could be permissions on the directories/files? The ID your lighthttpd server runs as will need read/execute on the apcupsd dirs & files.

I believe they are correct but I will double check.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum