Solved

AnalogX SimpleServer CGI scripts won't run.

Posted on 2003-10-22
7
243 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PowerShell Get-Help 10 68
How can I do this in Pyhton? 12 117
Run command in each subfolder using batch file 7 51
Chocolatey under PowerShell is not working properly 3 47
Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

863 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

21 Experts available now in Live!

Get 1:1 Help Now