Docker -> AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.23.0.3. Set the 'ServerName' directive globally to suppress this message

I am trying to host the FarmOS throught docker and i ma doing it by this command “docker-compose -f docker-compose.yml up” and i get following results
{Creating farmos_db_1 … done
Creating farmos_www_1 … done}
and i can see it in docker windows application, but i cant access the application on localhost, there is something that i have to configure “ServerName” i did tried to seatch it in the directory but haven’t found anything related,

1 Like

Hi @raheel - welcome to the forum!

That Apache message is harmless. It is just a notice, and can be ignored.

FWIW in farmOS 2.x I recently fixed that so it doesn’t show up anymore: Set Apache ServerName directive globally to suppress AH00558 message. · farmOS/farmOS@cabae65 · GitHub

Based on your logs (although they are cut off) I think farmOS / Apache is running properly. So it may just be an issue with http://localhost resolving to the Docker container.

Does it work if you go to http://127.0.0.1 instead?

As per your reply its not loading at local host, On using the up command i get this error,

,
i tried to change the port to 81 in .yml file but still it didn’t got deployed to the localhost on 81 port.
Following are my .yml configurations.

version: ‘2’

services:

db:

image: mariadb:latest

volumes:

  - './db:/var/lib/mysql'

ports:

  - '3306:3306'

environment:

  MYSQL_ROOT_PASSWORD: farm

  MYSQL_DATABASE: farm

  MYSQL_USER: farm

  MYSQL_PASSWORD: farm

www:

depends_on:

  - db

image: farmos/farmos:dev

volumes:

  - './www:/var/www/html'

ports:

  - '80:80'

environment:

  XDEBUG_CONFIG: remote_host=172.17.0.1

It looks like you are already running other software on port 80.

In order to change to port 81, your docker-compose.yml file’s ports should be: '81:80'. This will say “send any traffic from port 81 on my localhost to port 80 inside this container”. Apache is running in the Docker container and is listening on port 80, but you can map YOUR port 81 to ITS port 80, if that makes sense. Give that a try and see if http://localhost:81 works in your browser.