The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom Vhost Question

Discussion in 'General Discussion' started by edigest, Feb 19, 2014.

  1. edigest

    edigest Active Member

    Joined:
    Nov 24, 2010
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    S. Pole
    cPanel Access Level:
    Root Administrator
    I setup a global custom vhost configuration (following guidance in Changes Contained Within a VirtualHost Directive). Works great.

    There is a problem with one item in the custom configuration on one domain. I tried to setup the vhost configuration for that domain using guidance in "Custom templates that will apply to a single virtual host" but the behavior in the "Custom templates that will apply to all virtual hosts" section is overriding the "single vhost" changes.

    Is there a way to either remove a single domain from the "apply to all" configuration or to modify the single domain in such a way that removes or modifies the "apply to all" configuration for one domain?

    If the question is too broad, I can post a specific example.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Have you tried leaving the "Custom template that will apply to all virtual hosts" in-place and then making the individual VirtualHost change directly in the httpd.conf file? You would then run the Apache distiller to preserve that change.

    Thank you.
     
  3. edigest

    edigest Active Member

    Joined:
    Nov 24, 2010
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    S. Pole
    cPanel Access Level:
    Root Administrator
    I did try creating a custom vhost for the domain, but had not tried editing /usr/local/apache/etc/httpd.conf directly.

    Your solution does work, though.

    To anyone else for whom this info might help, you will have to redo the changes in httpd.conf whenever you run scripts/rebuildhttpdconf. Other than that, an acceptable solution.

    Thanks, Michael!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Is this the case even after using the Apache distiller?

    Thank you.
     
  5. edigest

    edigest Active Member

    Joined:
    Nov 24, 2010
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    S. Pole
    cPanel Access Level:
    Root Administrator
    Yes. After making the edit to /usr/local/apache/etc/httpd.conf I made another change to /var/cpanel/templates/apache2/vhost.local (which is where I add custom config that I want to apply to all websites) and then ran /scripts/rebuildhttpdconf to apply that change. The edit to httpd.conf for the special needs domain was lost.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  7. edigest

    edigest Active Member

    Joined:
    Nov 24, 2010
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    S. Pole
    cPanel Access Level:
    Root Administrator
    Ah, OK. It looks like you're saying I can use /usr/local/cpanel/bin/apache_conf_distiller --update instead of /scripts/rebuildhttpdconf when I make changes to /var/cpanel/templates/apache2/vhost.local.

    That did not work for me before but I will give it a try again.

    Thanks!
     
Loading...

Share This Page