Integração Apache / ASP

Hoje é possível integrar ao servidor Apache os códigos ASP (Active Server Page). Agora você pode facilmente fazer isso e ainda tem a vantagem de utilizar software livre. O Apache-ASP, fornece páginas ativas para um usuário utilizando o servidor Apache com o Perl. Esse software permite que um colaborador crie aplicações dinâmicas com códigos inseridos do Perl.

[ Hits: 16.207 ]

Por: Ricardo em 29/01/2008


Introdução



Softwares necessários

Segue abaixo a lista de softwares que deverão ser instalados.

Apache 1.3.29
http://ftp.pucpr.br/apache/httpd/apache_1.3.29.tar.gz

Perl v. 5.6.1 - 34.99.6
ftp://ftp.cpan.org/pub/CPAN/src/perl-5.9.0.tar.gz

MLDBM
http://www.cpan.org/authors/id/C/CH/CHAMAS/MLDBM-2.01.tar.gz

MLDBM-Sync-0.30
http://www.cpan.org/authors/id/C/CH/CHAMAS/MLDBM-Sync-0.30.tar.gz

Apache-ASP
http://www.cpan.org/authors/id/C/CH/CHAMAS/Apache-ASP-2.57.tar.gz

Instalação

Depois de efetuado o download, descompacte os arquivos em um diretório com os comandos:

# tar zxvf apache_1.3.29.tar.gz
# tar zxvf perl-5.9.0.tar.gz
# tar zxvf MLDBM-2.01.tar.gz
# tar zxvf MLDBM-Sync-0.30.tar.gz
# tar zxvf Apache-ASP-2.57.tar.gz


OBS.: Recomendo que utilizei o "PERL" que acompanha o CD da distribuição.

# mount /mnt/cdrom
# rpm -ivh /mnt/cdrom/Redhat/RPMS/perl-X.X.X


Para a instalação dos softwares, é necessário que eles sejam compilados separadamente um a um. Para fazer isso, execute os seguintes passos:

MLDBM-2.01:

Entre na pasta do aplicativo e execute os seguintes comandos para compilação:

# cd /usr/local/MLDBM-2.01

Compilação do MLDBM:

# perl Makefile.PL
# make test
# make install


MLDBM-Sync-0.30:

Entre na pasta criada a partir da descompactação do MLDBM-Sync-0.30.tar.gz. Execute os seguintes comandos para compilação:

# perl Makefile.PL
# make
# make test
# make install


Mod_Perl:

Entre na pasta do mod_perl-1.27 e execute os comandos:

# perl Makefile.PL

O Makefile.PL irá procurar o código-fonte do Servidor Apache para suas devidas configurações. O sistema irá perguntar:

Configure mod_perl with ..../apache_1.3.29/src ? [y]. Aperte a tecla y
Shall I build httpd in .../apache_1.3.29/src for you? [y] Responda novamente y

# make
# make test
(opcional)
# make install

Depois de executados esses comandos, será gerada a pasta perl dentro do diretório apache_1.3.29/src/modules.

Compilando o Apache

Dentro do mesmo diretório execute os comandos:

# perl Makefile.PL
# APACHE_SRC=../apache-1.3.29/src DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
# make test
# make install


Compilando o servidor Apache:

Entre no diretório apache_1.3.29/src e execute o comando:

# sh Configure
# make


Entre no diretório apache_1.3.29 e execute:

# sh configure --prefix=/usr/local/apache --activate module=src/modules/perl/libperl.a

Com esse comando você estará configurando o Apache para ser instalado em /usr/local/apache com suporte a mod_perl:

# make
# make install


Instalado o servidor Web, entre no diretório /usr/local/apache/bin e levante o servidor apache com o seguinte comando:

# sh apachectl start

Seu servidor Web está no ar. Para testar se o módulo mod_perl está corretamente instalado, execute o comando:

# lynx -dump -head http://localhost

A saída do comando retorna a página de teste. O importante é a 3 linha no qual mostra se o Servidor Apache tem suporte para mod_perl.

Instalação do Apache-ASP:

Entre no diretório Apache-ASP-2.57 e execute o seguinte comando:

# perl Makefile.PL
# make
# make test
# make install


OBS.: Os módulos MLDBM e MLDBM-Sync são necessários para instalação do Apache-ASP.

    Próxima página

Páginas do artigo
   1. Introdução
   2. Apache
Outros artigos deste autor
Nenhum artigo encontrado.
Leitura recomendada

Acesso remoto para principiantes

Conceito de NAT detalhadamente

Criando relatórios estatísticos da web com o awstats

Os navegadores "leves" que de leves não tem nada

Instalação do WordPress no CentOS 7

  
Comentários
[1] Comentário enviado por diegolc2009 em 30/04/2008 - 08:36h

Não consegui configurar o apache no meu sistema. Quando chega aqui
Entre na pasta do mod_perl-1.27 e execute os comandos:
# perl Makefile.PL

e dou o comando make, o apache parece não estar istalado e deste ponto não passa.

