Skip to main content

Promote particular user's Apache VirtualHost to default

Comments

7 comments

  • cPanelMichael
    Hello, The following thread should help:
    0
  • eggyal
    Thanks cPanelMichael"but following that suggestion appears, to me, to provide little benefit over that I proposed in my question: either way, the arising default VirtualHost configuration will be "detached" from the user's VirtualHost that is managed by WHM. Is there no way that the "default" vhost can be that of a user, as managed by WHM?
    0
  • cPanelMichael
    Yes, you could simply manually modify the position of the VirtualHost in /usr/local/apache/conf/httpd.conf and distill the changes via:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    Thank you.
    0
  • terabit
    I am also trying to reorder the virtualhosts in my httpd.conf but using apache_conf_distiller --update does not seem to preserve their order at all. My problem is that cpanel keeps rebuilding the config with the wildcard defined first and which makes apache ignore the explicitly named sub domain that is being defined after the wildcard... I need to be able to force cpanel to define multiple virtualhosts before the wildcard host. Should "apache_conf_distiller --update" be working for this? I don't see any indication in the documentation saying that it would. It seems to only save settings not the order that they are in.
    ServerName domain.com ServerAlias *.domain.com www.domain.com etc... ServerName blog.domain.com ServerAlias www.blog.domain.com etc... ServerName blog2.domain.com ServerAlias www.blog2.domain.com
    etc...
    0
  • cPanelMichael
    Hello, You could try the instructions in the following post:
    0
  • terabit
    0
  • cPanelMichael
    Right, it's a method to change the default virtualhost for each IP address, but it won't allow you to set a specific order. You may want to consider submitting a feature request for a method to change the order of your VirtualHosts, as mentioned here:
    0

Please sign in to leave a comment.