Skip to main content

How to disable VirtualHost creation for a specific domain?

Comments

5 comments

  • cPanelPeter cPanel Staff
    Hello, You should probably try using the VirtualHost configuration section instead. This can be created under: /usr/local/apache/conf/userdata/std/2_x/$USER/$domain.conf (x is either 2 or 4 (depending on your version of Apache)
    Documentation on this is Modify Virtualhost Containers With Include Files.
    0
  • pkiula
    Thank you. But in my server the '.../userdata/2.2" does not exist. Should I just create that folder, and put a file in there?
    0
  • Shavaun
    That is correct, you must create the directories.
    0
  • pkiula
    This is an include file. Which means the VirtualHost will be created for this domain in the httpd.conf, and my specified custom include file will be included in that VirtualHost. This is not what I want: [QUOTE]Includes are the last directives in each virtualhost container. A directive or value that is in an include file will override any value that exists in the primary configuration file.
    What I want is that for the VirtualHost for one domain to be *entirely* created from a file. Not to have a VirtualHost created, and only an include file included at the end of it. How to do that? (The other option is to create a "Custom Template" for *all* virtualhosts, which is also *not* what I'm looking for. )
    0
  • cPanelMichael
    Hello :) Would a custom template that is applied to a single VirtualHost be of help? That is documented here: How to create a custom template that will apply to a single virtual host Thank you.
    0

Please sign in to leave a comment.