6.34 fresh install Apache doesnt work

I performed fres install on SSD via USB boot Rpi3b+ . Apache2 web server is not running and not success to solve it.
Ir is fresh install without any modification. I have installed apache as part of LAMP from dietpi interface.

Bellow see some linex from my attempt to solve it.
root@BlackFan:~# sudo systemctl enable apache2
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
root@BlackFan:~# sudo systemctl start apache2
Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.

Can you suggest me some solution
Thanks Tomas

Here is output from systemctl status command

● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-12-29 07:35:53 CET; 26min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 581 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

pro 29 07:35:53 BlackFan systemd[1]: Starting The Apache HTTP Server…
pro 29 07:35:53 BlackFan apachectl[581]: AH00558: apache2: Could not reliably determine the server’s fully qualifi
ed domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message
pro 29 07:35:53 BlackFan apachectl[581]: (2)No such file or directory: AH02291: Cannot access directory ‘/var/log/
apache2/’ for main error log
pro 29 07:35:53 BlackFan apachectl[581]: (2)No such file or directory: AH02291: Cannot access directory ‘/var/log/
apache2/’ for error log of vhost defined at /etc/apache2/sites-enabled/000-default.conf:1
pro 29 07:35:53 BlackFan apachectl[581]: AH00014: Configuration check failed
pro 29 07:35:53 BlackFan apachectl[581]: Action ‘start’ failed.
pro 29 07:35:53 BlackFan apachectl[581]: The Apache error log may have more information.
pro 29 07:35:53 BlackFan systemd[1]: apache2.service: Control process exited, code=exited,
status=1/FAILURE
pro 29 07:35:53 BlackFan systemd[1]: apache2.service: Failed with result ‘exit-code’.
pro 29 07:35:53 BlackFan systemd[1]: Failed to start The Apache HTTP Server.

My next attempt to solve it.

  1. I have completelly purged apache2 from DietPi system via apt.
  2. I have installed appache via apt command

but no success: (see bellow terminal apt output). I have to emphasize it is fresh new installation of Dietpi without any mods.

● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-12-29 09:43:42 CET; 28ms ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 1318 ExecStart=/usr/sbin/apachectl start (code=exited, status=127)

pro 29 09:43:42 BlackFan systemd[1]: Starting The Apache HTTP Server…
pro 29 09:43:42 BlackFan apachectl[1318]: /usr/sbin/apachectl: 174: /usr/sbin/apachectl: /usr/sbin/apache2: not found
pro 29 09:43:42 BlackFan apachectl[1318]: Action ‘start’ failed.
pro 29 09:43:42 BlackFan apachectl[1318]: The Apache error log may have more information.
pro 29 09:43:42 BlackFan systemd[1]: apache2.service: Control process exited, code=exited, status=127/n/a
pro 29 09:43:42 BlackFan systemd[1]: apache2.service: Failed with result ‘exit-code’.
pro 29 09:43:42 BlackFan systemd[1]: Failed to start The Apache HTTP Server.
Zpracovávají se spouštěče pro balík systemd (241-7~deb10u5+rpi1) …

Hi,

probably better to check the error message before installing Apache back and force. Because there are indications on what the error could be

On your 1st attamed

pro 29 07:35:53 BlackFan apachectl[581]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/
apache2/' for main error log
pro 29 07:35:53 BlackFan apachectl[581]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/
apache2/' for error log of vhost defined at /etc/apache2/sites-enabled/000-default.conf:1

/var/log/apache2/ did not exist and would need to be created

On your 2nd attamed

pro 29 09:43:42 BlackFan apachectl[1318]: /usr/sbin/apachectl: 174: /usr/sbin/apachectl: /usr/sbin/apache2: not found

Apapche executable not found. Looks like not installed correctly

Yes I know that but explain me why on fresh Dietpi install is apache2 installation not correct ?
What is a way install it corectly other than apt ?
Tomas

well DietPi is doing nothing else than installing Apache2 apt package.

I did a test installation on my RPi3B+ 32bit OS and it was working without issues. Apache service is running

root@DietPi3:~# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-12-29 13:36:12 CET; 33s ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 415 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 427 (apache2)
    Tasks: 5 (limit: 2182)
   CGroup: /system.slice/apache2.service
           ├─427 /usr/sbin/apache2 -k start
           ├─450 /usr/sbin/apache2 -k start
           ├─451 /usr/sbin/apache2 -k start
           ├─452 /usr/sbin/apache2 -k start
           └─453 /usr/sbin/apache2 -k start

Dec 29 13:36:11 DietPi3 systemd[1]: Starting The Apache HTTP Server...
Dec 29 13:36:12 DietPi3 apachectl[415]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Dec 29 13:36:12 DietPi3 systemd[1]: Started The Apache HTTP Server.
root@DietPi3:~#

as well the directory /var/log/apache2 was created

root@DietPi3:~# ls -la /var/log/
total 12
drwxr-xr-t  5 root root  220 Dec 29 13:30 .
drwxr-xr-x 12 root root 4096 Oct 28 12:51 ..
-rw-r--r--  1 root root    0 Dec 29 13:30 alternatives.log
drwxr-x---  2 root adm   100 Dec 29 13:27 apache2
drwxr-xr-x  2 root root  100 Dec 29 13:29 apt
-rw-rw----  1 root utmp    0 Dec 29 13:35 btmp
-rw-r--r--  1 root root    0 Dec 28 23:11 dietpi-backup.log
-rw-r--r--  1 root root    0 Dec 29 13:30 dpkg.log
-rw-rw-r--  1 root utmp  292 Dec 29 13:36 lastlog
drwx------  2 root root   40 Sep 22 13:58 private
-rw-rw-r--  1 root utmp 1920 Dec 29 13:36 wtmp
root@DietPi3:~#

I have removed NO-IP config before next Apache2 install and it lead to success. Apache is working now.