Jump to content
xisto Community
egbert

Simple Problem W/ Perl I cant get this hello world script

Recommended Posts

Here's my code:

#!/usr/bin/perl#print "Content-type: text/html\n\n";print "Howdy, world!";

I saved it in my cgi-bin with 777 permissions and It goes;

Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@supper.astahost.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


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

Apache/1.3.33 Server at http://forums.xisto.com/no_longer_exists/ Port 80



I'm probably doing something really dumb... tell me what it is?

Share this post


Link to post
Share on other sites

I see nothing wrong with this script, as long as the file extension is .pl or .cgi it should work, I would try .pl as the extension first before attempting .cgi.

chmod 755 instead of 777.

0 = no permissions
1 = execute only
2 = write only
3 = write and execute
4 = read only
5 = read and execute
6 = read and write
7 = read, write and execute

#!/usr/bin/perl########## hello.pl #########print "Content-type: text/html\n\n";print "<p>Howdy, world!</p>";

Cheers,


MC

Share this post


Link to post
Share on other sites

Yourself as the owner should have ( r)ead (w)rite and e(x)ecute permission over that file.The group/others, such as 'the world' should not have writable access. In some cases, making the file world writable will not allow the script to be used at all, in which case it will most definitely work if set to 755, if your script needs to write to a directory, that's ok, it'll be executed under your owner's permission which you've given it the ability to write/delete.All other regular files should have permissions set to 644.Cheers,MC

Share this post


Link to post
Share on other sites

Yourself as the owner should have ( r)ead (w)rite and e(x)ecute permission over that file.

 

The group/others, such as 'the world' should not have writable access.  In some cases, making the file world writable will not allow the script to be used at all, in which case it will most definitely work if set to 755, if your script needs to write to a directory, that's ok, it'll be executed under your owner's permission which you've given it the ability to write/delete.

 

All other regular files should have permissions set to 644.

Cheers,

MC

<{POST_SNAPBACK}>


Thanks thisthread was helpful to me explans what I was doing wronge on a few pages. was using ws-ftp to change the permissions was going to far. will check it out in a few days. thatns for the info you may of answered two people at one shot.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.