You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Victor B. Gonzalez" <ap...@vbgunz.com> on 2003/05/31 17:43:16 UTC

[users@httpd] Perl is so hard to install onto Apache, how, please help...

Hello Apache,

  On my old server Perl was a cinch. On Apache it seems I am faced
  with a world of trouble on my XP machine.

  1. Most scripts come with "#!/user/bin/perl" but my Perl location is
  "#!Z:/Apache/Perl"...

  Do I have to manually change the hundreds of pages with the
  "#!/user/bin/perl" to "#!Z:/Apache/Perl" or can Apache map it?

  2. Trying to apply ActiveState Perl 5.8.0 on Apache 2.0.46 proves so
  troublesome.

  I looked for close to an hour about how to install Perl onto Apache
  as the Active State web site seemed to lack the information and I
  found this website which seemed to be the most straightforward:
  http://www.thesitewizard.com/archive/addcgitoapache.shtml

  I did as it said and from my standpoint I wish to run Perl from
  anywhere...

  1. AddHandler cgi-script .cgi .pl
  (Uncommented, double-checked, done)

  2. Options FollowSymLinks +ExecCGI
  (double-checked, done)

  3. Added index.pl and index.cgi
  (double-checked, done)

  Trying to run a Perl script returns a 403 Forbidden page... I've got
  Apache running on localhost:8080, Forbid me?

  For the fun of it I put a Perl script in the cgi-bin and accessing
  it returns 500 internal error? I double checked the setup and really
  can't figure out alone what I did wrong...

  Does someone have a hello world script to test Perl on Apache? I
  believe the only scripts I got are to test Perl form the command
  line... as they return either a 403 or 500 with Apache...

  Can someone please help me on this one. I spent my day yesterday
  configuring all of my php scripts to run flawlessly, had a little
  trouble but solved it on my own... Perl doesn't want to play nice
  though... Any ideas?

  Thank you very much for getting back to me on this :)

-- 
Best regards,
 Victor B. Gonzalez                          

apache_2.0.46-win32-x86-no_src
Windows XP 5.1 Build 2600 Service Pack 1


---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re[3]: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by "Victor B. Gonzalez" <ap...@vbgunz.com>.
Hello Rich,

>> RB> Always look in the error log first, no matter what goes wrong. It will
>> RB> give you a great deal of information that is not immediately evident
>> RB> from looking in the browser error messages.

>> I need to bundle Perl but cannot write to the Registry. If I need to
>> manually change the shebang line on every script I'll do it but even
>> that solution is *not* working at the moment.

RB> So, if you create a perl program with the correct #! line, what happens,
RB> exactly?

RB> #!Z:/Apache/Perl/Bin/perl.exe

I've been trying that for the longest but it kept coming back with
errors... But I believe I just got it to work from any directory...

Something about this document helped me
http://httpd.apache.org/docs/howto/cgi.html thank you Rich Bowen for
posting the link...

I hope I got it right this time... Is the print.pl script bundled with
Apache supposed to show me something like this?

COMSPEC="C:\WINDOWS\system32\cmd.exe"
DOCUMENT_ROOT="Z:/Apache/htdocs"
etc,?

Believe it or not I believe the two little periods on line 765 was
screwing me up...

It looked like this
AddHandler cgi-script .pl .cgi

I changed it to this and it just worked
AddHandler cgi-script pl cgi

It is all I remember changing as I saw it in the document Rich Bowen
linked too.

Anyhow, I believe I got it working and am very happy. I never thought
I get PHP and Perl to run on Apache, never the less use it.

Thanks for the mailing list and thanks to everyone else, no one in
particular but thank you all very much :)

-- 
Best regards,
 Victor B. Gonzalez                          

apache_2.0.46-win32-x86-no_src
Windows XP 5.1 Build 2600 Service Pack 1


---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re[2]: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by Rich Bowen <rb...@rcbowen.com>.
On Sat, 31 May 2003, Victor B. Gonzalez wrote:

> Hello Apache,
>
> RB> Always look in the error log first, no matter what goes wrong. It will
> RB> give you a great deal of information that is not immediately evident
> RB> from looking in the browser error messages.
>
> Perl is not registered in my registry. If I can tell Apache where Perl
> is exactly, it would probably be my best option. I need for perl and
> Apache to be portable the way I have Apache and PHP at the moment.

When you install ActiveState Perl, it creates an association between .pl
files and the path to Perl.exe. If this is not the case on your system,
reinstall AactiveState Perl, and watch the options during install
closely for that option.

