Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Simple Problem W/ Perl, I can't get this hello world script
egbert
post Feb 12 2005, 04:40 PM
Post #1


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 34
Joined: 6-February 05
Member No.: 2,543



Here's my code:
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;
QUOTE
Internal Server Error
The 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 www.supper.astahost.com Port 80



I'm probably doing something really dumb... tell me what it is?
Go to the top of the page
 
+Quote Post
mastercomputers
post Feb 13 2005, 02:59 AM
Post #2


BUG.SWAT.PATROL
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



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

CODE

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



Cheers,


MC
Go to the top of the page
 
+Quote Post
Trekkie101
post Feb 13 2005, 10:01 PM
Post #3


Teh Teckeh Trekkeh
Group Icon

Group: Members
Posts: 682
Joined: 8-September 04
From: Scotland, UK
Member No.: 389



Why 755 instead of 777?

It should affect that particular thing shout it?
Go to the top of the page
 
+Quote Post
mastercomputers
post Feb 14 2005, 09:47 AM
Post #4


BUG.SWAT.PATROL
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



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
Go to the top of the page
 
+Quote Post
KnightEagle
post Aug 18 2005, 03:57 PM
Post #5


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 56
Joined: 17-August 05
Member No.: 7,907



QUOTE(mastercomputers @ Feb 14 2005, 04:47 AM)
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
*



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.
Go to the top of the page
 
+Quote Post
html_man
post May 1 2006, 05:38 PM
Post #6


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 8
Joined: 1-May 06
Member No.: 13,141



The hello world thingy is just an simple example of what a CGI is, it doesnt do anything tho, and if u dont put it a 755 permission it will NOT work
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Perl, the hacker language?(6)
  2. What Is Perl?(11)
  3. Perl Script(0)
  4. Does Anyone Know To Use Movabletype (perl)(6)
  5. Perl : Help(4)
  6. Sockets And Perl(1)
  7. Best Place For Information On Perl(8)
  8. Password Reminder And Password Change .htaccess(4)
  9. Strange Perl Behavior(4)
  10. Perl: Exec Or System ?(3)
  11. Help Needed To Create Login Script With Perl/cgi(21)
  12. Create Easily Modifiable Html Templates For Use In Your Perl Cgis(0)
  13. Share Your CGI Scripts Here(1)
  14. Using Perl For Newsletter Subscription(1)
  15. Simple Perl Script...(1)
  1. Need To Install Script - $10(5)
  2. Just Learning Perl(6)
  3. Perl Programming Language(1)
  4. Maximum Number Of Decimal Places In Perl Language(0)


 



- Lo-Fi Version Time is now: 30th August 2008 - 03:16 PM