LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Re: Apache and perl

[ILUG] Re: Apache and perl

Francis Daly francisdaly at gmail.com
Wed May 31 18:58:20 IST 2006


On 31/05/06, David Power <dlpower at epoc.ie> wrote:

Hi there,

>         I have a problem getting perl to work with apache. I have
> googled and can get no solution.

You don't say how you got php to work. Is the problem "perl", or "cgi"?
Try the following as "env.cgi" and see what it produces:

==
#!/bin/sh
echo Content-type: text/plain
echo
set
==

> http://localhost/printenv.pl gives me:
> <h1>Internal Server Error</h1>
> <p>The server encountered an internal error or
> misconfiguration and was unable to complete
> your request.</p>

> <p>Additionally, a 500 Internal Server Error
> error was encountered while trying to use an ErrorDocument to handle the
> request.</p>

Note that there are two errors reported there; you'll probably want to
fix both of them.

> running   perl /var/www/html/printenv.pl  as user outputs all the env
> variables in plain text

What does running

/var/www/html/printenv.pl

output? And when you do it as the same user that apache is configured
to run cgi scripts as? And when you do it in the same environment that
apache uses?

Trailing characters on the shebang line is one possibility. suexec and
SELinux are others.

Are either in use on your server?

> Examining the apache logs gives:
>
> (13) Permission denied: exec of '/var/www/html/printenv.pl'
>         Premature end of script headers: printenv.pl

That says that apache did not successfully run the script. The above
tests will show if you can run the script in the same way that apache
is trying to. If you have an suexec log file, there might be secrets
revealed there too.

> What have I done wrong? Could anyone help me out .

If these checks give no hints, then pointers to config files and
loaded or builtin modules and version numbers will probably be useful.

All the best,

	f



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell