Centos 5.5 - executa scripts cgi de múltiplos locais

1

Eu quero ser capaz de executar scripts cgi de outros locais, além do / var / www / cgi-bin, exemplos:

/var/www/folder1/cgi-bin
/var/www/folder2/cgi-bin
/var/www/folder3/cgi-bin

Como faço para configurar o servidor para fazer isso?

EDITAR: Isso é para executar scripts cgi de um site no meu servidor hospedado pessoalmente.

    
por Mechaflash 21.10.2011 / 18:23

2 respostas

1

Existem duas maneiras de fazer isso:

1) Configure os virtualhosts e, sob cada host virtual, especifique ScriptAlias /cgi-bin/ "/your/location"

2) Crie subpastas em /var/www/cgi-bin e use as subpastas para vinculá-las, no entanto, com esse método, você não pode deixar a árvore de diretórios /var/www/cgi-bin .

    
por 21.10.2011 / 21:36
1

ScriptAlias é seu tio.

De: link

Description:    Maps a URL to a filesystem location and designates the target as a CGI script
Syntax: ScriptAlias URL-path file-path|directory-path
Context:    server config, virtual host
Status: Base
Module: mod_alias

The ScriptAlias directive has the same behavior as the Alias directive, except that in addition it marks the target directory as containing CGI scripts that will be processed by mod_cgi's cgi-script handler. URLs with a case-sensitive (%-decoded) path beginning with URL-path will be mapped to scripts beginning with the second argument, which is a full pathname in the local filesystem.
Example:

ScriptAlias /cgi-bin/ /web/cgi-bin/

A request for http://example.com/cgi-bin/foo would cause the server to run the script /web/cgi-bin/foo. This configuration is essentially equivalent to:

Alias /cgi-bin/ /web/cgi-bin/
<Location /cgi-bin >
SetHandler cgi-script
Options +ExecCGI
</Location> 
    
por 21.10.2011 / 18:29