> In the end I simply need Perl to be portable. I would like to bundle
> Apache into one of my projects and unfortunately I need Perl... I am
> also am attaching my httpd.conf file for further examination if anyone
>
> My Perl.exe is located at Z:\Apache\Perl\Bin\perl.exe and all of its
> files I am guessing is relative to itself.
>
> I need to bundle Perl but cannot write to the Registry. If I need to
> manually change the shebang line on every script I'll do it but even
> that solution is *not* working at the moment.

So, if you create a perl program with the correct #! line, what happens,
exactly?

#!Z:/Apache/Perl/Bin/perl.exe



-- 
Rich Bowen
Apache - mod_perl - Perl - CGI
http://www.ApacheAdmin.com/

---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by Joseph A Nagy Jr <jo...@charter.net>.
Victor B. Gonzalez wrote:
> Hello Apache,
> 
> I forgot to mention I got Perl working by changing the shebang line.
> Is there anyway *without* registering perl in my registry and without
> changing the shebang line to get Perl to work?

Not that I know of. You could always install mod_perl for your version 
of Apache. Read the documentation for Apache (more specifically, the 
manual[0]).

> 
> In other words, is it possible to *tell Apache* where Perl is located?
> 

Perhaps, but your best bet (on Windows at least) is to install 
ActivePerl and associate .cgi and .pl files with Perl.

[0]: I have a copy of the manual online at 
http://joseph-a-nagy-jr.homelinux.org/manual/
-- 
Wielder of the mighty +1 LARTsaber of Unsubscribe Instructions At End of 
Message,
the +3 Clue-by-Four of No Attachments to a Mailing List,
and the -4 Shield of No Spell Checker


---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re[2]: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by "Victor B. Gonzalez" <ap...@vbgunz.com>.
Hello Apache,

I forgot to mention I got Perl working by changing the shebang line.
Is there anyway *without* registering perl in my registry and without
changing the shebang line to get Perl to work?

In other words, is it possible to *tell Apache* where Perl is located?

-- 
Best regards,
 Victor B. Gonzalez                          

apache_2.0.46-win32-x86-no_src
Windows XP 5.1 Build 2600 Service Pack 1


---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by Joseph A Nagy Jr <jo...@charter.net>.
Victor B. Gonzalez wrote:
<snip>
> Please look at my httpd.conf file for errors. Thanks again.

You could have posted them to a website.

-- 
Wielder of the mighty +1 LARTsaber of Unsubscribe Instructions At End of 
Message,
the +3 Clue-by-Four of No Attachments to a Mailing List,
and the -4 Shield of No Spell Checker


---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re[2]: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by "Victor B. Gonzalez" <ap...@vbgunz.com>.
Hello Apache,

RB> Always look in the error log first, no matter what goes wrong. It will
RB> give you a great deal of information that is not immediately evident
RB> from looking in the browser error messages.

Perl is not registered in my registry. If I can tell Apache where Perl
is exactly, it would probably be my best option. I need for perl and
Apache to be portable the way I have Apache and PHP at the moment.

I thank everyone trying to help me but I am still stuck in the
struggle with Perl. I am copying directly into this message my
changelog in trying to install Perl. Forgive me if it too much.

In the end I simply need Perl to be portable. I would like to bundle
Apache into one of my projects and unfortunately I need Perl... I am
also am attaching my httpd.conf file for further examination if anyone
is curious in looking it over.

Here is my Perl install changelog

01. Added ExecCGI to line 239.
    238. <Directory />
    239.    Options FollowSymLinks ExecCGI
    240.    AllowOverride None
    241. </Directory>

02. Added index.pl and index.cgi to line 321.
    321. DirectoryIndex index.php index.phtml index.php3 index.pl index.cgi index.html index.html.var

03. Uncommented Line 765.
    765: AddHandler cgi-script .pl .cgi

Restart server, access script, ErrorLog
------------------------------------------------------
[Sat May 31 15:24:38 2003] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified.  : couldn't create child process: 720003: printenv.pl
[Sat May 31 15:24:38 2003] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified.  : couldn't spawn child process: Z:/Apache/cgi-bin/printenv.pl
------------------------------------------------------

Changed only line 239 and according to guide added a "+" symbol to ExecCGI.

Restart server, access script, ErrorLog
------------------------------------------------------
[Sat May 31 15:28:26 2003] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified.  : couldn't create child process: 720003: printenv.pl
[Sat May 31 15:28:26 2003] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified.  : couldn't spawn child process: Z:/Apache/cgi-bin/printenv.pl
------------------------------------------------------

Removed "+" symbol from line 239 according to Apache Documentation and commented out line 509.

509. #ScriptAlias /cgi-bin/ "Z:/Apache/cgi-bin/"

