Discussion:
Perl script path...
(too old to reply)
toash
2005-11-09 12:00:10 UTC
Permalink
Hi all,

first off excuse my undoubted ignorance, but I'm new to perl...
the problem I have is I can run a script successfully from my server
console, but when I try & execute it from my browser I get a 404 page not
found. The script runs successfully on the server from the sys:/perl/scripts
folder. This isn't what my httpd.conf indicates the script folder to be,
please see below for excerpt of file. The script doesn't work if placed in
the apache cgi-bin folder or the perl/web folder. There are no entries
created in the Apache error log when I try to execute the script.

Hope someone can help, thanks


# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the
client.
# The same rules about trailing "/" apply to ScriptAlias directives as
to
# Alias.
#
ScriptAlias /cgi-bin/ "sys:/apache/cgi-bin/"

#
# "sys:/apache/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "sys:/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>


LoadModule lcgi_module modules/mod_lcgi.nlm
<IfModule mod_lcgi.c>
AddHandler lcgi-script .nlm .pl .nsn .bas
LCGIModuleMap sys:\perl\lcgi\cgi2perl.nlm .pl /perl
AddEnvVar PERL_ROOT sys:\perl\web
ScriptAlias /perl sys:/perl/web
</IfModule>


NW6 SP3
Perl 5.8.0
Apache 1.03
eDir 8.7
Randolf Richardson
2005-12-03 22:09:51 UTC
Permalink
Post by toash
Hi all,
[sNip] I'm new to perl...
the problem I have is I can run a script successfully from my server
console, but when I try & execute it from my browser I get a 404 page not
found. The script runs successfully on the server from the sys:/perl/scripts
folder. This isn't what my httpd.conf indicates the script folder to be,
please see below for excerpt of file. The script doesn't work if placed in
the apache cgi-bin folder or the perl/web folder. There are no entries
created in the Apache error log when I try to execute the script.
Hope someone can help, thanks
This is the Apache 2 forum. I'll provide you with the needed answer for
Apache 2, which includes the use of mod_perl.nlm. The main advantage to
using ModPERL is that it will increase the speed of execution of your
scripts (except the first time it loads the script becuase it compiles it
on-the-fly, similar to the way Novell Web Server 3.1 did back in the
1990s), thus reducing CPU Utilization in a very significant way...

After upgrading to Apache 2 (just extract it to a different directory such
as "apache2" and load it from there, that way you can always revert to
Apache 1.3 should the need arise), make sure the HTTPD.CONF file has the
following items:

The following loads mod_perl.nlm; you may need to copy it from Novell's
copy stored in: SYS:Apache2/Modules/mod_perl.nlm

--- Begin HTTPD.CONF example ---
LoadModule perl_module modules/mod_perl.nlm

Alias /perl/ "volumename:/path/morepath/evenmorepath/"
<Location /perl>
SetHandler perl-script
PerlHandler ModPerl::PerlRun
Options +Includes +ExecCGI
PerlSendHeader On
allow from all
</Location>
--- End HTTPD.CONF example ---

I very strongly recommend against storing your custom scripts in the
standard PERL directories because if PERL ever gets updated, you run the
risk of losing some or all of your custom scripts. Instead, pick a path,
possibly on a different volume, that resides outside of standard paths
such as "SYS:PERL" or "SYS:PUBLIC."

I created a separate volume which I currently call "INTERNET:" and I store
many of my scripts under "INTERNET:/PERLROOT/" -- you might want to
consider doing something like that as well. In the long run, it will be
very easy for you to differentiate between your scripts and PERL's default
scripts.

P.S.: Whenever you upgrade PERL, first make a backup copy of the entire
"SYS:PERL" directory structure to a location not on the server. This way,
if the upgrade clobbers any of your site-specific libraries, or special
dependencies that were dropped in a later version, at least you'll have an
easy way to get them back.
--
Randolf Richardson - ***@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com/

This message originated from within a secure, reliable,
high-performance network ... a Novell NetWare network.
Randolf Richardson
2005-12-03 22:11:38 UTC
Permalink
Randolf Richardson wrote:

[sNip]
Post by Randolf Richardson
This is the Apache 2 forum. I'll provide you with the needed answer for
[sNip]

Whoops, sorry! My appologies. I'm switching between multiple forums
through the HTTP interface and got the forum names mixed up.

Please let us know if that helps by posting a reply here.
--
Randolf Richardson - ***@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com/

This message originated from within a secure, reliable,
high-performance network ... a Novell NetWare network.
Continue reading on narkive:
Loading...