Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have installed via synaptic package ibapache2-mod-perl2. I tried this line in httpd.conf: "LoadModule perl_module modules/mod_perl.so" Apache tells me when I reload the server : "[warn] module perl_module is already loaded, skipping". Well ok, but when i try to look in the browser to a repertory i don't have access .Apache send me the error :

Forbidden
You don't have permission to access /cgi-bin/ on this server.
Apache/2.2.14 (Ubuntu) Server at 192.168.0.10 Port 90

But this should show modperl is installed and that's not the case...

I would like my virtual host that follows run with mod_perl2

<VirtualHost v1:80>
    ServerAdmin webmaster@localhost
    ServerName v1

    DocumentRoot /var/www/v1
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/v1/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /var/www/v1/cgi-bin/
    <Directory "/var/www/v1/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

I'd like to know how to configure mod_perl2. Do i have to change something in the apache configuration file to make my cgi repertory works with mod_perl2? Thanks to any help!

share|improve this question

2 Answers 2

Do i have to change something in the apache configuration file to make my cgi repertory works with mod_perl2?

mod_perl2 work well. Apache can't invoke directory as script.

To test create(/var/www/v1/cgi-bin/test.pl):

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Test";

And try "/cgi-bin/test.pl".

share|improve this answer
    
Yep I know Apache can't invoke directory script. But it was to test if mod_perl was installed. Apache should show a line as this : Apache/2.2.15 (Unix) mod_perl/2.0.4 Perl/v5.8.8 I think I need to configure httpd.conf but i don't know because there is a lot of tutorials on mod_perl 1 but not for mod_perl 2. How to test if mod_perl is well installed on Apache2? Thanks –  ZheFrench Feb 2 '11 at 8:39

It looks like your problem is related to user permissions. MAKE SURE that the scripts you are trying to run as CGI scripts are EXECUTABLE by all users or the users which should be executing them ie:

chmod a+x /var/www/v1/cgi-bin/test.pl

it's important to realize that the scripts you want to run must have "x" permission bit set - along with "r" (read).

share|improve this answer
    
It's also important that apache can enter every directory in the path up to cgi-bin. So chmod a+x for each directory in the path. –  Jenny D Feb 19 '13 at 13:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.