Restart server, access script, ErrorLog
------------------------------------------------------
[Sat May 31 15:33:33 2003] [error] [client 127.0.0.1] File does not exist: Z:/Apache/htdocs/cgi-bin
------------------------------------------------------

Commented out lines 515 through 520

515. <Directory "Z:/Apache/cgi-bin">
516.    AllowOverride None
517.    Options None
518.    Order allow,deny
519.    Allow from all
520. </Directory>

Restart server, access script, ErrorLog
------------------------------------------------------
[Sat May 31 15:37:56 2003] [error] [client 127.0.0.1] Options ExecCGI is off in this directory: Z:/Apache/htdocs/printenv.pl
------------------------------------------------------

Added +ExecCGI to line 267
267.     Options Indexes FollowSymLinks +ExecCGI

Restart server, access script, ErrorLog
------------------------------------------------------
[Sat May 31 15:43:32 2003] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified.  : couldn't create child process: 720003: printenv.pl
[Sat May 31 15:43:32 2003] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified.  : couldn't spawn child process: Z:/Apache/htdocs/printenv.pl
------------------------------------------------------

Changed the shebang line in the printenv.pl and mapped it to Perl.

Restart server, access script, ErrorLog
------------------------------------------------------
No Error but no execution of script, file will only download...
------------------------------------------------------

Added ScriptInterpreterSource registry to httpd.conf but now file opens directly in phpedit.

Restart server, access script, ErrorLog
------------------------------------------------------
[Sat May 31 15:56:40 2003] [error] [client 127.0.0.1] Premature end of script headers: printenv.pl
------------------------------------------------------

END OF PERL INSTALL CHANGELOG...

Please forgive me if it was sloppy... I've been stuck trying to solve
this problem almost all day today May 31st 2003... My brain is
literally tired...

My Perl.exe is located at Z:\Apache\Perl\Bin\perl.exe and all of its
files I am guessing is relative to itself.

I need to bundle Perl but cannot write to the Registry. If I need to
manually change the shebang line on every script I'll do it but even
that solution is *not* working at the moment.

Thank you a thousand times just for looking this over. It is without a
doubt a thousand times appreciated.

Please look at my httpd.conf file for errors. Thanks again.

-- 
Best regards,
 Victor B. Gonzalez                          

apache_2.0.46-win32-x86-no_src
Windows XP 5.1 Build 2600 Service Pack 1

Re: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by Rich Bowen <rb...@rcbowen.com>.
Since you received two incorrect answers so far, I thought I'd take a
moment to give you a little more information.

>   On my old server Perl was a cinch. On Apache it seems I am faced
>   with a world of trouble on my XP machine.
>
>   1. Most scripts come with "#!/user/bin/perl" but my Perl location is
>   "#!Z:/Apache/Perl"...
>
>   Do I have to manually change the hundreds of pages with the
>   "#!/user/bin/perl" to "#!Z:/Apache/Perl" or can Apache map it?

No, you do not. On Windows, there is a ScriptInterpreterSource directive
that allows you to use the Windows file association, rather than the #!
line, to map a Perl program to the Perl interpterer.

ScriptInterpreterSource registry

Add that line to your configuration file. The default value is "script"
and looks in the #! line for the location of the interpreter.

Make sure that .pl files (and .cgi files, if you like) are mapped to the
location of the Perl interpeter.

>   2. Trying to apply ActiveState Perl 5.8.0 on Apache 2.0.46 proves so
>   troublesome.
>
>   I looked for close to an hour about how to install Perl onto Apache
>   as the Active State web site seemed to lack the information and I
>   found this website which seemed to be the most straightforward:
>   http://www.thesitewizard.com/archive/addcgitoapache.shtml
>
>   I did as it said and from my standpoint I wish to run Perl from
>   anywhere...
>
>   1. AddHandler cgi-script .cgi .pl
>   (Uncommented, double-checked, done)
>
>   2. Options FollowSymLinks +ExecCGI
>   (double-checked, done)
>
>   3. Added index.pl and index.cgi
>   (double-checked, done)
>
>   Trying to run a Perl script returns a 403 Forbidden page... I've got
>   Apache running on localhost:8080, Forbid me?

You need to look in the error log. The "Forbidden" message usually means
that there is a directive somewhere that does not permit files to be
loaded from the directory in question. You may need to add an "allow"
directive for the directory in question:

<Directory /path/to/directory>
 Order allow,deny
 Allow from all
</Directory>

>   For the fun of it I put a Perl script in the cgi-bin and accessing
>   it returns 500 internal error? I double checked the setup and really
>   can't figure out alone what I did wrong...

Look in the error log. Make sure that your script prints content-type
headers correctly.

