Tag Archives: apache2 cannot be opened

Job for apache2.service failed apache2 cannot be started

I planned to configure the virtual domain name in Apache before, so I did various operations on the configuration file of Apache. As a result, I don’t know why Apache always reported errors when it was restarted and started

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service"
 and "journalctl -xe" for details.

So I went to the apache2 error log /var/log/apache2 and couldn’t find a solution. So I unloaded Apache and reinstalled Apache and PHP

The next day, I encountered this problem again when I was tuning my configuration file. I used soft connection in both processes, so I wondered if there was something wrong with soft connection. I carefully checked what soft connection is

 Soft links under linux are similar to shortcuts under windows.

  Examples.
  ln -s httpd.conf confighttp

  where httpd.conf is the source file , conffighttp is the link filename , its role is to edit when conffighttp
, which is actually a link edit httpd.conf.
  If the soft link is to be removed.

  confighttp-rm-rf.

  This will only delete the conffighttp link file, but not the source file httpd.conf.

  As opposed to soft links, and hard links.
  Order to establish a hard link.
  ln httpd.conf confighttp

  A hard-linked file is the equivalent of a file stored in two locations, which effectively prevents accidental deletion.

Translated with www.DeepL.com/Translator (free version)

Then use the command to try to delete the previous soft connection, found success. Apache restore, problem resolved