Apache2 com Perl

1 – Instale os pacotes necessarios

apt-get install apache2 libapache2-mod-perl2
apt-get install libfcgi-perl libapache2-mod-speedycgi

2 – Edite o arquivo /etc/apache2/apache2.conf e adicione a linha:

vi /etc/apache2/apache2.conf

AddHandler cgi-script .cgi .pl

3 – Edite o arquivo /etc/apache2/sites-available/default e as linha:

vi /etc/apache2/sites-available/default

Options +ExecCGI

4 – Reinicie o apache2

/etc/init.d/apache2 restart

5 – Crie um arquivo de teste, em seguida tente executá-lo no servidor.

vi /var/www/site/cgi-bin/teste.pl
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print "Hello, World.";

+ SOBRE APACHE E CGI: http://httpd.apache.org/docs/2.0/howto/cgi.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s