Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cgi Scrpits and Windows Srver 2003 and IIS 6.0

Posted on 2004-10-25
20
Medium Priority
?
304 Views
Last Modified: 2013-11-18
I am running Windows Server 2003, with Active Perl 5.8.3. A customer has a "cgi" script that is not running properly. The exact error can be seen at http://www.broadwaydental.ca/post6.htm , when you fill out the form. I have tried placing the proper permissions all over the place to try to get this working, but alas no results. The same error message comes up everytime. Has anyone seen this mess before? Help?!

Forbidden
You don't have permission to access /post.cgi on this server.

Thanks in advance.
Don
0
Comment
Question by:donlizard
[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
  • 10
  • 8
  • 2
20 Comments
 
LVL 6

Expert Comment

by:nihlcat
ID: 12402754
You know, the error it spits out is a different website.  Can you shed any light on that?

Forbidden
You don't have permission to access /post.cgi on this server.


--------------------------------------------------------------------------------

Apache/1.3.27 Server at www.appraisers.com Port 80
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12402933
Just cusious, did the permissions set to on the script, or the cgi-bin?
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12403063
Um, ignore that last question, my mind is in Apache...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:donlizard
ID: 12403209
Hi,

Yes I noticed that the errorr message  points to another site, which is curious. I have looked at the code and there is no mention of that other site in the code.... strange. Here is the code for the post.cgi, maybe I'm blacking out and missed something.

Thanks,
Don

*copyrighted material removed by Netminder 17 Feb 2008*
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12403412
Ok, what this tells me right off the bat is that you are invoking Perl from SOMEONE's UNIX based server:
#!/usr/local/bin/perl

Nothing special about that, but all of the $ variables in the above program are probably defined in a config file on the same UNIX server you are calling PERL from.  Probably in /var/www/html/cgi-bin.  If this is one of your servers, set the permissions on Post.cgi to RWX,RX,RX (755), and see how it goes.

If you don't own any UNIX servers then I'm lost.  The mail app that executes post.cgi needs to be in your Scripts under Inetpub directory, and configured to run there.  This assumes you already have Perl installed and configured.

Basically, what it looks like is that when you hit 'send', you are trying to get another server mail app to send mail for you.  
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12403557
Something else just occured to me.  I am making the assumption that the above script has associated config files (in UNIX they almost always do).  It appears that one of these config files has an incorrect URL in it as well (www.appraisers.com).  I have installed one or two of these mail scripts in the past, can you check the config file that works with the script above for the correct paths to cgi-bin, and the correct URL?
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12403829
Sorry for being such a prolific writer, but it helps me get my head around problems sometimes.  Here's what I understand:

You are running windows 2003 with IIS6 and Active Perl (no UNIX servers).
You have a Perl script and you want to run it on the 2003 server.

From that I can tell you that the file Post.cgi just won't run, because the first line of the script
(#!/usr/local/bin/perl) is the default location of Perl in UNIX, not Windows, so that needs to be fixed.
I'm sure you've already been to this site, but here are important areas you need to review to get this running:

http://aspn.activestate.com/ASPN/docs/ActivePerl/faq/Windows/ActivePerl-Winfaq6.html#How_do_I_configure_IIS_6
http://aspn.activestate.com/ASPN/docs/ActivePerl/faq/Windows/ActivePerl-Winfaq4.html
0
 
LVL 1

Author Comment

by:donlizard
ID: 12404096
Hi nihlcat,

I noticed that line at the top also, but if the # is in front of the line doesn't that mean that that line is remarked out and not active? Oh by the way I didn't code this mess I'm trying too just get it going. Seems like a head scratcher. I also checked one other cgi file in the directory, and it doesn't seem to point to anywhere else either. This is going to drive me to drink, and it's a short drive!!

Don
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12404169
No, no, that's a UNIX character #!, called a 'shebang' and it's not a windows 'ignore this', in UNIX it means something totally different.  That first line of the script is meant to tell UNIX "this is not machine code, this is a script, run it from this UNIX directory."

So you can see the problem we have to work with here.  Well, must you use this Perl script on you site?
0
 
LVL 1

Author Comment

by:donlizard
ID: 12404291
It's the one that was uploaded, and they thought that the person who did the scripting had it working the whole time. Now this guy doesn't exist anymore, so it seems up to me to get it working. I love my job...I love my job...I love my job...I love my job.. yea that's it!
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12404358
I very seriously doubt it was ever working configured that way.  Ok, well, what prevents you from building a form that executes the SMTP engine built into IIS6?
0
 
LVL 1

Author Comment

by:donlizard
ID: 12404418
I completely agree that this may never have worked properly. I suppose that a person could write new scripting in either asp or php to get this working properly, but I think the original idea was to send an e-mail and being able to view the greeting card online somewhere. I think that seems like the idea.

Don.
0
 
LVL 6

Accepted Solution

by:
nihlcat earned 750 total points
ID: 12404539
Ah, I see.  well, I don't mean to poo on your script, but even if it were running I'm think it's a nifty way to get steal e-mail.  Have a look, you can write anything you like in the to and from fields.  Anyway, moving forward, it's going to take some effort to get it running with ActivePerl.  It can still be done, but you'll need to follow those links and convince Windows via file association that a .pl or .cgi is an actual executeable.  Otherwise, (and my personal recommendation) you should try and build a form from the native mail prog in IIS.

Sorry I wasn't able to help you more! :(
0
 
LVL 1

Author Comment

by:donlizard
ID: 12404586
Thanks for all your help! I went to those links you suggested, and I already had the server setup properly to do that sort of scripting. I'm going to try a couple of other pathing things I have found to see if I can point it to the proper files and or server.

Don
0
 
LVL 1

Author Comment

by:donlizard
ID: 12404847
I'm getting closer I think! I noticed in the coding that everything was pointing to http://www.broadwaydental.com, the actual site is http://www.broadwaydental.ca!. The other server error message has disappeared! I think I just need to point the scripting to the proper directory on my Windows Server 2003 where the ]Perl is and it may go. But sso far antything I put in there hasn't worked yet. Hmmmmmm....

Don
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12405982
Ok yeah, what I'm seeing it this:
*******************************
The page cannot be displayed
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
--------------------------------------------------------------------------------

Please try the following:

Contact the Web site administrator if you believe that this request should be allowed.
Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
HTTP Error 405 - The HTTP verb used to access this page is not allowed.
Internet Information Services (IIS)
***********************************
Would that have to do with Get or Post in the form?  Sure sounds like it...
0
 
LVL 7

Expert Comment

by:corneliup
ID: 12408545
W2K3 comes fully "locked down", meaning that only the basic files and scripts are authorized by default. To allow Perl scripts to be served via the web, you'll need run the IIS 6 admin console, right-mouse click on Web Service Extensions, and select "Add a new web service extension". Enter a name like "Perl CGI Scripts" for the description and click "Add" to add the required Perl files. Then enter the following verbatim (including the double-quotes, which are very important)

  c:\Perl\bin\perl.exe "%s" %s

This assumes that you have installed Perl in C:\Perl. If it's in another directory, change the path above. After this, click "Set extension status to Allowed" and then OK. You'll now see Perl CGI Scripts as an allowable CGI extension.

0
 
LVL 1

Author Comment

by:donlizard
ID: 12427259
I have renamed the .cgi pages to .pl and have already enabled Perl/CGI scripts to run. Then repathed the scripts to reflect where the executables and etc are. The scripts are now starting to run except for one thing. The script uses "sendmail.exe" to send out the messages. Servers used to use that exe on older Windows NT 4.0 machines, but I think the world has moved on to different exe's to use. That executable seems to hang then time out before it actually sends anything out. I'm thinking that that exe cannnot run properly under Windows Server 2003. Any comments on this?

Don
0
 
LVL 7

Assisted Solution

by:corneliup
corneliup earned 750 total points
ID: 12430963
The "clean" and secure way to send mail from iis6 on win2k3 is to use .asp
here is a good tutorial on how to do this:
Send Email Using ASP on .Net Server or WinXP Pro
http://www.sitepoint.com/article/asp-net-server-winxp-pro

And here is a tutorial on how to do it with perl:
Programming Perl 101
3) Sending email with Perl

http://www.sitepoint.com/article/programming-perl-101/7

0
 
LVL 1

Author Comment

by:donlizard
ID: 12501828
Thanks for all the help.

Don
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

609 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