I'm setting up a subdomain for mobile content that will be hosted on the same server but in a separate root directory (/www/main and /www/mobile).I'm trying to configure the sites-available .conf files for each, and I started to wonder something. What settings can be put in default.conf that will be automatically inherited by my main.conf and mobile.conf files? Is this even possible?For example, if I define ErrorLog and ServerAdmin settings in default.conf, will they be inherited by the other two files?
Sites-available inheritance
apache2;configuration
Apache's default file is httpd.conf and from a new installation, this can be found in the conf subfolder from where apache was installed.What you're really looking for is the Include keyword which imports whatever configuration you want into the section that keyword is in.So if you're defining a special hostname like m.example.com and you want configuration in mobile.conf and sites-available.conf to apply to m.example.com then you look for a virtual host tag with m.example.com and in it add:Include /path/to/mobile.confInclude /path/to/sites-available.confAnd also, the order you specify the includes determines which configuration is applied first. The first file specified is loaded first.If you need to apply the config of default.conf to mobile.conf and main.conf, then for each conf file, you need to add:Include /path/to/default.confreplace /path/to/ with the full path to the configuration files so that they load. If you specify invalid files or files that are not found, then you'll get a 500 internal server error when trying to access any webpage on your server.After making changes to the configuration, you'll need to restart apache.