Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Problem with vhosts include file

Discussion in 'EasyApache' started by Troncaa, Jan 15, 2018.

  1. Troncaa

    Troncaa Registered

    Joined:
    Jan 15, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Montreal
    cPanel Access Level:
    Root Administrator
    I have change /etc/apache2/conf.d/includes/pre_main_global.conf to add this block:

    <IfModule LiteSpeed>
    LiteMage Off
    </IfModule>

    Which works good, with this, I disabled LiteMage for all users.

    Now I want to enable it for a specific account, account name is blipblop,

    so I create 2 files:
    /etc/apache2/conf.d/userdata/std/2_4/blipblop/litemage.conf
    and
    /etc/apache2/conf.d/userdata/ssl/2_4/blipblop/litemage.conf

    both with this content:

    <IfModule LiteSpeed>
    LiteMage On
    </IfModule>

    But it's like the file is not read or not process, LiteMage will still be disabled for this account, I have reload and restart the service but still wont process this code...

    Why is my account .conf file not working?

    Thank you
     
  2. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Hi,

    Could you verify that the userdata include is enabled? You can open of up '/etc/apache2/conf/httpd.conf' and verify the `Include "/etc/apache2/conf.d/userdata/' statement is not commented out for the desired vhost; the command below should also show which userdata includes are uncommented for each vhost:
    Code:
    # awk '/^<VirtualHost /{f=1;getline;servername=$2}/^(\s+)Include \"\/etc\/apache2\/conf.d\/userdata/{if (f=1) print servername,$0}/<\/VirtualHost>/{f=0}' /etc/apache2/conf/httpd.conf
    cptest.tld   Include "/etc/apache2/conf.d/userdata/std/2_4/cptest/*.conf"
    cptest.tld   Include "/etc/apache2/conf.d/userdata/std/2_4/cptest/cptest.tld/*.conf"
    
    Thanks,
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Troncaa

    Troncaa Registered

    Joined:
    Jan 15, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Montreal
    cPanel Access Level:
    Root Administrator
    Hi,

    The only include in each vhost is Include "/etc/apache2/conf.d/userdata/*.conf", I dont see any include commented out, running your command also confirm that this is the only include in the vhost.

    Is this is something missing in my cpanel configuration? shouldn't I have by default the include in vhost file for
    Include "/etc/apache2/conf.d/userdata/std/2_4/cptest/*.conf" and
    Include "/etc/apache2/conf.d/userdata/std/2_4/cptest/cptest.tld/*.conf"?

    Thanks
     
  4. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    The includes are uncommented dynamically on rebuild of the Apache configuration should the file be present. I just wanted to be sure that includes were properly enabled in the Apache configuration. If you received output from that command for the specified domain, then that should mean it's been properly enabled in Apache configuration.

    This should work for you. How are you testing? Is the domain behind any CDN or proxy? Are you using any custom Apache templates?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Troncaa

    Troncaa Registered

    Joined:
    Jan 15, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Montreal
    cPanel Access Level:
    Root Administrator
    Hi,

    I have no CDN or proxy, I'm using litespeed server to serve http, but litespeed use the apache config files so it shouldn't matter.

    As I said only include I have in my vhost is for /etc/apache2/conf.d/userdata/*.conf, do I need to run the rebuild in order to add the new file I added under /etc/apache2/conf.d/userdata/std/2_4/blipblop/litemage.conf? Can I rebuild from WHM or do I need to use the command Line?
     
  6. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Any time you create or remove a userdata file, you must rebuild the Apache configuration. I thought from your previous comment that you were implying that the include was present.

    Please re-read the documentation to gain a better understanding of the includes file path structure:
    Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation

    When you run that awk command, take the include file that was returned, and 'ls' or 'cat' the include:
    Code:
    # awk '/^<VirtualHost /{f=1;getline;servername=$2}/^(\s+)Include \"\/etc\/apache2\/conf.d\/userdata/{if (f=1) print servername,$0}/<\/VirtualHost>/{f=0}' /etc/apache2/conf/httpd.conf
    cptest.tld   Include "/etc/apache2/conf.d/userdata/std/2_4/cptest/cptest.tld/*.conf"
    
    # ls /etc/apache2/conf.d/userdata/std/2_4/cptest/cptest.tld/*.conf
    /etc/apache2/conf.d/userdata/std/2_4/cptest/cptest.tld/testing.conf
    
    If you receive 'No such file or directory', there is an issue; otherwise, if you see your configuration, there is no issue with updating the Apache configuration with the include file.

    How are you testing this?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Troncaa

    Troncaa Registered

    Joined:
    Jan 15, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Montreal
    cPanel Access Level:
    Root Administrator
    It's working now, ran the rebuild and now it's in,

    Thank you
     
  8. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice