Jump to content

Module Config Virtual Host


apacheguy

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/196086-module-config-virtual-host/
Share on other sites

  • 2 weeks later...

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.

 

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>

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 />

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.