Solved

AnalogX SimpleServer CGI scripts won't run.

Posted on 2003-10-22
7
238 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now