Apache errors folder and alias

Discussion in 'Installation/Configuration' started by TonyG, Nov 7, 2020.

  1. TonyG

    TonyG Active Member

    I'm sorry if this is documented somewhere and I've missed it. I've done forum searches, etc, old and invalid posts here go back over a decade, and I still need to ask...

    I want to use custom error messages for sites, but each site has different requirements. In all .vhost files the default is :
    Code:
    Alias /error/ "/var/www/example.com/subdomain_root/error"
    But in my setup there is no symlink under /var/www for any of the sites. This is intentional because I don't want to clutter the /var/www folder with subfolders that are both site references and not. The document root for sites is /var/www/clouds/cloud_clientID/site_siteID.

    In code I see these lines...
    PHP:
    // server/conf/vhost.conf.master
          
    Alias /error"<tmpl_var name='web_document_root_www'>/error/"

    // server/plugins-enabled/apache2_plugin.inc.php:
      
    $vhost_data['web_document_root_www'] = $web_config['website_basedir'].'/'.$data['new']['domain'].'/' $web_folder;
    At that point in the code apparently base_dir is "/var/www". Wouldn't document_root from the ISPConfig config area be preferred there? To deal with this for now I've created a Directive Snippet:
    Code:
    Alias /error/ "{DOCROOT_CLIENT}/error/"
    I'm starting to setup WordPress sites as well as others. I'm all ears if someone has tips for WP-specific Apache Directives, including warnings about separating Apache errors from WP's own error handling.

    Thanks!
     
  2. TonyG

    TonyG Active Member

    This is a daily issue for me so I am coming back to this thread ... and will simplify for a single use-case:

    When creating a site for WordPress, we do not want folders "error" or "stats" to be in /web.
    How do we prevent the creation of these folders in a main site or a vhost subsite?
    Thanks.
     
  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Why shouldn't the error and stats folder be in /web?
     
  4. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    the error folder is simple, simply uncheck the 'use own error documents' box when creating a new site.
    or create a new client limit template and don't enable the 'Custom error docs available' option.

    i agree with @Th0m about the stats though, wordpress doesn't care about that folder existing ( or the errors folder) and removing it would break the functionality of part of the interface.
     

Share This Page