[olug] Running Perl in a user directory
Mr Matt Payne
payne68114 at yahoo.com
Wed Jan 9 19:31:07 UTC 2002
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/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mike.txt
URL: <http://lists.olug.org/pipermail/olug/attachments/20020109/9d156fa2/attachment.txt>
-------------- next part --------------
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
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