1

I am trying to deploy an app in a Code Engine project. The container image is pretty standard: docker.io/library/httpd. All I did in the configuration wizard is to change the port from Code Engine default 8080 to port 80.

Code Engine comes back with:

Revision failed to start with "exit code 1". Check your image and configuration.

In the logs I found these two lines:

(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

Why?

data_henrik
  • 16,724
  • 2
  • 28
  • 49

1 Answers1

0

I don't know the answer to your question "why", except I see some people on Stackoverflow mention the range up to 1024 is reserved by the OS. I could run my httpd locally on port 80, but in the IBM Code Engine I had to change to 8080.

This is how I managed to get it running:

I edited the httpd.conf as this post implies:

"There is a hint on how to do this at the DockerHub page. An alternative config file must be obtained and added to the container via the Dockerfile.

First get a copy of the config file:

docker run --rm httpd:2.4 cat /usr/local/apache2/conf/httpd.conf > my-httpd.conf

Then edit the my-httpd.conf file and modify the port:

Listen 8080

Finally add to the Dockerfile the instruction to copy it:

COPY ./my-httpd.conf /usr/local/apache2/conf/httpd.conf "

  • Right, opening a port in the lower than 1024 range would require privileged status, which is something you do not really want anyway for security reasons. Hence the usage of port 8080, which is then publicly exposed at the application route and proper certificate on port 80 for end users. This should be the accepted answer. – Matthias Diester Jul 07 '23 at 08:25