[2] Comentário enviado por diegolc2009 em 30/04/2008 - 13:29h

Olha só o erro que está dando, não sei o que pode ser...

root@acesso-desktop:/usr/local/mod_perl-1.27# perl Makefile.PL
************* WARNING *************

Your Perl is configured to link against libgdbm,
but libgdbm.so was not found.
You could just symlink it to /usr/lib/libgdbm.so.3.0.0


************* WARNING *************
Configure mod_perl with ../apache_1.3.29/src ? [y] y
Shall I build httpd in ../apache_1.3.29/src for you? [y] y
Appending mod_perl to src/Configuration
Using config file: /usr/local/mod_perl-1.27/src/Configuration
Creating Makefile
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to NOT-AVAILABLE
+ using "tr [a-z] [A-Z]" to uppercase
+ checking for system header files
+ adding selected modules
+ using builtin Expat
+ checking sizeof various data types
+ doing sanity check on compiler and options
** A test compilation with your Makefile configuration
** failed. The below error output from the compilation
** test will give you an idea what is failing. Note that
** Apache requires an ANSI C Compiler, such as gcc.

======== Error Output for sanity check ========
cd ..; gcc -DLINUX=22 -DUSE_HSREGEX -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED -D_REENTRANT -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DMOD_PERL -o helpers/dummy helpers/dummy.c `/usr/bin/perl /usr/local/mod_perl-1.27/src/modules/perl/ldopts ` -lm
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make: *** [dummy] Error 1
============= End of Error Report =============

Aborting!
PerlDispatchHandler.........disabled (enable with PERL_DISPATCH=1)
PerlChildInitHandler........enabled
PerlChildExitHandler........enabled
PerlPostReadRequestHandler..disabled (enable with PERL_POST_READ_REQUEST=1)
PerlTransHandler............disabled (enable with PERL_TRANS=1)
PerlHeaderParserHandler.....disabled (enable with PERL_HEADER_PARSER=1)
PerlAccessHandler...........disabled (enable with PERL_ACCESS=1)
PerlAuthenHandler...........disabled (enable with PERL_AUTHEN=1)
PerlAuthzHandler............disabled (enable with PERL_AUTHZ=1)
PerlTypeHandler.............disabled (enable with PERL_TYPE=1)
PerlFixupHandler............disabled (enable with PERL_FIXUP=1)
PerlHandler.................enabled
PerlLogHandler..............disabled (enable with PERL_LOG=1)
PerlInitHandler.............disabled (enable with PERL_INIT=1)
PerlCleanupHandler..........disabled (enable with PERL_CLEANUP=1)
PerlRestartHandler..........disabled (enable with PERL_RESTART=1)
PerlStackedHandlers.........disabled (enable with PERL_STACKED_HANDLERS=1)
PerlMethodHandlers..........disabled (enable with PERL_METHOD_HANDLERS=1)
PerlDirectiveHandlers.......disabled (enable with PERL_DIRECTIVE_HANDLERS=1)
PerlTableApi................disabled (enable with PERL_TABLE_API=1)
PerlLogApi..................disabled (enable with PERL_LOG_API=1)
PerlUriApi..................disabled (enable with PERL_URI_API=1)
PerlUtilApi.................disabled (enable with PERL_UTIL_API=1)
PerlFileApi.................disabled (enable with PERL_FILE_API=1)
PerlConnectionApi...........enabled
PerlServerApi...............enabled
PerlSections................disabled (enable with PERL_SECTIONS=1)

PerlSSI.....................disabled (enable with PERL_SSI=1)

Will run tests as User: 'nobody' Group: 'root'
Checking CGI.pm VERSION..........ok
Checking for LWP::UserAgent......ok
Checking for HTML::HeadParser....ok
Checking if your kit is complete...
Looks good
Writing Makefile for Apache
Writing Makefile for Apache::Connection
Writing Makefile for Apache::Constants
Writing Makefile for Apache::File
Writing Makefile for Apache::Leak
Writing Makefile for Apache::Log
Writing Makefile for Apache::ModuleConfig
Writing Makefile for Apache::PerlRunXS
Writing Makefile for Apache::Server
Writing Makefile for Apache::Symbol
Writing Makefile for Apache::Table
Writing Makefile for Apache::URI
Writing Makefile for Apache::Util
Writing Makefile for mod_perl
root@acesso-desktop:/usr/local/mod_perl-1.27# make
(cd ../apache_1.3.29/src && PERL5LIB=/usr/local/mod_perl-1.27/lib: make CC="cc";)
make[1]: Entrando no diretório `/usr/local/apache_1.3.29/src'
make[1]: *** Sem alvo. Pare.
make[1]: Saindo do diretório `/usr/local/apache_1.3.29/src'
make: ** [apache_httpd] Erro 2

[3] Comentário enviado por yetlinux em 14/05/2009 - 20:32h

Esta não é aquela implementação de ASP usando classes Perl muito parecidas com ASP?
Não é ASP puro.


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts