# Perl\_modules directive is not allowed

**URL:** <https://www.ruby-forum.com/t/perl-modules-directive-is-not-allowed/199171>\
**Category:** NGINX\
**Created:** [November 16, 2010, 4:35am UTC](https://www.ruby-forum.com/t/perl-modules-directive-is-not-allowed/199171 "2010-11-16T04:35:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 16, 2010, 4:35am UTC](https://www.ruby-forum.com/t/perl-modules-directive-is-not-allowed/199171/1 "2010-11-16T04:35:52Z")

</div>

Environment: ubuntu10:10 nginx0.8.53

nginx compile parameters:  
nginx version: nginx/0.8.53  
built by gcc 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)  
TLS SNI support enabled  
configure arguments: --user=www-data --group=www-data --prefix=/usr  
–conf-path=/etc/nginx/nginx.conf  
–error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid  
–lock-path=/var/lock/nginx.lock  
–http-log-path=/var/log/nginx/access.log  
–http-client-body-temp-path=/var/lib/nginx/body  
–http-proxy-temp-path=/var/lib/nginx/proxy  
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug  
–with-http\_stub\_status\_module --with-http\_flv\_module  
–with-http\_ssl\_module --with-http\_dav\_module  
–with-http\_gzip\_static\_module --with-http\_realip\_module --with-mail  
–with-mail\_ssl\_module --with-ipv6 --with-http\_perl\_module  
–with-sha1=/usr/lib  
–add-module=/var/lib/gems/1.8/gems/passenger-3.0.0/ext/nginx

nginx site profile:

server {  
listen 80;  
server\_name [hg.abc.net](http://hg.abc.net);  
perl\_modules /redmine/extra/svn;  
perl\_require Redmine.pm;

location / {  
root /repos;  
uwsgi\_passunix:///dev/shm/hgweb.sock;  
include uwsgi\_params;  
uwsgi\_param SCRIPT\_NAME /;

```
                auth_basic "HG Repository";
                Perl Redmine::access_handler;
                Perl Redmine::authen_handler;
           }
   }

```

Run the command: nginx -t  
Error log:  
[emerg]: “perl\_modules” directive is not allowed here in  
/etc/nginx/sites-enabled/hg\_repos:4  
configuration file /etc/nginx/nginx.conf test failed

Who can tell me how to deal with the problem?

Posted at Nginx Forum:

> **[perl\_modules directive is not allowed](https://forum.nginx.org/read.php?2,151088,151088#msg-151088)**
>
> Environment: ubuntu10:10 nginx0.8.53 nginx compile parameters: nginx version: nginx/0.8.53 built by gcc 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) TLS SNI support enabled configure arguments: --user=www-data --group=www-data --prefix=/usr...

---

<div class="post-metadata">

**Author:** ![ronin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ad7895/32.png) [@ronin](https://www.ruby-forum.com/u/ronin)\
**Post date:** [November 16, 2010, 8:12am UTC](https://www.ruby-forum.com/t/perl-modules-directive-is-not-allowed/199171/2 "2010-11-16T08:12:11Z")

</div>

I have solved the problem  
move:  
perl\_modules /redmine/extra/svn;  
perl\_require Redmine.pm;  
to :/etc/nginx/nginx.conf

But redmine.pm still can not load successfully, error message is:

[emerg]: require\_pv(“Redmine.pm”) failed: "Can’t locate  
Apache2/Module.pm in @INC (@INC contains: /usr/perl/lib /etc/perl  
/usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5  
/usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10  
/usr/local/lib/site\_perl .) at /usr/perl/lib/Redmine.pm line 106.  
BEGIN failed–compilation aborted at /usr/perl/lib/Redmine.pm line 106.

Posted at Nginx Forum:

> **[Re: perl\_modules directive is not allowed](https://forum.nginx.org/read.php?2,151088,151102#msg-151102)**
>
> Environment: ubuntu10:10 nginx0.8.53 nginx compile parameters: nginx version: nginx/0.8.53 built by gcc 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) TLS SNI support enabled configure arguments: --user=www-data --group=www-data --prefix=/usr...

---

<div class="post-metadata">

**Author:** ![ronin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ad7895/32.png) [@ronin](https://www.ruby-forum.com/u/ronin)\
**Post date:** [November 16, 2010, 8:40am UTC](https://www.ruby-forum.com/t/perl-modules-directive-is-not-allowed/199171/3 "2010-11-16T08:40:23Z")

</div>

I saw inside the file like this:  
use Apache2:: Module;  
use Apache2:: Access;  
use Apache2:: ServerRec qw ();  
use Apache2:: RequestRec qw ();  
use Apache2:: RequestUtil qw ();  
use Apache2:: Const qw (: common: override: cmd\_how);  
use APR:: Pool ();  
use APR:: Table ();

# Use Apache2:: Directive qw ();

Nginx is kind of how does the corresponding statement?

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,151088,151107#msg-151107](http://forum.nginx.org/read.php?2,151088,151107#msg-151107)
