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!

EA4: Apply to all virtual hosts on the system not working

Discussion in 'EasyApache' started by rahnev, Jan 26, 2017.

  1. rahnev

    rahnev Active Member

    Joined:
    Jul 6, 2016
    Messages:
    36
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    I want to apply some configuration, which to be common for all vhosts and want to include it to all of them. According EA4 documentation I have to use /etc/apache2/conf.d/userdata/$includename.conf file.

    For example I'm trying with a simple redirect rule:
    Code:
    cat /etc/apache2/conf.d/userdata/redirect.conf
    
    RewriteEngine on
    RewriteRule ^test$    http://test.com [L,R=302]
    However in http.conf configs in userdata dir are not included and configuration is not loaded. Here are all includes in http.conf
    Code:
    grep -i include /etc/apache2/conf/httpd.conf | grep -v "#"
    
    Include "/etc/apache2/conf.modules.d/*.conf"
    Include "/etc/apache2/conf.d/includes/pre_main_global.conf"
    Include "/etc/apache2/conf.d/*.conf"
    Include "/etc/apache2/conf.d/includes/account_suspensions.conf"
    Include "/etc/apache2/conf.d/includes/errordocument.conf"
    Include "/etc/apache2/conf.d/includes/pre_virtualhost_global.conf"
    Include "/etc/apache2/conf.d/includes/post_virtualhost_global.conf"
    
    Am I doing something wrong?

    Edit: It's missed in the documentation that you need to run
    Code:
    /scripts/ensure_vhost_includes --all-users
     
    #1 rahnev, Jan 26, 2017
    Last edited: Jan 26, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,629
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see you were able to address the issue. Could you let us know which document you were viewing so we can review it and open an improvement case if needed?

    Thank you.
     
    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