Apache running but hosted sites on the virtualmin not accessible

Operating system
Ubuntu Linux 20.04.4

Kernel and CPU
Linux 5.4.0-113-generic on x86_64

Processor information
AMD EPYC 7282 16-Core Processor, 6 cores

Operating system | Ubuntu Linux 20.04.4
Webmin version | 1.994 |
Usermin version | 1.840|

I happened to re-install apache2 in my server. After reinstalled, all of the hosted sites are not working and getting this error page

" This is the default welcome page used to test the correct operation of the Apache2 server after installation on Ubuntu systems. It is based on the equivalent page on Debian, from which the Ubuntu Apache packaging is derived. If you can read this page, it means that the Apache HTTP server installed at this site is working properly. You should replace this file (located at/var/www/html/index.html) before continuing to operate your HTTP server.

If you are a normal user of this web site and don’t know what this page is about, this probably means that the site is currently unavailable due to maintenance. If the problem persists, please contact the site’s administrator.

Configuration Overview

Ubuntu’s Apache2 default configuration is different from the upstream default configuration, and split into several files optimized for interaction with Ubuntu tools. The configuration system is fully documented in /usr/share/doc/apache2/README.Debian.gz. Refer to this for the full documentation. Documentation for the web server itself can be found by accessing the manual if the apache2-doc package was installed on this server.

The configuration layout for an Apache2 web server installation on Ubuntu systems is as follows:

/etc/apache2/ |-- apache2.conf | -- ports.conf |-- mods-enabled | |-- *.load | – *.conf |-- conf-enabled | -- *.conf |-- sites-enabled | – *.conf" etc…

How to fix this issue without having any issues?

You shouldn’t re-install a service by deleting it, and expecting that it would preserve any previous configs, and works as expected.

The easiest solution would be is to recover /etc/apache2/sites-available from a backup.

Also, you shouldn’t be using Webmin only for managing your hosted websites, as Virtualmin must be your choice.

1 Like

Thanks for the response.

I realised that I should not be re-installed apache. I won’t do it again. Virtualmin is already installed.

" The easiest solution would be is to recover /etc/apache2/sites-available from a backup." How to do it?

I guess the files are already exist. What is the next step?

I cannot tell as I don’t know what was done and what the problem is.

If default configs were change, probably it’s worth running:

virtualmin-config-system -i Apache
systemctl restart apache2