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

 

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.