[olug] RE: [OLUG] Running Perl in a user directory

Mike Peterson mikejack at radiks.net
Wed Jan 16 13:55:21 UTC 2002


Thanks to all who offered help with this problem.
The following advice did the trick.
The steps are a how-to/cheat sheet for allowing users to run perl scripts in
user space.
You can see the outcome in action with the following links.

http://redhat3.iwcc.cc.ia.us/~mpeterson/hi.cgi

http://redhat3.iwcc.cc.ia.us/~mpeterson/date.cgi

http://redhat3.iwcc.cc.ia.us/~mpeterson/date.pl

http://redhat3.iwcc.cc.ia.us/~mpeterson/index.shtml

http://redhat3.iwcc.cc.ia.us/~mpeterson/date.shtml

-----Original Message-----
From: Mr Matt Payne [mailto:payne68114 at yahoo.com]
Sent: Wednesday, January 09, 2002 1:31 PM
To: olug at bstc.net
Cc: Matt Payne
Subject: Re: [olug] Running Perl in a user directory


Below is what works for me.  I've also attached it as
a plain text file. --Matt Payne

--- Mike Peterson
<mpeterson at mail.charlesfurniture.com> wrote:
> Has anyone come across a how to or cheat sheet for
> setting up a user to be able to run .pl scripts from
> within user space instead of from within cgi-bin or
> in addition to the normal cgi-bin area?
>
>


Add this section to httpd.conf.  Put it after a
closing </Directory> near the bottom of the file.

--------------start-------------
# This directory section added 1/7/2 to enable
# .htaccess files in user directories...
<Directory "/export/home/*/public_html">
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
--------------end-------------

Note you'll need to change /export/home/*/public_html
to /home/*/public_html or something.

In ~/public_html make a .htaccess file:
--------------start-------------
AddType application/x-httpd-cgi .cgi
AddType application/x-httpd-cgi .pl
Options ExecCGI +Includes Indexes
--------------end-------------

In ~/public_html make a hi.cgi (or hi.pl):
--------------start-------------
#!/usr/bin/perl

use CGI qw(:standard);

print header;
print start_html(), h1("Hello"), end_html();

exit(0);
--------------end-------------

You can test hi.cgi with this command:
chmod a+x hi.cgi; ./hi.cgi ''
It should output some HTML.  If you're prompted for
input just do a CTRL-D.


File permissions should look like this:
bash-2.03$ ls -la
total 18
drwxr-xr-x   3 payne    staff        512 Jan  7 18:46
.
drwxr-xr-x  10 payne    staff       1024 Jan  8 08:22
..
-rw-r--r--   1 payne    staff        183 Jan  7 18:43
.htaccess
-rw-r--r--   1 payne    staff         36 Jan  7 17:59
index.html
-rwxr-xr-x   1 payne    staff        110 Jan  7 18:37
hi.cgi



__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/



-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

For help contact olug-help at bstc.net - run by ezmlm
to unsubscribe, send mail to olug-unsubscribe at bstc.net
or `mail olug-unsubscribe at bstc.net < /dev/null`
(c)2001 OLUG http://www.olug.org

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_




More information about the OLUG mailing list