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.

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:
    30
    Likes Received:
    1
    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:
    37,086
    Likes Received:
    1,288
    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.
     
Loading...

Share This Page