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 :
    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...
    // 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:
    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.


Share This Page