Hi All
I’m new and I’m not sure what to do. Yesterday I have accidentally disabled the Apache mod_php module and since then my site is not accessible. Can anyone point me please how to enable that module again to get everything working? I really appreciate your time.
Robert
If you search for the exact error message you get when restarting Apache (from the error_log) here in the forums, you’ll find many posts about it including the solution.
Failed to start apache : Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.
This is the error I’m getting when trying to restart Apache. I know for you the solution is obvious, but I’m afraid not for me. I’ve been looking for his fault but still don’t know how to fix it. Can you help me please???
I have only disabled the mod_php. I have two sites, one of them is a wordpress site. I have problem with both. You’ve said Apache is starting as expected but when I tried to start it I have received this error:
Failed to start apache :
Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.
The status of your system is being checked to ensure that all enabled features are available and properly configured …
Your system has 7.63 GiB of memory, which is at or above the Virtualmin recommended minimum of 256 MiB
BIND DNS server is installed
Automatic BCCing of outgoing email cannot be enabled unless a BCC map is defined in the Postfix Mailserver module, or manually in the Postfix configuration file. Otherwise it must be turned off on the module configuration page
It looks like you have multiple problems going on. You can start solving some of them by backing up your httpd.conf and then commenting out (or deleting, since you did make a backup, right?) any lines beginning with either of the following:
php_admin_value
php_admin_flag
There may be more. I’ve come across this a few times and the errant entries aren’t always identical. But those ones are vestiges of mod_php that shouldn’t be in there if you’re using PHP-FPM (which you should be).
I’d comment or delete the errant entries and try starting Apache again. If it throws more errors (which it might), I’d consider them clues rather than fails.
Thanks for your interest. I would have to pay because I don’t know too much and have no time. The problem is that in my httpd.conf I can’t find any lines containing.
php_admin_value
php_admin_flag
I wish I could, but I don’t think I could do so within a reasonable time frame considering the urgency on your end. In addition to all the regular work I have to get done, I just got roped into a video conference that I can’t get out of, which is approaching more rapidly than the rest of my work is getting done.
Apache is pretty trouble-free. It’s right up there with Dovecot and rclone in terms of just doing its thing quietly and happily most of the time. Can you post the relevant log entries without the ellipses? Maybe that will help track down whatever it’s vomiting on.
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: Starting The Apache HTTP Server…
Jun 22 13:50:12 primary.virtualmin.com httpd[8370]: AH00526: Syntax error on line 478 of /etc/httpd/conf/httpd.conf:
Jun 22 13:50:12 primary.virtualmin.com httpd[8370]: Invalid command ‘php_admin_value’, perhaps misspelled or defined by a module not included in the server configuration
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: Failed to start The Apache HTTP Server.
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: Unit httpd.service entered failed state.
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: httpd.service failed.
I have removed these lines but still fault in line 627, this is the line
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset : disabled)
Active: failed (Result: exit-code) since Thu 2022-06-23 08:02:01 CEST; 1h 50m in ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 3168 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, st atus=1/FAILURE)
Main PID: 3168 (code=exited, status=1/FAILURE)
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: Starting The Apache HTTP Serv er…
Jun 23 08:02:01 primary.virtualmin.com httpd[3168]: AH00526: Syntax error on lin e 627 of /etc/httpd/conf/httpd.conf:
Jun 23 08:02:01 primary.virtualmin.com httpd[3168]: Invalid command ‘php_admin_v alue’, perhaps misspelled or defined by a module not included in the server conf iguration
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: httpd.service: main process e xited, code=exited, status=1/FAILURE
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: Failed to start The Apache HT TP Server.
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: Unit httpd.service entered fa iled state.
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: httpd.service failed.
[root@primary ~]#
This is the line 627
FcgidMaxRequestLen 1073741824