That's not the correct Apache configuration you should look at. That httpd.conf you found is just testdata (as specified in the path) for Certbot, not configuration files actually used when either running Certbot nor used by your own webserver.
@hiddenotebook Please start from the beginning by answering the Help sections questionnaire I've pasted below, as this thread was split from another, so you didn't get it:
Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is:
I ran this command:
It produced this output:
My web server is (include version):
The operating system my web server runs on is (include version):
My hosting provider, if applicable, is:
I can login to a root shell on my machine (yes or no, or I don't know):
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
#Summary of how the Apache 2 configuration works in Debian: #The Apache 2 web server configuration in Debian is quite different to #upstream's suggested way to configure the web server. This is because Debian's #default Apache2 installation attempts to make adding and removing modules, #virtual hosts, and extra configuration directives as flexible as possible, in #order to make automating the changes and administering the server as easy as #possible.
#It is split into several files forming the configuration hierarchy outlined #below, all located in the /etc/apache2/ directory:
The output of ls -l /etc/apache2/sites-enabled/ is:
hiddenotebook@ubuntu:~$ ls -l /etc/apache2/sites-enabled/
lrwxrwxrwx 1 root root 34 Jun 16 11:45 prestashop.conf -> ../sites-available/prestashop.conf
Returning to the topic that has brought us to this post ¿why is so important to have a section of <VirtualHost> inside the configuration file?
I don't have the same problem as our partner @H.Furukawa I can install the certificates without problems i'm just wondering about the file httpd.conf, and I found this asking a chatgpt:
I ask this question:
Where is the file httpd.conf on server Apache 2.4.52 with Ubuntu?
In Apache 2.4.52 installations on Ubuntu, the main configuration file `httpd.conf` is typically not used by default. Instead, Ubuntu uses a different configuration structure for Apache. Here's the general file structure for Apache configuration on Ubuntu:
1. The main configuration directory is `/etc/apache2/`.
2. The main configuration file is `apache2.conf`, located in the `/etc/apache2/` directory. This file contains global configuration directives and includes other configuration files.
3. The additional configuration files are stored in the `/etc/apache2/conf-available/` directory. These files are typically organized by purpose or module.
4. Enabled configuration files are symlinked from the `/etc/apache2/conf-enabled/` directory to the corresponding files in `/etc/apache2/conf-available/`. These enabled files are the ones that are actually loaded by Apache.
Instead of directly modifying `httpd.conf`, it's recommended to use the appropriate configuration files in the `/etc/apache2/conf-available/` directory or the `/etc/apache2/sites-available/` directory for specific virtual hosts.
Right now I have a lot of questions to answer, I hope you don't mind.
I am going to change the title of the post to, Where is the configuration file on server Apache 2.4.52 with Ubuntu? I think it is a more correct description for this thread.
Certbot's Apache integration requires it because it uses the VirtualHost to determine which names may be included in a certificate, which part of the configuration to modify in order to satisfy the certificate authority's challenge, and which part of the configuration file to modify in order to install the certificate.
Certbot developers were comfortable requiring this because it is the configuration method suggested by most Apache documentation, and supported by other Apache-related tools.
If you specifically wanted to use Certbot with an Apache installation that just uses the base httpd.conf with no VirtualHost at all, you could use certbot --webroot instead of certbot --apache and then edit the httpd.conf manually to install the certificate. Certbot will not be able to do this with certbot --apache in this scenario.