PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > Weird backtick problem
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Weird backtick problem

Réponse
 
LinkBack Outils de la discussion
Vieux 06/10/2006, 20h31   #1
Peter Scott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Weird backtick problem

I'm installing TWiki on a server that I don't control, and I have boiled
a bizarre problem down to this: a (Perl) program that executes a command
in backticks will work in the cgi-bin directory, but hangs in the
htdocs/wiki/bin directory. The program is no longer than

print `/bin/ls`;

(after the content-type header) and it makes no difference what the
command in the `` is. If I put anything else besides backticks in the
program it executes properly. I have a .htaccess in the wiki/bin
directory with a SetHandler cgi-script directive. The cgi-bin directory
has no .htaccess file. htdocs is a sibling of cgi-bin. mod_perl is not
running.

I got nowhere with extensive googling. There were some postings alleging
a similar problem on Windows servers but this is Linux. As a last resort
I will have to figure out how to install TWiki by moving its programs to a
cgi-bin directory out of its main tree, but I'd still like to know what
the heck is going on here. The important thing to note is that programs
*are* working in the wiki/bin directory, except for when they employ
backticks; but programs using backticks *do* work in the cgi-bin
directory. I can even run a CGI program in cgi-bin that uses
backticks of its own to executes a program in wiki/bin that also contains
backticks, and *that* works.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

  Réponse avec citation
Vieux 06/10/2006, 22h00   #2
Peter Scott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Weird backtick problem

On Fri, 06 Oct 2006 19:31:19 +0000, I wrote:
> a (Perl) program that executes a command
> in backticks will work in the cgi-bin directory, but hangs in the
> htdocs/wiki/bin directory.


Forgot to mention. This is Apache 1.3.37.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

  Réponse avec citation
Vieux 07/10/2006, 13h29   #3
Yamaska
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Weird backtick problem

Peter Scott wrote:
> On Fri, 06 Oct 2006 19:31:19 +0000, I wrote:
>> a (Perl) program that executes a command
>> in backticks will work in the cgi-bin directory, but hangs in the
>> htdocs/wiki/bin directory.

>
> Forgot to mention. This is Apache 1.3.37.
>

Not sure if I read your prob correctly, but how's about adding a script
alias for the wiki/bin.

You'll need to let apache know which dirs hold executables, otherwise
they won't work.

Hope this s

Pete
  Réponse avec citation
Vieux 08/10/2006, 17h31   #4
Peter Scott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Weird backtick problem

On Sat, 07 Oct 2006 14:29:08 +0200, Yamaska wrote:

> Peter Scott wrote:
>> On Fri, 06 Oct 2006 19:31:19 +0000, I wrote:
>>> a (Perl) program that executes a command
>>> in backticks will work in the cgi-bin directory, but hangs in the
>>> htdocs/wiki/bin directory.

>
> Not sure if I read your prob correctly, but how's about adding a script
> alias for the wiki/bin.
>
> You'll need to let apache know which dirs hold executables, otherwise
> they won't work.


My .htaccess says

SetHandler cgi-script
Options +ExecCGI

I tried putting a ScriptAlias in there and got a 500, but I don't see the
point since it is just going to point to the same directory anyway.
Remember, the programs in this directory *do run* - they just can't
execute a command in backticks.

I experimented some more. The problem is with fork(): when executed in the
cgi-bin directory, it works. But in this directory, it returns undef,
with $! set to EAGAIN (resource temporarily unavailable), which explain
the hangs on backticks, 'cos it's just going to keep trying to fork. So I
don't even have to exec() anything to have the problem.

Did some more googling to no effect. This is not running under SSL. It
happens every time. I don't see how the system can have a different limit
depending on the directory. I've looked through httpd.conf and can't see
anything weird.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h48.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11160 seconds with 12 queries