VirtualMin Apache Failed to Start

Whatever you have done it’s messed up apache2 you need to fix that. From the first screen shot that apache config file is missing try the following in a terminal


this will show you what apache has loaded & what virtual servers it is going to use.
the following commands assume a debian type system, these commands will be different on RHEL .
with mod_actions try
go to Webmin’s Apache Webserver module, click on Configure Modules, make sure mod_actions is checked, and then click enable

root@hosts:~# ls -lh /etc/apache2/sites-enabled/
total 0
lrwxrwxrwx 1 root root 35 Dec 10 14:24 000-default.conf → …/sites-available/00 0-default.conf
root@hosts:~# apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_event_module (shared)
negotiation_module (shared)
reqtimeout_module (shared)
setenvif_module (shared)
status_module (shared)
root@hosts:~#


it doesn’t show php ?

Apache is total screwed up you have no config files for you virtual servers this is something to do with your ‘reinstall’ of apache, if you have virtual server backups you can restore the virtual servers which will rewrite the missing config files, if you don’t have backups (which you should have) your easiest option is to delete all virtual servers and start again, which will write the correct config files. You must also check

and make sure every module is checked that you need is checked and to be sure restart apache after that

looking at what is enabled you will need to check ssl, suexec at least but check the list I sent you in the screen shot, its from a working virtualmin system so that should get you going

when trying to enable ssl and suexec

look at the error then to see what failed with

systemctl status apache2.service

or

service apache2 status

that will tell you where the error is

Dec 13 18:10:35 hosts.tag4track.com systemd[1]: Starting The Apache HTTP Server…
Dec 13 18:10:35 hosts.tag4track.com apachectl[2591081]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
Dec 13 18:10:35 hosts.tag4track.com apachectl[2591081]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
Dec 13 18:10:35 hosts.tag4track.com apachectl[2591081]: no listening sockets available, shutting down
Dec 13 18:10:35 hosts.tag4track.com apachectl[2591081]: AH00015: Unable to open logs
Dec 13 18:10:35 hosts.tag4track.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 13 18:10:35 hosts.tag4track.com systemd[1]: apache2.service: Failed with result ‘exit-code’.
Dec 13 18:10:35 hosts.tag4track.com systemd[1]: Failed to start The Apache HTTP Server.

what is running on the https port 443 ? try

netstat -atunp |grep :443

and this will tell you what is running on that port

image

how to ensure php8.1 shows in apache module

You do not want to use mod_php you need to add fpm support to apache. Just enable it by
a2dismod php8.1
a2dismod mpm_prefork
a2enmod mpm_event
a2enmod proxy proxy_fcgi
a2enconf php8.1-fpm
This will get php fpm running with apache, then you need to configure your virtual servers to use it. If can restore the virtual servers this will do most of the work gor you as you will only need to disable php-fpm and re enable it via the virtualmin interface

root@hosts:~# a2dismod php8.1
ERROR: Module php8.1 does not exist!
root@hosts:~# a2dismod mpm_prefork
Module mpm_prefork disabled.
To activate the new configuration, you need to run:
systemctl restart apache2
root@hosts:~# a2enmod mpm_event
Considering conflict mpm_worker for mpm_event:
Considering conflict mpm_prefork for mpm_event:
Enabling module mpm_event.
To activate the new configuration, you need to run:
systemctl restart apache2
root@hosts:~# a2enmod proxy proxy_fcgi
Enabling module proxy.
Considering dependency proxy for proxy_fcgi:
Module proxy already enabled
Enabling module proxy_fcgi.
To activate the new configuration, you need to run:
systemctl restart apache2
root@hosts:~# a2enconf php8.1-fpm

So you have now got apache running ?

its running but when ssl is enabled

is doesn’t start

Did you fix the error of something already running on port 443 ? It could be the point that all you need is a reboot … i don’t know if you stopped apache before your reinstall and it’s still running on port 443. But for completeness find out what is currently running on that port
443 = apache ssl port

its issue with ssl module

This question is crazy. Reinstalling is what you do when you want to start over. There’s no other scenario where “reinstall” is the right answer.

no it’s not … you have something using port 443 ? maybe

It’s most likely down to more than 1 listen directive in the apache configuration for the port 443 as netstat shows nothing running. As you have messed up your apache configuration by however you reinstalled it, it would appear your best option is to review all apache2 config files for duplicate entries and fix them. Always ask advice from someone else, if you feel the need to reinstall as there maybe something you have overlooked, blindly removing all of apache’s configuration files will cause you more problems (as you are finding out) than I guess the original problem that prompted you to do the reinstall

Sure I will confirm you with all