Apache in Containers – Troubleshooting Run Issues

apache-2.4arch-linuxcontainersUbuntu

I am running Arch Linux and on top of that, Ubuntu inside a systemd-nspawn container. I am suddenly having issues getting apache to start (inside the container).

Everything was working fine a few days ago, but now it's not. I don't know if an update inside or outside of the container has changed something.

Inside the container, I see the following:

root@container:~# apachectl -k start
/usr/sbin/apachectl: 99: ulimit: error setting limit (Operation not permitted)
Setting ulimit failed. See README.Debian for more information.
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action '-k start' failed.
The Apache error log may have more information.

I checked using lsof and netstat and nothing else is running on ports 80/443. Also, what is that "ulimit" error? What's going on there?

I did use sudo systemctl edit systemd-nspawn@my-container.service to edit the settings to disable private networking and enable some bind mounts:

[Service]
ExecStart=
ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest -U --settings=override --machine=%i \
        --bind-ro=/etc/resolv.conf:/etc/resolv.conf \
        --bind=/home/nticompass/Code/website:/opt/website

Yes, the apache config inside the container is setup to use /opt/website as its root. I have it bind mounted so I can use my IDE on my main OS (Arch Linux) to edit the files and then have the container be able to access them (without having to copy/transfer them).

I am not sure what to do here. Did something change in an update? Do I need to update a config on my Arch Linux? Why can't the container access the ports? What is that "ulimit" error?

EDIT: Here is a list of packages that were upgraded/installed in the last week on my Arch Linux (main) system: https://pastebin.com/5xyGpBrw

Best Answer

We cannot tell if an update changed something, because there isn't any information about updates in your question. We need to know what updates have been installed in the system before it stopped working.

Both the ulimit error and Apache start-up failure are most likely caused by insufficient privileges.

So, definitely something changed how your container is started up.

Related Topic