And under the command journalctl -xeu apache2.service:
░░ The job identifier is 292603.
Nov 22 08:56:33 host.borsedilussoartigianali.com apachectl[1827057]: AH00526: Syntax error on line 26 of /etc/apache2/sites-enabled/corriere24.com.conf:
Nov 22 08:56:33 host.borsedilussoartigianali.com apachectl[1827057]: Invalid command 'FCGIWrapper', perhaps misspelled or defined by a module not included in the server configuration
Nov 22 08:56:33 host.borsedilussoartigianali.com apachectl[1827054]: Action 'start' failed.
Nov 22 08:56:33 host.borsedilussoartigianali.com apachectl[1827054]: The Apache error log may have more information.
Nov 22 08:56:33 host.borsedilussoartigianali.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit apache2.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Nov 22 08:56:33 host.borsedilussoartigianali.com systemd[1]: apache2.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Nov 22 08:56:33 host.borsedilussoartigianali.com systemd[1]: Failed to start The Apache HTTP Server.
░░ Subject: A start job for unit apache2.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit apache2.service has finished with a failure.
░░
░░ The job identifier is 292603 and the job result is failed.
Nov 22 08:58:08 host.borsedilussoartigianali.com systemd[1]: Starting The Apache HTTP Server...
░░ Subject: A start job for unit apache2.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit apache2.service has begun execution.
░░
░░ The job identifier is 292686.
Nov 22 08:58:08 host.borsedilussoartigianali.com apachectl[1827314]: AH00526: Syntax error on line 26 of /etc/apache2/sites-enabled/corriere24.com.conf:
Nov 22 08:58:08 host.borsedilussoartigianali.com apachectl[1827314]: Invalid command 'FCGIWrapper', perhaps misspelled or defined by a module not included in the server configuration
Nov 22 08:58:08 host.borsedilussoartigianali.com apachectl[1827311]: Action 'start' failed.
Nov 22 08:58:08 host.borsedilussoartigianali.com apachectl[1827311]: The Apache error log may have more information.
Nov 22 08:58:08 host.borsedilussoartigianali.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit apache2.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Nov 22 08:58:08 host.borsedilussoartigianali.com systemd[1]: apache2.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Nov 22 08:58:08 host.borsedilussoartigianali.com systemd[1]: Failed to start The Apache HTTP Server.
░░ Subject: A start job for unit apache2.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit apache2.service has finished with a failure.
░░
░░ The job identifier is 292686 and the job result is failed.
Would you mind suggest a proper solution in order to get Apache working?
Tried with this link but now with systemctl status apache2.service the message is:
× apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-11-22 09:25:51 UTC; 1min 50s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 1830565 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 16ms
Nov 22 09:25:51 host.borsedilussoartigianali.com systemd[1]: Starting The Apache HTTP Server...
Nov 22 09:25:51 host.borsedilussoartigianali.com apachectl[1830568]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/fcgid.load: Cannot lo>
Nov 22 09:25:51 host.borsedilussoartigianali.com apachectl[1830565]: Action 'start' failed.
Nov 22 09:25:51 host.borsedilussoartigianali.com apachectl[1830565]: The Apache error log may have more information.
Nov 22 09:25:51 host.borsedilussoartigianali.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Nov 22 09:25:51 host.borsedilussoartigianali.com systemd[1]: apache2.service: Failed with result 'exit-code'.
Nov 22 09:25:51 host.borsedilussoartigianali.com systemd[1]: Failed to start The Apache HTTP Server.
and with journalctl -xeu apache2.service I have:
░░ A start job for unit apache2.service has begun execution.
░░
░░ The job identifier is 292852.
Nov 22 09:24:55 host.borsedilussoartigianali.com apachectl[1830283]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/fcgid.load: Cannot lo>
Nov 22 09:24:55 host.borsedilussoartigianali.com apachectl[1830280]: Action 'start' failed.
Nov 22 09:24:55 host.borsedilussoartigianali.com apachectl[1830280]: The Apache error log may have more information.
Nov 22 09:24:55 host.borsedilussoartigianali.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit apache2.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Nov 22 09:24:55 host.borsedilussoartigianali.com systemd[1]: apache2.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Nov 22 09:24:55 host.borsedilussoartigianali.com systemd[1]: Failed to start The Apache HTTP Server.
░░ Subject: A start job for unit apache2.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit apache2.service has finished with a failure.
░░
░░ The job identifier is 292852 and the job result is failed.
Nov 22 09:25:51 host.borsedilussoartigianali.com systemd[1]: Starting The Apache HTTP Server...
░░ Subject: A start job for unit apache2.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit apache2.service has begun execution.
░░
░░ The job identifier is 292936.
Nov 22 09:25:51 host.borsedilussoartigianali.com apachectl[1830568]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/fcgid.load: Cannot lo>
Nov 22 09:25:51 host.borsedilussoartigianali.com apachectl[1830565]: Action 'start' failed.
Nov 22 09:25:51 host.borsedilussoartigianali.com apachectl[1830565]: The Apache error log may have more information.
Nov 22 09:25:51 host.borsedilussoartigianali.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit apache2.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Nov 22 09:25:51 host.borsedilussoartigianali.com systemd[1]: apache2.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Nov 22 09:25:51 host.borsedilussoartigianali.com systemd[1]: Failed to start The Apache HTTP Server.
░░ Subject: A start job for unit apache2.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit apache2.service has finished with a failure.
░░
░░ The job identifier is 292936 and the job result is failed.
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/fcgid.load: Cannot load /usr/lib/apache2/modules/mod_fcgid.so into server: /usr/lib/apache2/modules/mod_fcgid.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
Try commenting out both of those lines (add a # at the beginning each line), and then try to start Apache.
If it starts but the sites aren’t rendering properly, go into Virtualmin and specify PHP-FPM as the PHP execution mode for the virtual servers in question.
If it doesn’t start, then we look into it further.
Okay, you need to SSH into the server and sudo to root, then use a text editor to edit the files.
If you don’t know how to use a shell text editor, then nano is probably the easiest to learn in a hurry. It’s probably included in the default install. If not:
$sudo apt install nano
At least that’s how one would do it in Debian. I assume Ubuntu is the same.
Actually, were you logged into Virtualmin as root when you tried editing the files? I don’t recall ever being unable to edit a file unless I’d made it immutable.
instructions properly applied, both files amended, I got this message from journalctl -xeu apache2.service:
× apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-11-22 10:51:36 UTC; 2min 19s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 1841274 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 14ms
Nov 22 10:51:36 host.borsedilussoartigianali.com systemd[1]: Starting The Apache HTTP Server...
Nov 22 10:51:36 host.borsedilussoartigianali.com apachectl[1841278]: AH00534: apache2: Configuration error: No MPM loaded.
Nov 22 10:51:36 host.borsedilussoartigianali.com apachectl[1841274]: Action 'start' failed.
Nov 22 10:51:36 host.borsedilussoartigianali.com apachectl[1841274]: The Apache error log may have more information.
Nov 22 10:51:36 host.borsedilussoartigianali.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Nov 22 10:51:36 host.borsedilussoartigianali.com systemd[1]: apache2.service: Failed with result 'exit-code'.
Nov 22 10:51:36 host.borsedilussoartigianali.com systemd[1]: Failed to start The Apache HTTP Server.
Moreover, please note that I don’t have the setting that you mentioned (PHP-FPM choice) under Server Configuration → PHP Options:
Oh, it probably can be fixed. Most Apache problems can be.
The thing is that I’ve never used Ubuntu, nor used Debian on a production server, nor used Ubuntu nor Debian with Virtualmin. So beyond obvious Apache errors that would apply to any OS, I’m probably not the one to fix it.
I’d leave the two edits you made in place for now because I think they’re part of the solution. But I think at this point you need someone with more experience running Virtualmin on Ubuntu. That would be pretty much anyone, as my experience is zero.
Well… as the linked article said, that would enable a deprecated execution mode that you probably don’t want to use.
If you want to try it, that’s up to you. Just make sure you enable the module corresponding to your PHP version. But you’re much better off finding out why PHP-FPM is missing and fixing that.
I’m sure that @staff has better wisdom than I do on this. Let’s give them a call.
That’s not a resource, that’s a disaster. Do not, under any circumstances, enable mod_php. Ever.
mod_php has nothing to do with any of the errors you’ve shown above, and enabling it will only break things more.
It appears mod_fcgid (completely unrelated to mod_php) is not being loaded. I don’t know why that would be. Did you remove some packages? Perhaps while installing other PHP versions or something? I don’t know what the fcgid package is called on Ubuntu, but that’s what you need to check first, as it is obviously missing from your system. I don’t know how/why it would be (I’m pretty sure we depend on it, so if you don’t have it, you have to have uninstalled our stack package to get there).
As someone else mentioned, PHP-FPM is preferred in modern systems, but if you installed using the Virtualmin 6 installer, you’d probably have mod_fcgid as the default execution mode (it was the preferred execution mode for several years).
mod_php has never been the preferred execution mode in a Virtualmin environment, and you have no reason to ever use it, install it, or enable it. It will lead to breakage of your sites and your apache configuration.
Edit: Package name you need to check is libapache2-mod-fcgid. It looks like you’ve uninstalled it, or deleted some files from that package.
everything was working like a charme until yesterday.
Just done:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
libapache2-mod-fcgid
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 64.9 kB of archives.
After this operation, 242 kB of additional disk space will be used.
Get:1 https://mirror.hetzner.com/ubuntu/packages jammy/universe amd64 libapache2 -mod-fcgid amd64 1:2.3.9-4 [64.9 kB]
Fetched 64.9 kB in 0s (724 kB/s)
Selecting previously unselected package libapache2-mod-fcgid.
(Reading database ... 146699 files and directories currently installed.)
Preparing to unpack .../libapache2-mod-fcgid_1%3a2.3.9-4_amd64.deb ...
Unpacking libapache2-mod-fcgid (1:2.3.9-4) ...
Setting up libapache2-mod-fcgid (1:2.3.9-4) ...
apache2_invoke fcgid: already enabled
apache2_reload: Your configuration is broken. Not restarting Apache 2
apache2_reload: AH00534: apache2: Configuration error: No MPM loaded.
Would you mind telling me if it is possible recover apache2 or maybe I have to uninstall and then install it once again?
I guess you uninstalled other parts of your Apache, too, as mpm is also missing. But, here’s the problem: I don’t know how you could possibly have removed that, because I think that’s in one of the core Apache packages (I think it’s in apache2-bin).