Koozali.org: home of the SME Server

Exec CGI files in CGI-BIN

veryloco

Exec CGI files in CGI-BIN
« on: March 04, 2005, 08:55:42 AM »
Does anyone know how to run .cgi files in an i-bay that has CGI enabled?  I have searched the forums for an answer, but no one seems to have posted it.  I have an index.html file in the html directory with a link to the .cgi file in cgi-bin.  I keep getting the internal server error when trying to access the .cgi file, even directly.  I have chmodded the .cgi as 755.  Does anyone have any ideas?  

Thanks for your help.

Skydiver

Re: Exec CGI files in CGI-BIN
« Reply #1 on: March 04, 2005, 09:09:58 AM »
Quote from: "veryloco"
Does anyone know how to run .cgi files in an i-bay that has CGI enabled?  I have searched the forums for an answer, but no one seems to have posted it.  I have an index.html file in the html directory with a link to the .cgi file in cgi-bin.  I keep getting the internal server error when trying to access the .cgi file, even directly.  I have chmodded the .cgi as 755.  Does anyone have any ideas?  

Thanks for your help.


Did you do #chmod +x filename.pl

this makes it executable i believe

Offline Reinhold

  • *
  • 517
  • +0/-0
    • http://127.0.0.1
Exec CGI files in CGI-BIN
« Reply #2 on: March 04, 2005, 10:07:45 AM »
url for primary i-bay like: http://192.168.0.1/cgi-bin/mycgi
(dns works ? -> http://mysmeserver/cgi-bin/mycgi )

cgi MUST CONTAIN as first line (include the "#" !):
Code: [Select]
#!/usr/bin/perl -wT


Unless you have a specific reason:
owner: www
group: www
Permissions: 100750

logged in as root you (better?) make a script executable:
Code: [Select]
chmod a=r+w+x your_script_file_name

------------------------------------------------
note: use midnight commander (mc) to modify :-)


Code: [Select]
┌───────────────────── Chown advanced command ───────────────────────┐  
│                                                                    │
│ On  mycgi                                                          │
│                                                                    │
│     owner   group   other      owner             group             │
│     [rwx]   [r-x]   [---]     [www            ] [www            ]  │
│ Flag ===     ===     ===       ===============   ===============   │
│ Mode       100750                                                  │
│                                                                    │
│                                          [< Set >]    [ Cancel ]   │
└────────────────────────────────────────────────────────────────────┘



Regards
Reinhold
............

veryloco

Exec CGI files in CGI-BIN
« Reply #3 on: March 04, 2005, 05:42:28 PM »
Thanks for your replies.  It turns out that the -wT added at the top of the script is what is needed.  Thanks.