# Apache mpm_worker + mod+perl



## setevoy (Jul 26, 2013)

Hi.

A long-long time ago I installed Apache with:

`# httpd -V`

```
Server version: Apache/2.2.25 (FreeBSD)
Server built:   Jul 26 2013 09:41:33
Server's Module Magic Number: 20051115:33
Server loaded:  APR 1.4.8, APR-Util 1.5.2
Compiled using: APR 1.4.8, APR-Util 1.5.2
Architecture:   64-bit
Server MPM:     Worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr/local"
 -D SUEXEC_BIN="/usr/local/sbin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="etc/apache22/mime.types"
 -D SERVER_CONFIG_FILE="etc/apache22/httpd.conf"
```

`# httpd -l`

```
Compiled in modules:
  core.c
  worker.c
  http_core.c
  mod_so.c
```

Now - I tried to add mod_perl, but got errors:

`# cd /usr/ports/www/mod_perl2/ && make install clean`

```
...
Configuring Apache/2.2.25 mod_perl/2.0.8 Perl/v5.14.4
[  error] Using Perl 5.014004 w/o ithreads and 'worker' mpm httpd.
[  error] Failed requirements:
[  error]   - Perl built with ithreads (build perl with -Duseithreads)

*** Error code 1

Stop in /usr/ports/www/mod_perl2.
```

I'm not sure I really understand the problem...

Can somebody please give me few tips?  Thanks.


----------



## cpm@ (Jul 27, 2013)

Quoted from http://perl.apache.org/docs/2.0/user/install/install.html#Prerequisites:


> you must rebuild Perl without threads enabled or with -Dusethreads. Remember that threads-support slows things down and on some platforms it's unstable (e.g., FreeBSD), so don't enable it unless you really need it.



So be sure that you compiled lang/perl5.14 with THREADS option disabled.


----------



## setevoy (Jul 27, 2013)

cpu82 said:
			
		

> So be sure that you compiled lang/perl5.14 with THREADS option disabled.



Well, here is my current Perl:

`# make showconfig`

```
===> The following configuration options are available for perl-5.14.4:
     DEBUG=off: Install debug symbols
     GDBM=off: GDBM_File extension
     MULTIPLICITY=off: Use multiplicity
     PERL_64BITINT=on: Use 64 bit integers (on i386)
     PERL_MALLOC=off: Use Perl malloc
     PTHREAD=on: Build with -pthread
     SITECUSTOMIZE=off: Run-time customization of @INC
     [B]THREADS=off: Build threaded perl[/B]
     USE_PERL=on: Rewrite links in /usr/bin
```

`# perl -v`


```
This is perl 5, version 14, subversion 2 (v5.14.2)
```

Have I correctly understood you that config must be with THREADS=off?


----------



## setevoy (Jul 27, 2013)

It seems to me I understood my mistake...



> > So be sure that you compiled lang/perl5.14 with THREADS option disabled.



This is correct for Apache Prefork - but not for Apache with mpm_worker, because Worker *USE* threads instead of Prefork, wich use only processes...

Am I right, guys?


----------



## cpm@ (Jul 27, 2013)

Is correct. According to the mod_perl manual, in your case, you need a threaded Perl.


----------



## setevoy (Jul 27, 2013)

I'll install same configuration on a virtual machine first, if everything will be OK - I'll change the topic to Solved 

Thanks, @cpu82.

By the way - will that reconfiguration of Perl have any influence on other system tools/parts?


----------



## cpm@ (Jul 27, 2013)

setevoy said:
			
		

> By the way - will that reconfiguration of Perl have any influence on other system tools/parts?



To ensure everything is recompiled against the new threaded Perl, just run `# portmaster -r perl` or `# portupgrade -rf perl` or `# pkg install -fR perl` according to the ports manager tool that uses.

http://lists.freebsd.org/pipermail/freebsd-questions/2011-May/230286.html.


----------



## setevoy (Jul 27, 2013)

Thanks again 

`# portupgrade -rfb perl*`

will be enought, I think.


----------

