Solved

AnalogX SimpleServer CGI scripts won't run.

Posted on 2003-10-22
7
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
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 …
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

689 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