# 6.34 fresh install Apache doesnt work

**URL:** https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797
**Category:** Troubleshooting
**Created:** [29 December 2020 06:14 UTC](https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797 "2020-12-29T06:14:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![teevee70](https://dietpi.com/forum/user_avatar/dietpi.com/teevee70/32/6038_2.png) [@teevee70](https://dietpi.com/forum/u/teevee70)
#### Post date: [29 December 2020 06:14 UTC](https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797/1 "2020-12-29T06:14:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![teevee70](https://dietpi.com/forum/user_avatar/dietpi.com/teevee70/32/6038_2.png) [@teevee70](https://dietpi.com/forum/u/teevee70)
#### Post date: [29 December 2020 07:04 UTC](https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797/2 "2020-12-29T07:04:05Z")

</div>

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/](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.

---

<div class="post-metadata">

### Author: ![teevee70](https://dietpi.com/forum/user_avatar/dietpi.com/teevee70/32/6038_2.png) [@teevee70](https://dietpi.com/forum/u/teevee70)
#### Post date: [29 December 2020 08:49 UTC](https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797/3 "2020-12-29T08:49:41Z")

</div>

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/](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) …

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [29 December 2020 10:59 UTC](https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797/4 "2020-12-29T10:59:03Z")

</div>

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

```plaintext
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

```plaintext
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

---

<div class="post-metadata">

### Author: ![teevee70](https://dietpi.com/forum/user_avatar/dietpi.com/teevee70/32/6038_2.png) [@teevee70](https://dietpi.com/forum/u/teevee70)
#### Post date: [29 December 2020 12:20 UTC](https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797/5 "2020-12-29T12:20:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [29 December 2020 12:39 UTC](https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797/6 "2020-12-29T12:39:34Z")

</div>

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

```nohighlight
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

```nohighlight
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:~#

```

---

<div class="post-metadata">

### Author: ![teevee70](https://dietpi.com/forum/user_avatar/dietpi.com/teevee70/32/6038_2.png) [@teevee70](https://dietpi.com/forum/u/teevee70)
#### Post date: [29 December 2020 12:43 UTC](https://dietpi.com/forum/t/6-34-fresh-install-apache-doesnt-work/4797/7 "2020-12-29T12:43:25Z")

</div>

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