Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

AnalogX SimpleServer CGI scripts won't run.

Posted on 2003-10-22
7
Medium Priority
?
276 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 375 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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

783 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