PLEASE HELP - After updates (16 today) apache server won't come on

SYSTEM INFORMATION
OS type and version CentOS Linux 7.9.2009
Webmin version 2.101
Usermin version 2.001
Virtualmin version 7.8.2
Theme version 21.04
Package updates All installed packages are up to date

I had 16 udates today which I did and the apache server won’t come on
did several reboots but it still doesn’t come on
Please Help
Thanks
ASM2

If you run systemctl restart apache2 and then run systemctl status --no-pager --full apache2 – what is the output of the later command?

1 min … I’m trying that

[root@vmi431722 ~]# systemctl restart apache2
Failed to restart apache2.service: Unit not found.
[root@vmi431722 ~]# systemctl status --no-pager --full apache2
Unit apache2.service could not be found.
[root@vmi431722 ~]#

I’m sorry, the right unit name is httpd.

I’m sorry I’m not really an expert - just a novice trying to get this fixed - thanks so much for you help

Here’s what I got:

[root@vmi431722 ~]# httpd systemctl restart apache2
Usage: httpd [-D name] [-d directory] [-f file]
             [-C "directive"] [-c "directive"]
             [-k start|restart|graceful|graceful-stop|stop]
             [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
  -D name            : define a name for use in <IfDefine name> directives
  -d directory       : specify an alternate initial ServerRoot
  -f file            : specify an alternate ServerConfigFile
  -C "directive"     : process directive before reading config files
  -c "directive"     : process directive after reading config files
  -e level           : show startup errors of level (see LogLevel)
  -E file            : log startup errors to file
  -v                 : show version number
  -V                 : show compile settings
  -h                 : list available command line options (this page)
  -l                 : list compiled in modules
  -L                 : list available configuration directives
  -t -D DUMP_VHOSTS  : show parsed vhost settings
  -t -D DUMP_RUN_CFG : show parsed run settings
  -S                 : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
  -t -D DUMP_MODULES : show all loaded modules 
  -M                 : a synonym for -t -D DUMP_MODULES
  -t                 : run syntax check for config files
  -T                 : start without DocumentRoot(s) check
  -X                 : debug mode (only one worker, do not detach)
[root@vmi431722 ~]# httpd systemctl status --no-pager --full apache2
Usage: httpd [-D name] [-d directory] [-f file]
             [-C "directive"] [-c "directive"]
             [-k start|restart|graceful|graceful-stop|stop]
             [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
  -D name            : define a name for use in <IfDefine name> directives
  -d directory       : specify an alternate initial ServerRoot
  -f file            : specify an alternate ServerConfigFile
  -C "directive"     : process directive before reading config files
  -c "directive"     : process directive after reading config files
  -e level           : show startup errors of level (see LogLevel)
  -E file            : log startup errors to file
  -v                 : show version number
  -V                 : show compile settings
  -h                 : list available command line options (this page)
  -l                 : list compiled in modules
  -L                 : list available configuration directives
  -t -D DUMP_VHOSTS  : show parsed vhost settings
  -t -D DUMP_RUN_CFG : show parsed run settings
  -S                 : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
  -t -D DUMP_MODULES : show all loaded modules 
  -M                 : a synonym for -t -D DUMP_MODULES
  -t                 : run syntax check for config files
  -T                 : start without DocumentRoot(s) check
  -X                 : debug mode (only one worker, do not detach)
[root@vmi431722 ~]#

The right commands would be systemctl restart httpd and systemctl status --no-pager --full httpd.

Here’s what I got:

[root@vmi431722 ~]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.
[root@vmi431722 ~]# systemctl status --no-pager --full httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2023-09-22 19:48:51 BST; 24s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 16795 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 16795 (code=exited, status=1/FAILURE)

Sep 22 19:48:51 vmi431722.contaboserver.net systemd[1]: Starting The Apache HTTP Server…
Sep 22 19:48:51 vmi431722.contaboserver.net httpd[16795]: httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 27 of /etc/httpd/conf.d/php.conf: Expected before end of configuration
Sep 22 19:48:51 vmi431722.contaboserver.net systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Sep 22 19:48:51 vmi431722.contaboserver.net systemd[1]: Failed to start The Apache HTTP Server.
Sep 22 19:48:51 vmi431722.contaboserver.net systemd[1]: Unit httpd.service entered failed state.
Sep 22 19:48:51 vmi431722.contaboserver.net systemd[1]: httpd.service failed.
[root@vmi431722 ~]#

What happened in /etc/httpd/conf.d/php.conf? It’s been modified, and with invalid syntax.

I have no idea - Can you help please?

Look in that file at the line that is a syntax error!

where do i look?

I don’t understand what you’re asking. The error you posted tells you exactly where to look, and I’ve pointed out exactly where in the error it told you that. I honestly don’t know how to be more precise than saying, “look at line 27 of /etc/httpd/conf.d/php.conf”.

1 Like

I’m so sorry … Where do I go to find this line 27? how do I get there
Like I said before I don’t know much about this but I can follow your directions to find it and post it - maybe then you can help correct this and hopefully get this working for me Please…

You can use any text editor you are familiar with. You can use the File Manager in Virtualmin to browse to that file, and open it with the built-in editor.

I tried this but …

[root@vmi431722 ~]# /etc/httpd/conf.d/php.conf
-bash: /etc/httpd/conf.d/php.conf: Permission denied

You need to open the file with an editor (nano, vim, emacs, joe, pico, etc.) or viewer (less, more, view, etc.). You cannot execute a plain text file (which is what you tried to do).

There is a text editor built into Webmin’s File Manager, as well.

I looked for the text editor and got this:
Searching for text editor . . . . . found 1 results :

Matching text Source Module References
Text editor User interface DHCP Server dhcpd.conf

When I click DCHP Server It says as below:

The DHCP server /usr/sbin/dhcpd could not be found on your system. Maybe it is not installed, or your DHCP module configuration is incorrect.

The ISC DHCPd package can be automatically installed by Webmin using YUM.

Should I install this? Maybe that will help to find the line 27?

File Manager. The text editor is in the File Manager, as I said.

I am sorry to say this in public, but a lot of questions that are asked in this forum which are not strictly related to the products *min I can find the answers using Google search. Most out of convenience prefer to ask here obviously requesting the small team that should solve other more important problems. In IT even a newbie can solve some tasks without knowledge, in other fields it is not possible, for example medicine. Does anyone practice surgery after reading articles on the Internet?

1 Like