Results 1 to 6 of 6

Thread: where is cgi-bin so I can test perl scripts

  1. #1
    Junior Member
    Join Date
    Jan 2005
    Location
    Miami, Florida
    Posts
    3

    where is cgi-bin so I can test perl scripts

    I have a class of cgi/perl students, some of whom can only use Knoppix at home when not in the classroom (where we have a Redhat box). I want them to be able to run .cgi scripts through apache to test their perl scripts. They can then save the scripts in their home directory (using K menu > KNOPPIX > Configure > Create a persistent K home directory).

    I cannot, however, find a cgi-bin in /var/www and, if I use sudo mkdir to create it, I cannot write to it. They can test their scripts for syntax errors (using perl -c testScript.cgi), but they cannot debug the full output from, say, test.html which calls test.cgi; this kind of debugging requires the apache server to serve the output of a perl script in .cgi form. Any ideas?

    Bill Stanard

  2. #2
    Member registered user
    Join Date
    Jan 2005
    Posts
    71
    Hi,

    (I'm running a Debian system installed from the Knoppix CD on HD, so not everything might be accurate...)

    The apache configuration lives under /etc/apache/httpd.conf, searching for cgi-bin reveals: it's configured at
    /usr/lib/cgi-bin

    That directory is owned by user root, so the easiest might be to alter the httpd.conf and add another ScriptAlias
    directive that your students can write to.

    Ciao,
    Thomas

  3. #3
    Junior Member
    Join Date
    Jan 2005
    Location
    Miami, Florida
    Posts
    3
    tom p wrote: The apache configuration lives under /etc/apache/httpd.conf, searching for cgi-bin reveals: it's configured at
    /usr/lib/cgi-bin

    That directory is owned by user root, so the easiest might be to alter the httpd.conf and add another ScriptAlias
    directive that your students can write to.


    That's the part that gets me.... how can I write to a directory (/usr/lib/cgi-bin) that appears to be read only? I have had success writing only to the desktop. Am I missing something basic here?

    cheers!
    Bill

  4. #4
    Member registered user
    Join Date
    Jan 2005
    Posts
    71
    Quote Originally Posted by bstanard
    how can I write to a directory (/usr/lib/cgi-bin) that appears to be read only? I have had success writing only to the desktop. Am I missing something basic here?
    You don't need to! The directories beyond /etc (not the files though; they are symlinks) are writable;
    I'd suggest to put a file "userdir.conf" into /etc/apache/conf.d/ with the following content:

    Code:
    AddHandler cgi-script .cgi .pl
    <Directory /home/*/public_html>
        Options +Includes +ExecCGI
    </Directory>
    Then, in your home directory create "public_html", put a cgi in there and (after starting apache) try if it works:
    wget http://localhost/~knoppix/your_test_cgi_here.cgi

    HTH,
    Thomas

  5. #5
    Junior Member
    Join Date
    Jan 2005
    Location
    Miami, Florida
    Posts
    3
    ok, and, by the way, thanks for the help so far....I cd-ed to /etc/apache/conf.d, vi-ed a file userdir.conf, and... rec'd the error message: "userdir.conf " E212: Can't open file for writing... when I tried to wq (save) the file... again and again I must be doing something wrong, for I can not save to any directory except knoppix's home directory... is there a switch I haven't flipped or something that I should be doing?
    please advise
    cheers!
    Bill

  6. #6
    Member registered user
    Join Date
    Jan 2005
    Posts
    71
    Quote Originally Posted by bstanard
    ok, and, by the way, thanks for the help so far....I cd-ed to /etc/apache/conf.d, vi-ed a file userdir.conf, and... rec'd the error message: "userdir.conf " E212: Can't open file for writing... when I tried to wq (save) the file... again and again I must be doing something wrong, for I can not save to any directory except knoppix's home directory... is there a switch I haven't flipped or something that I should be doing?
    please advise
    cheers!
    Bill
    try it as user "root" (i.e. for example from the "penguin" menu open a rootshell) and then create that file. That should work...

    Ciao,
    Thomas

Similar Threads

  1. Server Side Perl Scripts and Inaccessible cgi-bin Directory
    By brass in forum MS Windows & New to Linux
    Replies: 1
    Last Post: 05-02-2006, 11:47 AM
  2. Running Server Side Perl Scripts
    By brass in forum MS Windows & New to Linux
    Replies: 1
    Last Post: 04-30-2006, 09:30 PM
  3. perl module
    By madmadmod in forum Customising & Remastering
    Replies: 0
    Last Post: 01-15-2005, 05:14 PM
  4. tk perl
    By pau in forum General Support
    Replies: 1
    Last Post: 02-25-2004, 04:03 PM
  5. apt-get & perl
    By exiva in forum General Support
    Replies: 2
    Last Post: 11-09-2003, 03:36 AM

Posting Permissions

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


Dell 6P85J 4TB ST4000NM0063 7.2k 6Gb/s 3.5” SAS SED Hard Drive with Tray picture

Dell 6P85J 4TB ST4000NM0063 7.2k 6Gb/s 3.5” SAS SED Hard Drive with Tray

$39.99



Western Digital HUS726T4TAL5204 4TB 7.2K SAS 12Gb/s 3.5

Western Digital HUS726T4TAL5204 4TB 7.2K SAS 12Gb/s 3.5" 512e HDD NetApp X375A

$64.00



(ST8000NM0045) SEAGATE ENTERPRISE 8TB 7200RPM 4Kn SATA 6Gb/s 3.5

(ST8000NM0045) SEAGATE ENTERPRISE 8TB 7200RPM 4Kn SATA 6Gb/s 3.5" HARD DRIVE

$199.99



Western Digital 1TB 3.5

Western Digital 1TB 3.5" SATA III 7200RPM Desktop Hard Drive

$34.99



HGST 0F23072 Deskstar NAS 6TB SATA III 7200RPM 128MB 3.5in HDD picture

HGST 0F23072 Deskstar NAS 6TB SATA III 7200RPM 128MB 3.5in HDD

$84.99



Seagate ST500DM009 BarraCuda 500 GB 3.5

Seagate ST500DM009 BarraCuda 500 GB 3.5" SATA III Desktop Hard Drive

$14.99



HGST 0F23651 8TB SAS 12Gb/s 7200RPM 128MB 3.5

HGST 0F23651 8TB SAS 12Gb/s 7200RPM 128MB 3.5" Ultrastar He8 HDD

$89.99



Dell ST6000NM0034 1HT27Z-150 NWCCG 6TB SAS 3.5 7.2K ENTERPRISE SERVER DRIVE picture

Dell ST6000NM0034 1HT27Z-150 NWCCG 6TB SAS 3.5 7.2K ENTERPRISE SERVER DRIVE

$68.99



DELL 2TB Enterprise HDD (7200RPM, 3.5

DELL 2TB Enterprise HDD (7200RPM, 3.5", SATA III, 128MB Cache) HUS722T2TALA600

$49.95



Western Digital Red WD60EFRX-68MYMN1 6 TB,Internal,5400 RPM,3.5 inch Hard Drive picture

Western Digital Red WD60EFRX-68MYMN1 6 TB,Internal,5400 RPM,3.5 inch Hard Drive

$179.99