Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected apache install #15

Open
simon-ball opened this issue Aug 23, 2023 · 4 comments
Open

Unexpected apache install #15

simon-ball opened this issue Aug 23, 2023 · 4 comments

Comments

@simon-ball
Copy link

PLEASE READ THE DOCUMENTATION BEFORE SUBMITTING AN ISSUE

Describe the bug
On a fresh install on Ubuntu 22.04 (Debian 12), Apache is installed and started. As far as I can tell, service starting is alphabetical, such that apache2.service will always start (and bind port 80) before caddy.service starts. Consequently, caddy will never start successfully, since it cannot bind its main port.

The resulting symptom is that navigating to http://hostname results in the Apache2 welcome page, rather than the expected Caddy-hosted Birdnet page

To Reproduce
Steps to reproduce the behavior:

  1. Fresh install on Ubuntu 22.04 server virtual machine
  2. Installation of MatthewBCooke/BirdNET-Pi via the newinstaller.sh script as described in the readme
  3. Via a browser on another computer, navigate to http://hostname
  4. The Apache2 welcome page is displayed (indicating that Apache 2 is installed and running, but not configured to host any particular content)

Expected behavior
Apache2 should not be installed in the first place, as it is not used by birdnet.

Your build
x86 virtual mac hine hosted on esxi7.0 update 1
Fresh install of Ubuntu 22.04.3 LTS server (Jammy Jellyfish)
No other packages installed or modified.

Code or log snippets

Apache shows up in the installation log:

647  + apt install -qqy caddy ftpd sqlite3 php-sqlite3 alsa-utils pulseaudio avahi-utils sox libsox-fmt-mp3 php php-fpm php-curl php-xml php-zip icecast2 swig ffmpeg wget unzip curl cmake make bc libjpeg-dev zlib1g-dev python3-dev python3-pip python3-venv lsof net-tools
<...>
663  The following additional packages will be installed:
   664    alsa-topology-conf alsa-ucm-conf apache2 apache2-bin apache2-data
   665    apache2-utils avahi-daemon build-essential bzip2 cmake-data cpp cpp-11
<...>

That relates to the dependencies installed in install_services.sh: https://github.com/MatthewBCooke/BirdNET-Pi/blob/debian/scripts/install_services.sh#L20C24-L20C24

Using apt-cache rdepends, to trace back up the dependency chain, it seems as if this is ultimately demanded by php - at least, the default version of php installed on 22.04

$ apt-cache rdepends --installed apache2
apache2
Reverse Depends:
  libapache2-mod-php8.1
 |javascript-common
  libapache2-mod-php8.1

$ apt-cache rdepends --installed libapache2-mod-php8.1
libapache2-mod-php8.1
Reverse Depends:
 |php8.1
 |php8.1

$ apt-cache rdepends php8.1 --installed
php8.1
Reverse Depends:
  php

(This touches on a separate related bug: that the installed caddyfile explicitly demands php7.4, while the installtion process allows for whatever the default/latest php version happens to be)

I note that you explicitly advise the use of Debian 11 on the front readme page, so you might consider this to be a future compatibility problem, rather than a critical problem for now.

@simon-ball
Copy link
Author

simon-ball commented Aug 23, 2023

I've not yet tested falling back to Debian 11 - naughty me - but I can mitigate the joint issues on 22.04 by disabling the apache2 service and modifying the caddyfile

systemctl disable apache2.service
sed -i "s/php7.4-/php8.1-/g" /etc/caddy/Caddyfile

(Edit to add: if you update the web interface password, you need to do this again, because the script that reqwrites the basicauth secret rewrites the entire caddyfile, restoring this hardcoded php version)

@simon-ball
Copy link
Author

The same thing, at least, happens in Ubuntu 20.04 LTS (which is Debian 11 based).

@MatthewBCooke
Copy link
Owner

Thanks for the detailed report. I'll take a closer look later this week.

PS. We seem to be in the exact same field, would love to chat.

@simongis
Copy link

simongis commented Feb 2, 2025

I made the mistake of using debian 12 image and am in a similar situation.
I can see during the install some red errors around apache2 not starting up correctly.
Image

After install finishes and it reboots, http://birdnetpi.local/ returns the welcome page for Tomcat

Tried the following as suggested by @simon-ball.
Image

Doing a reboot of the VM, I get a 403 error when hitting the url.

I have rolled back to Debian v11 and cannot replicate (although having other issues).
Hope the above findings might assist if debian 12 support is something on the roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants