View Full Version : Problem with ssi
I have a question. I am running a poll(voting) script on my site using ssi on an .shtml page with the following line:
"<!--#include virtual="/cgi-bin/poll/pollSSI.cgi" -->
The poll displays fine on the page but when I try to vote it gives me an error page with the following message:
"Method Not Allowed
The requested method POST is not allowed for the URL /Main.shtml."
Please help!
Thanks in advance!
YvetteKuhns
7-2-07, 10:03 AM
Is this in your htaccess file:
Options Includes
AddType text/html shtml
AddHandler server-parsed shtml
<!--#include virtual="/cgi-bin/poll/pollSSI.cgi" -->
Is Main.shtml in your htdocs folder? Is your cgi-bin inside your htdocs folder? Did you try editing this line to:
<!--#include virtual="cgi-bin/poll/pollSSI.cgi" -->
or the full URL?
Does the script run when using the full URL?
I know is hard to believe but I have not worked on this site (or any) for a couple of years and I don't have a .htaccess file yet. How do I create one? Please don't kill me!:confused:
Croc Hunter
7-3-07, 04:45 AM
Highlight and copy Yevette's 3 lines of code. Log into OPS> Services> Site Tools> .htaccess and select "Direct Editor". Paste the 3 lines in the box and click save.
Another way is to use a simple text editor like Notepad or Wordpad. Enter your code, save the file as htaccess.txt upload it into your htdocs and rename it to .htaccess on the server.
Actually, since you are using the .shtml extension you do not need the .htaccess code.
Make sure the script is Chmod to 755.
You may need to edit the cgi script to allow your Main.shtml page to use the Post command.
YvetteKuhns
7-3-07, 09:11 AM
Actually, since you are using the .shtml extension you do not need the .htaccess code.
You shouldn't, but I suggested the code in case you might in some situations.
Make sure the script is Chmod to 755.
I forgot to mention that, but I did ask if the script worked when typing the full URL.
You may need to edit the cgi script to allow your Main.shtml page to use the Post command.
I thought of that, too. I was waiting to see if the script could run when typing the full URL. ;)
When I create the .htaccess file with those three lines of code the poll does not appear on my .shtml file. Instead I get this error message:
[an error occurred while processing this directive]
The script seems to run fine when I call typing the full url.
...."You may need to edit the cgi script to allow your Main.shtml page to use the Post command."
How do I do that?
Chmod is already set at 755.
YvetteKuhns
7-4-07, 09:11 AM
Did you try using php instead of the virtual includes?
<? readfile("cgi-bin/poll/pollSSI.cgi"); ?>
YvetteKuhns
7-4-07, 09:17 AM
Make sure the script is Chmod to 755.
If that doesn't work, try 777.
I read on another post just this AM that PowWeb doesn't like 777 and defaults it to 755. But I may be mistaken as it's early and the coffee is just kicking in.
You read it - I posted it - and the information was based upon my memory of something stated a long time ago. I've not read anywhere that it has changed.
I knew those words of wisdom came from a wise sage. :D
YvetteKuhns
7-4-07, 12:07 PM
I think they now allow 777 and other less secure settings. We usually recommend 755. I don't know the script being used, so I don't know what it needs.
I have one website hosted on PowWeb that has shtml pages and php includes. I have other sites with other combinations, but I don't have shtml pages with cgi includes. Normally, the virtual line works for other scripts, but cgi is known to cause problems.
Years ago, I had a similar situation on the old PowWeb. I changed the cgi extension to pl and it worked. You could try that, but I think that calling the script through php would be more successful if the other things did not work.
Croc Hunter
7-4-07, 11:47 PM
Yevette is right, 777 is now allowed. However I strongly discourage anyone leaving and file or folder at 777. It is a huge security risk. If 755 doesn't work, the script is crap and I wouldn't use it.
The php code didn't work either.
I've also tried this:
<!--#exec cgi="cgi-bin/poll/pollSSI.cgi" -->
...with no good results.:o
Chmod to 777 does no good either...:confused:
<? readfile("cgi-bin/poll/pollSSI.cgi"); ?>
will not work.
You need to do a full http include or readfile to make a php script run another script.
eg <? include( "http://yoursite.tld/cgi-bin/pollSSI.cgi") ?>
YvetteKuhns
7-5-07, 09:45 AM
You need to do a full http include or readfile to make a php script run another script.
eg <? include( "http://yoursite.tld/cgi-bin/pollSSI.cgi") ?>
Oops, thanks for catching that. I copied the wrong line! I actually have the php includes line like this in a website hosted elsewhere, but it should work here.
However I strongly discourage anyone leaving and file or folder at 777. It is a huge security risk. If 755 doesn't work, the script is crap and I wouldn't use it.
I wouldn't want to use 777, either. But for testing purposes, you can see if it is the includes or the script that is the problem.
<? readfile("cgi-bin/poll/pollSSI.cgi"); ?>
will not work.
You need to do a full http include or readfile to make a php script run another script.
eg <? include( "http://yoursite.tld/cgi-bin/pollSSI.cgi") ?>
this still doesn't work. The poll wont even appear on the shtml file with this one.
I've tried all you guys have suggested and.. nothing. I had this same script running some time ago and it was never hard to install. Maybe powweb changed something.
I think there's something missing. Maybe code in the head of the shtml file where I want the poll.. i don't know.
I am close to just looking for another easy to use poll script. If you guys are tired or out of ideas on this one, do you have any free poll scripts you might want to suggest? I really like this one though(when it runs:p
Just so you guys know, the script we're having problems with is 'Poll it 2.0' by cgi world.
YvetteKuhns
7-6-07, 10:51 AM
Poll It v2.0 cgi is a security risk! (http://archives.neohapsis.com/archives/bugtraq/2000-10/0330.html)
Try other poll scripts (http://www.hotscripts.com/PHP/Scripts_and_Programs/Polls_and_Voting/index.html) and see what works for you. I suggest php scripts for two reasons. The first is that the php scripts are more recent. If you look at cgi scripts, many were written years ago and not updated. They can be less secure. The other is because you are using shtml and php is more likely to work as expected.
Looks like Poll It has been a security risk since Oct of 2000 according to the link Yvette put up. You'd think someone would have fixed it in that time.
YvetteKuhns
7-6-07, 11:20 AM
Search other cgi scripts and see that many are quite old. I think many abandoned cgi for php.
Ok. Thanks for all the help guys. I have a related question. I am using the yabb forums script. I found it to be easier to set up and better than phpbb, for example.
Can you guys tell me the benefits of using php vs cgi(and viceversa) on a forum script? I know yabb is recent and popular. Are there security issues I should be concerned about? Maintenance? Speed? etc.:)
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.