You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mustafa Aldemir <m_...@tilda.com.tr> on 2008/11/12 14:01:41 UTC

Apache doesn't execute perl scripts

Hello,

I am running Apache 2 under a Debian server. I installed Awstats and 
configured it as stated in its documentation. Perl is running, I could 
update Awstats database from the console. I updated added the following 
lines to my Apache configuration, and restarted it.

When I want to enter the www.domain.com/awstats/awstats.pl the browser 
asks to download the file or open it in text editor.

Can you please help me point the problem out?

thanks,
Mustafa


AddType application/x-perl-httpd .pl
AddHandler perl-script .pl
 
LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so
LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so

<Directory "/usr/lib/cgi-bin">
  AllowOverride None
  Options FollowSymLinks +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
  SetHandler perl-script
</Directory>

Alias /awstatsclasses "/usr/share/awstats/lib/"
Alias /awstats-icon/ "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css"
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /awstats/ /usr/lib/cgi-bin/

Re: Apache doesn't execute perl scripts

Posted by Mustafa Aldemir <m_...@tilda.com.tr>.
Adam Prime wrote:
> Mustafa Aldemir wrote:
>
>>
>> AddType application/x-perl-httpd .pl
>> AddHandler perl-script .pl
>>
>> LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so
>> LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so
>>
>> <Directory "/usr/lib/cgi-bin">
>>  AllowOverride None
>>  Options FollowSymLinks +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>>  Order allow,deny
>>  Allow from all
>>  SetHandler perl-script
>> </Directory>
>>
>> Alias /awstatsclasses "/usr/share/awstats/lib/"
>> Alias /awstats-icon/ "/usr/share/awstats/icon/"
>> Alias /awstatscss "/usr/share/doc/awstats/examples/css"
>> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>> ScriptAlias /awstats/ /usr/lib/cgi-bin/
>
>
> You need:
>
> PerlHandler Apache::Registry
>
> (or one of the other CGI emulators) in your directory section.  take a 
> look at:
>
> http://perl.apache.org/docs/1.0/guide/intro.html#toc_Apache__Registry
>
> It looks like you're running mp1, so this response assumes that.
>
> Adam
>
thanks it worked after pasting these lines in the virtualhost configuration

Re: Apache doesn't execute perl scripts

Posted by Adam Prime <ad...@utoronto.ca>.
Mustafa Aldemir wrote:

> 
> AddType application/x-perl-httpd .pl
> AddHandler perl-script .pl
> 
> LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so
> LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so
> 
> <Directory "/usr/lib/cgi-bin">
>  AllowOverride None
>  Options FollowSymLinks +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>  Order allow,deny
>  Allow from all
>  SetHandler perl-script
> </Directory>
> 
> Alias /awstatsclasses "/usr/share/awstats/lib/"
> Alias /awstats-icon/ "/usr/share/awstats/icon/"
> Alias /awstatscss "/usr/share/doc/awstats/examples/css"
> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> ScriptAlias /awstats/ /usr/lib/cgi-bin/


You need:

PerlHandler Apache::Registry

(or one of the other CGI emulators) in your directory section.  take a 
look at:

http://perl.apache.org/docs/1.0/guide/intro.html#toc_Apache__Registry

It looks like you're running mp1, so this response assumes that.

Adam