>   Does someone have a hello world script to test Perl on Apache? I
>   believe the only scripts I got are to test Perl form the command
>   line... as they return either a 403 or 500 with Apache...

Yes, one comes with Apache. It's in the cgi-bin directory.

Or, you can try the following:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World\n";

>   Can someone please help me on this one. I spent my day yesterday
>   configuring all of my php scripts to run flawlessly, had a little
>   trouble but solved it on my own... Perl doesn't want to play nice
>   though... Any ideas?

Always look in the error log first, no matter what goes wrong. It will
give you a great deal of information that is not immediately evident
from looking in the browser error messages.

-- 
Rich Bowen - rbowen@rcbowen.com
Author - Apache Administrator's Guide
http://www.ApacheAdmin.com/

---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by Joseph A Nagy Jr <jo...@charter.net>.
Jeff Cohen wrote:
> You must change the shebang line:
> #!/usr/sbin/perl
> to:
> #!Z:\Apache\Perl\bin\perl.exe
> otherwise nothing would work.
> Perl is meant to be a programming language, that people will write it as
> well as to be as much compatible with other users, so when a win32 user
> downloading it, then yes, you must customize it for yourself.
> 
> All the best,
> Jeff Cohen
> Support@GEJ-IT.com
> Tel. (416) 917-2324
> www.GEJ-IT.com
> GEJ-IT Networks!
<snip>

Actually, that's unneccessary if he's properly associated Perl with .pl 
and .cgi extensions.


-- 
Wielder of the mighty +1 LARTsaber of Unsubscribe Instructions At End of 
Message,
the +3 Clue-by-Four of No Attachments to a Mailing List,
and the -4 Shield of No Spell Checker


---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Perl is so hard to install onto Apache, how, please help...

Posted by Jeff Cohen <su...@gej-it.com>.
You must change the shebang line:
#!/usr/sbin/perl
to:
#!Z:\Apache\Perl\bin\perl.exe
otherwise nothing would work.
Perl is meant to be a programming language, that people will write it as
well as to be as much compatible with other users, so when a win32 user
downloading it, then yes, you must customize it for yourself.

All the best,
Jeff Cohen
Support@GEJ-IT.com
Tel. (416) 917-2324
www.GEJ-IT.com
GEJ-IT Networks!

> -----Original Message-----
> From: Victor B. Gonzalez [mailto:apacheusergroup@vbgunz.com]
> Sent: Saturday, May 31, 2003 11:43 AM
> To: Apache Users
> Subject: [users@httpd] Perl is so hard to install onto Apache, how, please
help...
> 
> Hello Apache,
> 
>   On my old server Perl was a cinch. On Apache it seems I am faced
>   with a world of trouble on my XP machine.
> 
>   1. Most scripts come with "#!/user/bin/perl" but my Perl location is
>   "#!Z:/Apache/Perl"...
> 
>   Do I have to manually change the hundreds of pages with the
>   "#!/user/bin/perl" to "#!Z:/Apache/Perl" or can Apache map it?
> 
>   2. Trying to apply ActiveState Perl 5.8.0 on Apache 2.0.46 proves so
>   troublesome.
> 
>   I looked for close to an hour about how to install Perl onto Apache
>   as the Active State web site seemed to lack the information and I
>   found this website which seemed to be the most straightforward:
>   http://www.thesitewizard.com/archive/addcgitoapache.shtml
> 
>   I did as it said and from my standpoint I wish to run Perl from
>   anywhere...
> 
>   1. AddHandler cgi-script .cgi .pl
>   (Uncommented, double-checked, done)
> 
>   2. Options FollowSymLinks +ExecCGI
>   (double-checked, done)
> 
>   3. Added index.pl and index.cgi
>   (double-checked, done)
> 
>   Trying to run a Perl script returns a 403 Forbidden page... I've got
>   Apache running on localhost:8080, Forbid me?
> 
>   For the fun of it I put a Perl script in the cgi-bin and accessing
>   it returns 500 internal error? I double checked the setup and really
>   can't figure out alone what I did wrong...
> 
>   Does someone have a hello world script to test Perl on Apache? I
>   believe the only scripts I got are to test Perl form the command
>   line... as they return either a 403 or 500 with Apache...
> 
>   Can someone please help me on this one. I spent my day yesterday
>   configuring all of my php scripts to run flawlessly, had a little
>   trouble but solved it on my own... Perl doesn't want to play nice
>   though... Any ideas?
> 
>   Thank you very much for getting back to me on this :)
> 
> --
> Best regards,
>  Victor B. Gonzalez
> 
> apache_2.0.46-win32-x86-no_src
> Windows XP 5.1 Build 2600 Service Pack 1
> 
> 
> ---------------------------------------------------------------------
> 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: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org