Solved

AnalogX SimpleServer CGI scripts won't run.

Posted on 2003-10-22
7
251 Views
Last Modified: 2013-12-25
...I've put my perl scripts in cgi-bin, but I get a Server Error (500) when I try to run them through a browser. SimpleServer automatically sets cgi-bin to be the CGI folder. When I run the script from the command prompt, it runs just as it should. I'm running XP Pro, and wondering:

Is "#!C:/Perl/Bin/" sufficient to let the server know what to do?
Do I need to change permissions for the folder or script?

The documentation says that simpleserver supports CGI, so what might I be doing wrong?
Thanks...
0
Comment
Question by:juicemonger
  • 4
  • 2
7 Comments
 
LVL 8

Accepted Solution

by:
inq123 earned 125 total points
ID: 9600362
Hi juicemonger,

I would think "#!c:/perl/bin/perl" is needed.  You do need to allow script to run for that CGI folder and probably allow www/web server user read&execute on your NTFS permission setting.  You also really want to check the server log for SimpleServer to see what exactly was the problem the server complained about.

Cheers!
0
 

Author Comment

by:juicemonger
ID: 9601390
I feel like I've tried just about everything.

#!C:/Perl/bin/perl
#!C:/Perl/bin/perl.exe
#!C:/Perl/bin
#!C:/Perl/bin/
#!C:/Perl/Bin

Whatever. I keep getting Server Errors. (500). Has anyone every used SimpleServer before? AnalogX.com claims that it has a log, but I haven't been able to find it. I've put my perl script in the same cgi-bin directory as an executable that AnalogX provides for vote counting. The .EXE works. My .PL does not. I've compared their permissions and they look fine. How do I set permissions for www/web in XP Pro? (I've looked all through the security settings and haven't seen a "www" anywhere.)
0
 
LVL 8

Expert Comment

by:inq123
ID: 9601890
in your XP Pro if you allow "everyone" read&execute on cgi directory then it's good enough.  I've never used SimpleServer, and I would hate a server without a log file.  Exe works but not pl means executables are allowed to run but scripts are not (like in IIS or PWS you can enable "execute" and/or "script", each in charge of executable or perl scripts for example, so these settings might be separate in your server too).  An alternative explanation is that your server somehow still did not know how to handle directives (#! line) in your perl script to find the perl.exe to launch the interpreter.  One possibility is to see if there's a ISAPI perl plug in for that server?  Chance is very small though.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 1

Expert Comment

by:robysath
ID: 9634876
I have used SimpleServer before. I don't remember if I ran cgi scripts on it tho. However, I recall something along the lines of naming your scripts .cgi and NOT .pl for them to work (maybe this was another web server i've tried).

You might want to make sure the first line you output to the browser is:
print "Content-type: text/html\n\n";

The directive didn't matter (I don't think) I used unix scripts that had:
#!/usr/local/bin/perl
and I think they still ran fine... could have been a different webserver tho that I had this on.

But try the above suggestions anyway, good luck.
0
 
LVL 8

Expert Comment

by:inq123
ID: 9634894
>The directive didn't matter (I don't think) I used unix scripts that had:
>#!/usr/local/bin/perl
>and I think they still ran fine

That would only happen when perl is not running in cgi mode (instead it's running in mod_perl mode), I think.  So there really is ISAPI or apache like Perl module for SimpleServer?  Are you sure?  I'm just curious.
0
 

Author Comment

by:juicemonger
ID: 9644522
robysath, I tried changing the file extensions, but it didn't work.

inq123, you're probably right about SimpleServer lacking a Perl module.

Whatever. I've ended up just using c++, which I probably would have needed eventually anyway to receive a response on the serial port...
0
 
LVL 8

Expert Comment

by:inq123
ID: 9644680
Thanks for the points!  Wish I could've been of more help, but anyway best wishes for your new approach!
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question