apache2 fail to start

in the past it worked flawlessly, today gives this error:

* apache2.service - The Apache Webserver
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Mon 2022-02-28 12:56:31 CET; 2h 58min ago
    Process: 19277 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start (code=exited, status=1/FAILURE)
   Main PID: 19277 (code=exited, status=1/FAILURE)
     Status: "Reading configuration..."

feb 28 12:56:30 server3TW.zapto.org systemd[1]: Starting The Apache Webserver...
feb 28 12:56:31 server3TW.zapto.org start_apache2[19277]: AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using server3TW.zapto.org. Set the 'ServerName' directive globally to suppress this message
feb 28 12:56:31 server3TW.zapto.org start_apache2[19277]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
feb 28 12:56:31 server3TW.zapto.org start_apache2[19277]: AH00014: Configuration check failed
feb 28 12:56:31 server3TW.zapto.org systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
feb 28 12:56:31 server3TW.zapto.org systemd[1]: apache2.service: Failed with result 'exit-code'.
feb 28 12:56:31 server3TW.zapto.org systemd[1]: Failed to start The Apache Webserver.

I tried to create /var/log/apache2 but it doesn’t solved
how can I have http server working?

Which command did you use here? Please always post including the prompt/command line before the output, the output itself and the next prompt line. It communicates very trustworthy to your potential helpers who you are, where you are, what you did and what you got, without alterations, unabridged and complete. Now there is time spoild by a lot of guessing.

Since you didn’t provide enough details, remember to check a few things;

  1. Do you have free space on / ? -> **df -h /
    **2. Are the permissions correct? -> **ll /var/log/apache2/
    **3. What’s the output of: -> journalctl -u apache2 -f

no commands, I went to yast>services manager>click on apache2 service>click on start> and result failed then click on show details and cpyed here the result

sorry for lacking of details, please ask me what details you need and I’ll give you

here is:

procuste@server3TW:~> df -h  
Filesystem      Size  Used Avail Use% Mounted on 
devtmpfs        4.0M     0  4.0M   0% /dev 
tmpfs           3.9G  162M  3.7G   5% /dev/shm 
tmpfs           1.6G   43M  1.5G   3% /run 
tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup 
/dev/sda5        40G   27G   12G  69% / 
/dev/sda3        40G  5.1G   34G  14% /suse3.1 
/dev/sdc1       917G  305G  566G  35% /abbaino 
/dev/sdi        3.6T  1.6T  1.9T  46% /garage 
/dev/sdb1       3.6T  3.1T  588G  84% /casalmare 
/dev/sdj1       1.8T  1.7T   50G  98% /fienile 
/dev/sdg1       1.8T  1.3T  499G  72% /capanno 
/dev/sdh1       1.8T  1.3T  536G  71% /cantina 
/dev/sdf1       3.6T  3.3T  365G  91% /piedaterre 
/dev/sda4       171G  117G   54G  69% /home 
/dev/sde1       2.7T  2.4T  298G  90% /mansarda 
tmpfs           785M  240K  785M   1% /run/user/1000 
/dev/sdd1       1.9T  753G  1.1T  41% /run/media/procuste/backup7 
procuste@server3TW:~> 

** here is:
**

procuste@server3TW:~> ll /var/log/apache2/ 
total 0 
procuste@server3TW:

but if in dolphin I add a label with permission I can read /var/log/apache2/ permissions as drwxr–r–

here is:

procuste@server3TW:~> journalctl -u apache2 -f  
-- Logs begin at Mon 2022-02-28 10:31:10 CET. -- 
Feb 28 12:46:36 server3TW.zapto.org systemd[1]: **apache2.service: Main process exited, code=exited, st**
atus=1/FAILURE 
Feb 28 12:46:36 server3TW.zapto.org systemd[1]: **apache2.service: Failed with result 'exit-code'.** 
Feb 28 12:46:36 server3TW.zapto.org systemd[1]: **Failed to start The Apache Webserver.** 
Feb 28 12:56:30 server3TW.zapto.org systemd[1]: Starting The Apache Webserver... 
Feb 28 12:56:31 server3TW.zapto.org start_apache2[19277]: AH00558: httpd-prefork: Could not reliably 
determine the server's fully qualified domain name, using server3TW.zapto.org. Set the 'ServerName' d
irective globally to suppress this message 
Feb 28 12:56:31 server3TW.zapto.org start_apache2[19277]: (2)No such file or directory: AH02291: Cann
ot access directory '/var/log/apache2/' for main error log 
Feb 28 12:56:31 server3TW.zapto.org start_apache2[19277]: AH00014: Configuration check failed 
Feb 28 12:56:31 server3TW.zapto.org systemd[1]: **apache2.service: Main process exited, code=exited, st**
atus=1/FAILURE 
Feb 28 12:56:31 server3TW.zapto.org systemd[1]: **apache2.service: Failed with result 'exit-code'.** 
Feb 28 12:56:31 server3TW.zapto.org systemd[1]: **Failed to start The Apache Webserver.** 

That is also fine, but when you do not explain, how can we know where it is from?

Well, since it’s complaining about missing files, perhaps we’ll just re-create them.

Remember to run all of these with sudo or as root.


mkdir /var/log/apache2/
chown root.root /var/log/apache2/
touch /var/log/apache2/error_log ; touch /var/log/apache2/access_log
rpm --setperms apache2
systemctl start apache2 ; systemctl status apache2

yeaahhrotfl! it seems to works

procuste@server3TW:~> su - 
Password:  
**server3TW:~ #** mkdir /var/log/apache2/ 
mkdir: cannot create directory ‘/var/log/apache2/’: File exists 
**server3TW:~ #** chown root.root /var/log/apache2/ 
**server3TW:~ #** touch /var/log/apache2/error_log ; touch /var/log/apache2/access_log 
**server3TW:~ #** rpm --setperms apache2 
**server3TW:~ #** systemctl start apache2 ; systemctl status apache2 
**●** apache2.service - The Apache Webserver 
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor preset: disabled) 
     Active: **reloading (reload)** since Mon 2022-02-28 19:14:56 CET; 21ms ago 
   Main PID: 3262 (httpd-prefork) 
     Status: "Reading configuration..." 
      Tasks: 1 
     CGroup: /system.slice/apache2.service 
             └─3262 /usr/sbin/httpd-prefork -DSYSCONFIG -C PidFile /var/run/httpd.pid -C Include /et> 

Feb 28 19:14:56 server3TW.zapto.org systemd[1]: Starting The Apache Webserver... 
Feb 28 19:14:56 server3TW.zapto.org start_apache2[3262]: AH00558: httpd-prefork: Could not reliably > 
Feb 28 19:14:56 server3TW.zapto.org systemd[1]: Started The Apache Webserver.

maaanythanks, and sorry again for the lack of details,

Note, you should define **ServerName **in /etc/apache2/default-server.conf to make one of the error messages go away and properly set the default host ( you should use whatever your full qualified hostname is from the outside, for example www.thisAINTaREALaddressIhope.com )