Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am not a regular webmaster , I am a student working on an internship project which is an Apache2 module, so my knowledge of Apache configuration is limited.

I want to configure my module for a particular sub domain of the host server.

Lets say I want my module to work only for onclick.localhost , then what are the directives required ? I want the module to be invoked only for the hosts/virtualhosts for which it has been configured explicitly.

I know how to setup sub domains in Apache, so that's not a problem.


share|improve this question

1 Answer 1

Generally httpd modules cannot be enabled per virtual host unless they provide some mechanism for doing so, such as mod_rewrite's RewriteEngine directive.

share|improve this answer
ok, as I understand that if I implement a custom directive for my module and place those directives inside <VirtualHost> section. But I don't want my module for requests to "localhost/";, it should only work for "onclick.localhost/"; , that is for hosts for which it has been configured explicitly. Will it be possible ? –  Abhinav Upadhyay Jul 22 '10 at 15:56
@Abhinav: That you're still asking that question is proof that you didn't read my answer enough times. –  Ignacio Vazquez-Abrams Jul 22 '10 at 16:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.