Meanwhile, in Debian and its derivatives, we got it split into many files and directories, with a whole system of symlinks and helpers that exist only in Debian, like a2enmod, a2dismod, a2ensite, a2dissite, and a2enconf, a2disconf.
I've even seen people calling this a "Debianism".
Why does Debian make such change to the structure of upstream Apache config? I'm sure there must be good reasons and/or historical reasons for that, with a rationale buried in a mailing list post from 2 decades ago, but I can't seem to find it.
What are the reasons for Debian to change the upstream config structure of the Apache server?
If you've got a monolithic configuration file you need to parse it and be really sure that you handle all edge cases, including arbitrary manual changes by the admin.
If you split it into small per-site config snippets that don't claim to support every possible Apache configuration setting, you can simply paste them in the right place together.
If you're just standing up a single, simple site with Apache, it can be 'easier' to do so with the basic config. Once you get into production environments, the Debian framework is something to be thankful for.
I was curious so I asked Chat GPT as well:
The rationale behind this approach is primarily aimed at enhancing maintainability, scalability, and user-friendliness, particularly for systems that host multiple websites or require frequent configuration changes. Here are the key reasons:
1. Modularity: By splitting the configuration into smaller, more manageable files, administrators can easily enable or disable specific modules or sites. This modular approach is especially beneficial in environments with multiple virtual hosts, where each site can have its own configuration file.
2. Ease of Management: Tools like a2enmod and a2ensite simplify the process of enabling and disabling modules and sites. Rather than manually editing configuration files, administrators can use these tools to make changes, reducing the risk of syntax errors and other mistakes.
3. Upgrade Safety: Debian’s structure keeps the default and custom configurations separate. When Apache is updated, the package manager can safely replace the default files without overwriting custom configurations, making the upgrade process smoother and safer.
4. Community Conventions: Over time, Debian’s approach has become a well-understood convention within its community. Users familiar with Debian know what to expect and find the system intuitive.
5. Historical Reasons: Debian has a long history of emphasizing stability and predictability. The configuration structure likely evolved to meet these priorities, considering the needs of its diverse user base, from personal servers to large enterprises.