# Build Apache with static modules



## Mayhem30 (Aug 24, 2012)

How can I build Apache v2.2 with static modules?

I'm using the ports system and not compiling via command line.

The only info I can find is "--enable-module=static" - but I'm not sure how that would translate in to the make.conf file.

Also, I'm assuming after Apache has been compiled with the modules statically, I need to comments out the module reference lines in the httpd.conf file?

Any assistance would be appreciated.


----------



## julp (Aug 24, 2012)

Take a look at Makefile.doc of the port.

It can be done, by hand, eg:

```
make install \
    WITHOUT_APACHE_OPTIONS=yes \
    WITH_MODULES="authz_host actions alias cgi charset_lite deflate dir env expires headers log_config logio mime mime_magic negotiation setenvif unique_id vhost_alias filter ssl rewrite userdir" \
    WITH_STATIC_MODULES="authz_host actions alias cgi charset_lite deflate dir env expires headers log_config logio mime mime_magic negotiation setenvif unique_id vhost_alias filter"
```


----------



## Mayhem30 (Aug 24, 2012)

If I were to add this to my make.conf file, would this be the correct syntax?


```
.if ${.CURDIR}=="/usr/ports/www/apache22"
WITHOUT_APACHE_OPTIONS=yes
WITH_MODULES=auth_basic authn_file authz_host authz_user alias deflate dir env expires headers log_config logio mime rewrite setenvif
WITH_STATIC_MODULES=auth_basic authn_file authz_host authz_user alias deflate dir env expires headers log_config logio mime rewrite setenvif
.endif
```

Also, is it possible to build these in statically as well?


```
LoadModule rpaf_module libexec/apache22/mod_rpaf2.so
LoadModule php5_module libexec/apache22/libphp5.so
```

I'm assuming I would just need to add "rpaf php5" to the modules list?


----------



## julp (Aug 25, 2012)

My apologies, I am wrong:

 WITHOUT_APACHE_OPTIONS does not exist anymore. It was an option to skip the make config step.
 Despite WITH_MODULES, it seems that some additionnal modules are added. You have not full control of the build as earlier.



			
				Mayhem30 said:
			
		

> Also, is it possible to build these in statically as well?


As far I know, not with (standard) ports. And it sould be quite unmanageable, I guess.


----------

