bash: apache2ctl: command not found
How do I resolve please?
bash: apache2ctl: command not found
How do I resolve please?
Should be part of apache2 package. Did you install apache2 already?
Yes worked until upgrading to bullseye
How can I reinstall Apache and will it remove all my web folders?
dietpi-software reinstall 83
It won’t remove your web servers, but you should always keep a backup! You will be reminded to take one before it starts reinstalling.
Did a reinstall of Apache and still the same
Try:
apt install --reinstall apache2
───────────────────────────────────────────────────── 15:00:44 BST 2021 armv7l
DietPi v7.6.2 : 17:51 - Sun 09/19/21
───────────────────────────────────────────────────── are free software;
- Device model : RPi 4 Model B (armv7l)ogram are described in the
- CPU temp : 45'C : 113'F (Optimal temperature)
- LAN IP : 192.168.86.55 (eth0)
- MOTD : DietPi v7.6 release notes:LY NO WARRANTY, to the extent
https://dietpi.com/docs/releases/#september-2021-version-76
─────────────────────────────────────────────────────42
DietPi Team : MichaIng (lead), Daniel Knight (founder), Joulinar (support)
Image by : DietPi Core Team (pre-image: Raspberry Pi OS Lite)
Web : https://dietpi.com | https://twitter.com/DietPi_
Patreon Legends : Camry2731
Contribute : https://dietpi.com/contribute.html
DietPi Hosting : Powered by https://myvirtualserver.com
dietpi-launcher : All the DietPi programs in one place
dietpi-config : Feature rich configuration tool for your device
dietpi-software : Select optimised software for installation
htop : Resource monitor
cpu : Shows CPU information and stats
dietpi@Burgess-Server:~$ apt install --reinstall apache2
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
dietpi@Burgess-Server:~$ sudo apt install --reinstall apache2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 266 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf apache2 armhf 2.4.48-3.1+deb11u1 [266 kB]
Fetched 266 kB in 0s (694 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 94863 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.48-3.1+deb11u1_armhf.deb ...
Unpacking apache2 (2.4.48-3.1+deb11u1) over (2.4.48-3.1+deb11u1) ...
Setting up apache2 (2.4.48-3.1+deb11u1) ...
apache-htcacheclean.service is a disabled or a static unit not running, not starting it.
dietpi@Burgess-Server:~$ apache2ctl
-bash: apache2ctl: command not found
dietpi@Burgess-Server:~$
Please check the following:
ls -l /usr/sbin/apache2ctl
which apache2ctl
echo $PATH
Linux Burgess-Server 5.10.60-v7l+ #1449 SMP Wed Aug 25 15:00:44 BST 2021 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
─────────────────────────────────────────────────────
DietPi v7.6.2 : 18:34 - Mon 09/20/21
─────────────────────────────────────────────────────
- Device model : RPi 4 Model B (armv7l)
- CPU temp : 44'C : 111'F (Optimal temperature)
- LAN IP : 192.168.86.55 (eth0)
- MOTD : DietPi v7.6 release notes:
https://dietpi.com/docs/releases/#september-2021-version-76
─────────────────────────────────────────────────────
DietPi Team : MichaIng (lead), Daniel Knight (founder), Joulinar (support)
Image by : DietPi Core Team (pre-image: Raspberry Pi OS Lite)
Web : https://dietpi.com | https://twitter.com/DietPi_
Patreon Legends : Camry2731
Contribute : https://dietpi.com/contribute.html
DietPi Hosting : Powered by https://myvirtualserver.com
dietpi-launcher : All the DietPi programs in one place
dietpi-config : Feature rich configuration tool for your device
dietpi-software : Select optimised software for installation
htop : Resource monitor
cpu : Shows CPU information and stats
dietpi@Burgess-Server:~$ ls -l /usr/sbin/apache2ctl
-rwxr-xr-x 1 root root 7229 Sep 1 2020 /usr/sbin/apache2ctl
dietpi@Burgess-Server:~$ which apache2ctl
dietpi@Burgess-Server:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
dietpi@Burgess-Server:~$
you are going to execute the command as non-root user. Therefore path variable is missing full path to apache2ctl
Pls try sudo apache2ctl as current user or use user root
Ahh, that’s the mystery. Good to keep in mind that sbin directories are not in the PATH when doing interactive shell sessions with non-root users.
Magic! Cheers