You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Klavs Klavsen <kl...@vsen.dk> on 2003/06/28 14:09:48 UTC

[users@httpd] perl-cgi won't work with apache2

Hi guys,

As I wrote about before, in a thread with this subject:
Bug in apache (was: upgrading to apache2 madeperl-cgi not work :()

my perl cgi-scripts won't work, after I upgraded to apache2 - apache
just outputs the source of the scripts :( 

As I haven't changed anything (!) I can't see anything but this must be
a bug in apache2 somehow? or perhaps the config directives has changed
in some way? p.s. I did only copy the vhost config over - the rest is
what came with Gentoo-Linux and apache-2.0.46.

How can I debug this?

the virtualhost running it looks like this:

<VirtualHost x.x.x.x>
ServerName sql-leger.domain.dk

DocumentRoot /usr/local/sql-ledger/
#DirectoryIndex index.html
AddHandler cgi-script .pl
#ScriptAlias /sql-ledger/ /usr/local/sql-ledger/

Alias /sql-ledger/ /usr/local/sql-ledger/
<Directory /usr/local/sql-ledger>
Options ExecCGI Includes FollowSymlinks
</Directory>

<Directory /usr/local/sql-ledger/users>
Options None
</Directory>
</VirtualHost>

-- 
Regards,
Klavs Klavsen, GSEC - kl@vsen.dk - http://www.vsen.dk
PGP: 7E063C62/2873 188C 968E 600D D8F8  B8DA 3D3A 0B79 7E06 3C62
See my new hosting service at http://hosting.EnableIT.dk

Working with Unix is like wrestling a worthy opponent. 
Working with windows is like attacking a small whining child 
who is carrying a .38.				

Re: [users@httpd] perl-cgi won't work with apache2

Posted by Robert Andersson <ro...@profundis.nu>.
Bret Hughes wrote:
> Seems like I remember reading some posts somewhere that permissions wer
> pretty important in cgi script excecution.

They are.

> Could this be at least port of the problem.

No, at least not so far. If Apache tries to execute a cgi with incorrent
permissions, it will throw a 500 (Internal Server Error), which isn't the
case here.

To the OP:

You need to heed the advice to simplify your configuration. The best way is
to use a vanilla configuaration with *minimal* changes to make it work on
your machine. Then, follow like a zombie the directives given here:
http://httpd.apache.org/docs-2.0/howto/cgi.html

When you made that work, you should either have figured out what was wrong
with your old configuration or be able to adjust the new configuration to
mirror the old one while making sure it works after each step. If you have
any problems while doing this, the list will be happy to help if you provide
all necessary information about the changes you made and extracts from the
error log.

Regards,
Robert Andersson




---------------------------------------------------------------------
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-cgi won't work with apache2

Posted by Sander Holthaus - Orange XL <in...@orangexl.com>.
I'm using cgi/perl from Apache 2.0.35, and never had much problems.
Especially not the last few versions, though there are still some issue's.

I've set it up like this:

<Directory "/usr/local/www/*/cgi-bin">
        <LimitExcept GET HEAD POST>
                Order deny,allow
                Deny from all
        </LimitExcept>
        Order deny,allow
        Deny from all
        <Files ~ "\.cgi$">
                Order allow,deny
                Allow from all
        </Files>
</Directory>

<VirtualHost *:80>
    DocumentRoot /usr/local/www/domain.com/docs
    ServerName domain.com
    ServerAdmin webmaster@domain.com
    ScriptAlias /cgi-bin/ "/usr/local/www/domain.com/cgi-bin/"
    ScriptAliasMatch /(.*)\.cgi$ /usr/local/www/domain.com/cgi-bin/$1.cgi
    DefaultLanguage nl
</VirtualHost>

I don't have anything like AddHandler cgi-script .pl or Options +ExecCGI,
perhaps you should try without those. Also, those ScriptAlias's are quite
important. Isn't there anyting usefull in the errorlogs?

Kind Regards,
Sander Holthaus

-----Original Message-----
From: Bret Hughes [mailto:bhughes@elevating.com] 
Sent: zondag 29 juni 2003 4:11
To: users@httpd.apache.org
Subject: RE: [users@httpd] perl-cgi won't work with apache2


On Sat, 2003-06-28 at 08:41, Klavs Klavsen wrote:
> On l
> > Klavs,
> > 
> > There is one thing you didn't mention in your problem description:
> > - where exactly is the script your calling (full path to it).
> > 
> /usr/local/sql-ledger/login.pl - path via browser 
> sql-ledger.domain.dk/login.pl.
> 
> > As for debugging, I'd start to simplify configuration until it works 
> > and then complicate it back.
> > 
> > Try for example a simple perl "Hello world" script, in a simple dir 
> > (created specially for testing), in the main apache server config, 
> > no aliases, no nothing, only the AddHandler, as plain as possible.
> > 
> Tried this script:
> 
> #!/usr/bin/perl
> #
> print "Content-Type: text/plain\n\n";
> print "<html><body>Hello World</body></html>";
> 
> It works as expected in shell - I also tried putting it under another 
> vhost - no change, still just shows the source of the script.
> 
> what info can I contribute with? What can/should I test?
> The server is running php scripts just fine in the directories I tried
> this in, and it is running my own site too.
> 

Seems like I remember reading some posts somewhere that permissions wer
pretty important in cgi script excecution.  Could this be at least port
of the problem.

Bret


---------------------------------------------------------------------
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


RE: [users@httpd] perl-cgi won't work with apache2

Posted by Bret Hughes <bh...@elevating.com>.
On Sat, 2003-06-28 at 08:41, Klavs Klavsen wrote:
> On l
> > Klavs,
> > 
> > There is one thing you didn't mention in your problem description:
> > - where exactly is the script your calling (full path to it).
> > 
> /usr/local/sql-ledger/login.pl - path via browser
> sql-ledger.domain.dk/login.pl.
> 
> > As for debugging, I'd start to simplify configuration until it works and
> > then complicate it back.
> > 
> > Try for example a simple perl "Hello world" script, in a simple dir (created
> > specially for testing), in the main apache server config, no aliases, no
> > nothing, only the AddHandler, as plain as possible.
> > 
> Tried this script:
> 
> #!/usr/bin/perl
> #
> print "Content-Type: text/plain\n\n";
> print "<html><body>Hello World</body></html>";
> 
> It works as expected in shell - I also tried putting it under another
> vhost - no change, still just shows the source of the script.
> 
> what info can I contribute with? What can/should I test? 
> The server is running php scripts just fine in the directories I tried
> this in, and it is running my own site too.
> 

Seems like I remember reading some posts somewhere that permissions wer
pretty important in cgi script excecution.  Could this be at least port
of the problem.

Bret


---------------------------------------------------------------------
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-cgi won't work with apache2

Posted by Klavs Klavsen <kl...@vsen.dk>.
On l
> Klavs,
> 
> There is one thing you didn't mention in your problem description:
> - where exactly is the script your calling (full path to it).
> 
/usr/local/sql-ledger/login.pl - path via browser
sql-ledger.domain.dk/login.pl.

> As for debugging, I'd start to simplify configuration until it works and
> then complicate it back.
> 
> Try for example a simple perl "Hello world" script, in a simple dir (created
> specially for testing), in the main apache server config, no aliases, no
> nothing, only the AddHandler, as plain as possible.
> 
Tried this script:

#!/usr/bin/perl
#
print "Content-Type: text/plain\n\n";
print "<html><body>Hello World</body></html>";

It works as expected in shell - I also tried putting it under another
vhost - no change, still just shows the source of the script.

what info can I contribute with? What can/should I test? 
The server is running php scripts just fine in the directories I tried
this in, and it is running my own site too.

-- 
Regards,
Klavs Klavsen, GSEC - kl@vsen.dk - http://www.vsen.dk
PGP: 7E063C62/2873 188C 968E 600D D8F8  B8DA 3D3A 0B79 7E06 3C62
See my new hosting service at http://hosting.EnableIT.dk

Working with Unix is like wrestling a worthy opponent. 
Working with windows is like attacking a small whining child 
who is carrying a .38.				

RE: [users@httpd] perl-cgi won't work with apache2

Posted by cs...@fx.ro.
Klavs,

There is one thing you didn't mention in your problem description:
- where exactly is the script your calling (full path to it).

As for debugging, I'd start to simplify configuration until it works and
then complicate it back.

Try for example a simple perl "Hello world" script, in a simple dir (created
specially for testing), in the main apache server config, no aliases, no
nothing, only the AddHandler, as plain as possible.

Bests,
Lian




> -----Original Message-----
> From: Klavs Klavsen [mailto:kl@vsen.dk]
> Sent: Saturday, June 28, 2003 3:10 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] perl-cgi won't work with apache2
>
>
> Hi guys,
>
> As I wrote about before, in a thread with this subject:
> Bug in apache (was: upgrading to apache2 madeperl-cgi not work :()
>
> my perl cgi-scripts won't work, after I upgraded to apache2 - apache
> just outputs the source of the scripts :(
>
> As I haven't changed anything (!) I can't see anything but this must be
> a bug in apache2 somehow? or perhaps the config directives has changed
> in some way? p.s. I did only copy the vhost config over - the rest is
> what came with Gentoo-Linux and apache-2.0.46.
>
> How can I debug this?
>
> the virtualhost running it looks like this:
>
> <VirtualHost x.x.x.x>
> ServerName sql-leger.domain.dk
>
> DocumentRoot /usr/local/sql-ledger/
> #DirectoryIndex index.html
> AddHandler cgi-script .pl
> #ScriptAlias /sql-ledger/ /usr/local/sql-ledger/
>
> Alias /sql-ledger/ /usr/local/sql-ledger/
> <Directory /usr/local/sql-ledger>
> Options ExecCGI Includes FollowSymlinks
> </Directory>
>
> <Directory /usr/local/sql-ledger/users>
> Options None
> </Directory>
> </VirtualHost>
>
> --
> Regards,
> Klavs Klavsen, GSEC - kl@vsen.dk - http://www.vsen.dk
> PGP: 7E063C62/2873 188C 968E 600D D8F8  B8DA 3D3A 0B79 7E06 3C62
> See my new hosting service at http://hosting.EnableIT.dk
>
> Working with Unix is like wrestling a worthy opponent.
> Working with windows is like attacking a small whining child
> who is carrying a .38.
>


---------------------------------------------------------------------
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