Results 1 to 15 of 15
  1. #1
    Newbie
    Join Date
    January 18th, 2005
    Posts
    268
    can anyone talk me through installing this postcard script

    when i try and call card.cgi from a webpage i get a 403 error

    im a total cgi newbie, i have managed to get a couple of other very simple unrelated .pl files to work in my root directory so i assume that i dont need to place card.cgi in a cgi-bin, and that it should work in any directory

    this is the code for card.cgi

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>
    #!/usr/local/bin/perl

    $domain_name = "yourcompany.com";
    $location = "http://www.yourcompany.com/postcard/";
    $basepicurl = "http://www.yourcompany.com/postcard/pictures/";
    $cgi = "http://www.yourcompany.com/cgi-bin/card.cgi";
    $cards = "$ENV{DOCUMENT_ROOT}/postcard/cards/";
    $basepicdir = "$ENV{DOCUMENT_ROOT}/postcard/pictures/";
    $preview1 = "$ENV{DOCUMENT_ROOT}/postcard/preview1.html";
    $preview2 = "$ENV{DOCUMENT_ROOT}/postcard/preview2.html";
    $makecard = "$ENV{DOCUMENT_ROOT}/postcard/makecard.html";
    $thank_you = "$ENV{DOCUMENT_ROOT}/postcard/thankyou.html";
    $error = "$ENV{DOCUMENT_ROOT}/postcard/error.html";
    $email1 = "$ENV{DOCUMENT_ROOT}/postcard/email1.txt";
    $email2 = "$ENV{DOCUMENT_ROOT}/postcard/email2.txt";
    $mailprog = '/usr/sbin/sendmail';
    $MAX_DAYS = '10';

    @picsallowed = ('gif','jpg','jpeg');

    $subject1 = "You Have A Postcard!";
    $subject2 = "Thank You for using our Postcard Card";

    $uploadmax = '50';
    $allowed = '1500';

    require "$ENV{DOCUMENT_ROOT}/postcard/program.cgi";
    <HR></BLOCKQUOTE>

    these are the paths my server gave me

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>
    Perl - /usr/bin/perl
    Perl 5 - /usr/bin/perl
    Public Html: /usr/local/psa/home/vhosts/yourcompany.com/httpdocs
    Home directory: //usr/local/psa/home/vhosts/yourcompany.com/
    CGI-BIN: //usr/local/psa/home/vhosts/yourcompany.com/cgi-bin
    Sendmail - /usr/sbin/sendmail
    Date program - /bin/date
    <HR></BLOCKQUOTE>


    where am i going wrong?

    note: the only change that ive made to the code is from
    $cgi = "http://www.yourcompany.com/cgi-bin/card.cgi";
    to
    $cgi = "http://www.yourcompany.com/postcard/card.cgi";

  2. #2
    Newbie
    Join Date
    January 18th, 2005
    Posts
    35
    Hi,
    try changing the first line from this :
    #!/usr/local/bin/perl

    to this:
    #!/usr/bin/perl

  3. #3
    Guest
    spacebandit,

    First always login via telnet
    Start->Run->Type in Telnet then select Connect Enter your server (ie. www.abestweb.com) .... the screen will prompt you for your username and pasword ... once logged in type 'which perl' sans quotes ... know it learn it live it! (since you know the other variables I'll leave those parts that out).

    Most programs ask you to change the perl location, send mail location as well as knowing absolute paths to the specific files.

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>so i assume that i dont need to place card.cgi in a cgi-bin, and that it should work in any directory<HR></BLOCKQUOTE>

    WRONG!

    A cgi file must be in the .../cgi-bin/ subdirectory ... so it would be called as
    http://www.yourserver.com/cgi-bin/cardprogram/card.cgi

    Calling a cgi from it's proper location is as important as identifying the perl location.

    Your problem is a 403 (forbidden) which appears to be an impropper call or file attribute settings (ie 664, 755 or 777) ...

    Re-upload all the cgi files in ascii (crucial) and make sure all cgi are called from the .../cgi-bin/card.cgi after your changes.

    Keep posting.

    Haiko

  4. #4
    Full Member
    Join Date
    January 18th, 2005
    Posts
    352
    Space Bandit

    It took me 30 minutes to install ODP++ on my server here

    I charge $55 USD an hour so I would do it for $22.50.

    I will look at the post card script next.

  5. #5
    Newbie
    Join Date
    January 18th, 2005
    Posts
    268
    thanks guys

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Hi,
    try changing the first line from this :
    #!/usr/local/bin/perl
    to this:
    #!/usr/bin/perl
    <HR></BLOCKQUOTE>

    i forgot to say that i did alter that line, im tyring to do a million things at the same time

    when i try to connect with telnet it freezes, i will try and reload it from my windows disc

    i know i have to upload in ascii and i did chomd the files as well as the directories to 755

    question: youre sure that cgi scripts must be called from the cgi-bin directory even though i have .pl files running in my root directory?

    i'll be back later, sorry not deliberately ignoring anyone

  6. #6
    ABW Ambassador
    Join Date
    January 17th, 2005
    Posts
    2,160
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>question: youre sure that cgi scripts must be called from the cgi-bin directory even though i have .pl files running in my root directory?<HR></BLOCKQUOTE>
    Depends if your host allows it. I can run scripts outside the cgi-bin but would recommend staying inside for security.
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>im tyring to do a million things at the same time<HR></BLOCKQUOTE>
    Just change one parameter at a time. At least when you do get it running you'll know why. [img]/infopop/emoticons/icon_wink.gif[/img]

  7. #7
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    758
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>At least when you do get it running you'll know why. <HR></BLOCKQUOTE>

    That's the key!

    You'll get through it, just keep goin!

    The most important thing is that you call your host, get the path to perl, then get the proper return path too!

    i.e.:

    /yourid/cgi-bin/whatever

    Make sure that you don't refer to the return path as an http!!!

    it shoulf be from the shell/youraccount/cgi-bin/

    That is very tricky, once you get it you will be able to install ALL perl scripts!

    ps- Perl IS THE FUTURE

    You can even ask IBM

    Linux is the force!

    [ 02-13-2002: Message edited by: breeze ]

  8. #8
    Guest
    Breeze,

    Perl WAS the future!

    I have learned this fact along with both mysql and php ... just my <IMG src=http://www.abestweb.com/ubb/icons/icon26.gif>

    Haiko

  9. #9
    Newbie
    Join Date
    January 18th, 2005
    Posts
    268
    when i signed up with my host they told me to ftp to a directory called "web_docs", which would be the root directory. Ive just noticed that i can jump out of that folder and then i could see some other folders, one of the folders i have discovered is "cgi-bin"

    in other words the cgi-bin directory is outside my root directory

    can anyone here tell my how i should alter the cgi script to take this into account

    :confused: :confused:

  10. #10
    Newbie
    Join Date
    January 18th, 2005
    Posts
    268
    come on guys, help me

    how do i link to a file in my cgi-bin when my cgi-bin is outside of my root directory?

    <pretty please>

  11. #11
    Member
    Join Date
    January 18th, 2005
    Posts
    128
    SpaceBandit,

    That's quite common that your cgi-bin is not below your root directory. My server is setup this way too.

    If you need the absolute directory to your cgi-bin, do ad "cd.." from your root directory (web_docs), then do a "cd cgi-bin" and type "pwd". pwd shows you the complete path to your cgi-bin and from what your host told you, this will most certainly be "/usr/local/psa/home/vhosts/yourcompany.com/cgi-bin"

    HTH,
    Karl

  12. #12
    Newbie
    Join Date
    January 18th, 2005
    Posts
    268
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>do ad "cd.." from your root directory<HR></BLOCKQUOTE>

    i havent a clue what that means :confused:

    the instructions say to link to the .cgi file like this
    <FORM METHOD=POST ACTION="http://www.mydomain.com/cgi-bin/card.cgi">

    mydomain.com points to the web_docs folder and the cgi-bin directory is outside of that, so how do i get the url in the form tag to link to the card.cgi file in the cgi-bin directory?

  13. #13
    Newbie
    Join Date
    January 18th, 2005
    Posts
    17
    No answered your question

    cgi files are executables and need to have the right file permissions to run correctly.

    If you have telnet access, go to the directory and type:

    "chmod a+x card.cgi"

    that'll make it an executable file and should get rid of the 403 forbidden error. You should also be able to set the file permissions via ftp if you can't telnet in.

  14. #14
    Member
    Join Date
    January 18th, 2005
    Posts
    128
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>mydomain.com points to the web_docs folder and the cgi-bin directory is outside of that, so how do i get the url in the form tag to link to the card.cgi file in the cgi-bin directory?
    <HR></BLOCKQUOTE>
    The Url "http://www.mydomain.com/cgi-bin/card.cgi" is probably correct. Don't mind that this directory isn't below the web root directory.

    When I talked about cd.. I meant:
    - Telnet to your account
    - enter "cd.." - that takes you up one level in the directory structure
    - enter "cd cgi-bin" - that takes you to your cgi directory
    - you now can chmod your files, e.g. "chmod 755 card.cgi"

    BTW, when you type "pwd" you get the path of the directory you're currently in.


    Karl

  15. #15
    ABW Ambassador
    Join Date
    January 17th, 2005
    Posts
    2,160
    You could just try the cheats method. [img]/infopop/emoticons/icon_smile.gif[/img]

    Look for a site offering free cgi scripts with an offer of free or automated installing for you.

    Once on your server just look at the scripts and make a note of the paths they are using for future reference.
    http://www.xav.com/ springs to mind. [img]/infopop/emoticons/icon_wink.gif[/img]

  16. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Domain issue since server change - cgi-sys/defaultwebpage.cgi
    By mobilebadboy in forum Domains & Hosting
    Replies: 6
    Last Post: July 31st, 2011, 10:47 PM
  2. cgi-world/cgiwrap/domain/cgi-bin/amazon.pl
    By KariBon in forum Cusimano.com Scripts
    Replies: 1
    Last Post: February 10th, 2003, 01:54 PM
  3. How to ... CGI
    By c4 in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: March 14th, 2002, 12:09 PM
  4. Anybody could with CGI and smartsearch.cgi??
    By natedog in forum Programming / Datafeeds / Tools
    Replies: 39
    Last Post: January 16th, 2002, 07:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •