Search code examples
perlapachemod-perl2

mod_perl and multiple virtual hosts


We have this situation: - Apache running mod_perl - Multiple virtual hosts with own directories - Each virtual module has the same name for perl modules (development hosts, module differ a little bit, but have the same names) - Apache2::Reload for each virtual host to reload module on change

But apache throws 500 error on every 1/3 requests for the page reload and without specific error in the log, only warnings about "redefined functions".

Maybe there are some requirements to run the same module names but different paths and distinct them?


Solution

  • Here is how its done:

    NameVirtualHost 192.168.0.140
    
    <VirtualHost 192.168.0.140>
         PerlOptions +Parent
         PerlSwitches -Mlib=/path/to/application
         DocumentRoot /path/to/application
         ServerName name.domain.com
    </VirtualHost>