To be sure, at the command prompt type <whereis perl>......Is perl in the
correct location?
What are the permissions of your cgi-bin directory and the script?
You say that your script has the .cgi extension but your error message is
refering to a .pl extension!?
What is the name of your file? /cgi-bin/perl/routers2.pl or
/cgi-bin/perl/routers2.cgi ?
Where is your cgi-bin? Is it /var/www/cgi-bin or /var/cgi-bin
Why do you have a sub-directory /cgi-bin/perl/ ?
what are you typing into your browsers address bar?
http://DomainName/cgi-bin/FileName or
http://DomainName/cgi-bin/perl/FileName ?
Sample code for a httpd.conf file for a cgi-bin:
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options +ExecCGI +Includes -indexes
Order allow,deny
Allow from all
</Directory>
<Location /cgi-bin>
AllowOverride None
Options +ExecCGI +Includes -indexes
SetHandler cgi-script
</Location>
Try testing a simple perl script, get this to work correctly then move on.
Create a script called test.cgi and place the following code within it:
#######################
#!/usr/bin/perl
print "content-type:text/html\n\n";
print "Hello World!";
########################
place this in your /cgi-bin/ directory change its permissions to 775 and try
loading it into your browser using http://DomainName/cgi-bin/test.cgi
----- Original Message -----
From: "Israel Brewster" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 10, 2007 11:06 PM
Subject: Re: [EMAIL PROTECTED] Simple perl question
I installed mod_perl from the package that was distributed with OpenBSD
4.0. The install didn't give any errors, so I have to assume it installed
properly. As far as I can tell, it didn't make any configuration changes.
Just placing the script in my CGI directory (and removing the
#!/usr/bin/perl line) gives "[error] (8)Exec format error: exec of
/cgi-bin/perl/routers2.pl failed".
-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service INC.
5245 Airport Industrial Rd
Fairbanks, AK 99709
-----------------------------------------------
On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote:
For this configuration you need to have mod_perl installed on your
server. Why don't you simply put your script into your cgi-bin
directory?
On 1/10/07, Israel Brewster <[EMAIL PROTECTED]> wrote:
I don't know if what I am trying to do here is even possible (sane?)
but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0
system, with Apache chrooted to /var/www. I have a perl script CGI
(it has the .cgi extention, not .pl, but is actually a perl script)
that I need to run. Currently, the script is written to run using the
system perl interpreter, with the first line of the script being #!/
usr/bin/perl This obviously doesn't work, since when it runs as a CGI
it is chrooted to /var/www, and can not see /usr/bin. Now I would
think that Apache should be able to run this script using the perl
module, which I have installed, but I can't seem to get it to work.
Could someone point me to something that tells me how to properly
enable/run perl scripts in Apache? I looked at mod_perl website, but
all it says is to add a code block like the following:
Alias /perl/ /home/httpd/perl/
PerlModule Apache::Registry
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Location>
which just gives me an 'Invalid command 'PerlModule' This would imply
to me that mod_perl isn't being loaded, in spite of being installed,
but that leaves me needing to know how to load the perl module.
Adding a line like LoadModule mod_perl /usr/local/lib/mod_perl.so
(which is the correct path to the mod_perl.so file) just gives me a
"Can't locate API module structure `mod_perl' in file /usr/local/lib/
mod_perl.so: Unable to resolve symbol" What am I missing here? How
can I get Apache to run perl scripts? Thanks for any assistance that
can be provided
-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service INC.
5245 Airport Industrial Rd
Fairbanks, AK 99709
-----------------------------------------------
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]