Linux – Installing mod_proxy for apache on Gentoo

apache-2.2gentoolinux

I just switched over to working with a gentoo server, and am having problems installing apache with mod_proxy. I've gone over many of the documents for using the USE command but haven't figured out how to recompile Apache with mod_proxy support.

To be clear I have apache installed but mod_proxy is currently not available in my modules folder. The apache modules which I get when trying

emerge -pv apache

APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 0 kB

Best Answer

I tried following unixbhaskar's advice however it still compiled apache without the proxy modules, however I found instead of using USE but setting APACHE2_MODULEs:

APACHE2_MODULES="proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" emerge -av apache

Successfully installed apache with the mod_proxy modules in the appropriate /usr/lib/apache/modules folder.