apacheguy Posted March 22, 2010 Share Posted March 22, 2010 Hello folks, My question concerns the implementation of modules using virtual hosts. Is there a way to make a module apply to a specific virutal host and not the others? Simply placing the code inside the virtual host doesn't seem to work. Maybe I'm missing something. So just to clarify I'll provide an example. Let's say I want mod_xyz to be enabled for www.server.com but not ftp.server.com. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/196086-module-config-virtual-host/ Share on other sites More sharing options...
trq Posted March 22, 2010 Share Posted March 22, 2010 You will likely need to append your configuration options within a <Directory> directive. What module is it exactly your trying to do this with? Quote Link to comment https://forums.phpfreaks.com/topic/196086-module-config-virtual-host/#findComment-1029864 Share on other sites More sharing options...
apacheguy Posted April 1, 2010 Author Share Posted April 1, 2010 thorpe, thanks for your reply. The module I am attempting to implement is mod_dosevasive, which can be download at apachelounge. I can enable to module by adding this line to httpd.conf: LoadModule dosevasive22_module modules/mod_dosevasive22.dll Simply enabling this module without any additional configuration seems to kick in default protection values. What I have attempted to do is configure the module within a virtual host. ex: <VirtualHost *:80> ... <IfModule dosevasive22_module> DOSHashTableSize 3097 DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 </IfModule> </VirtualHost> The idea being that dosevasive only remain active for this virtual host. The reason is we have scripts that generate legitimate queries on another virtual host, however the queries are tripping the dosevasive counter. So the question now is how to enable dosevasive for vhost 1 but not vhost 2. Quote Link to comment https://forums.phpfreaks.com/topic/196086-module-config-virtual-host/#findComment-1035085 Share on other sites More sharing options...
trq Posted April 1, 2010 Share Posted April 1, 2010 Like I said, I would try placing the directives within a <Directory> directive. <Directory /> <IfModule dosevasive22_module> DOSHashTableSize 3097 DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 </IfModule> </Directory> Quote Link to comment https://forums.phpfreaks.com/topic/196086-module-config-virtual-host/#findComment-1035092 Share on other sites More sharing options...
apacheguy Posted April 1, 2010 Author Share Posted April 1, 2010 Ok, I see what you're saying. When I include the code in your previous post inside of my virtual host, apache returns the following error: DOSHashTableSize not allowed here I'm assuming this means that you can't configure modules inside of <Directory /> Quote Link to comment https://forums.phpfreaks.com/topic/196086-module-config-virtual-host/#findComment-1035430 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.