skip to Main Content

While trying to create a lamp stack in docker container, after configuring files
when try to restart with command

service apache2 restart 

It throws error

[....] Restarting Apache httpd web server: apache2/usr/sbin/apache2ctl: 99: ulimit: error setting limit (Operation not permitted)
Setting ulimit failed. See README.Debian for more information.
(98)Address already in use: 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 'start' failed.
The Apache error log may have more information.
 failed!

Even i’ve tried with

service apache2 reload
apache2 graceful

2

Answers


  1. Something else is using the port clearly, try this command to find out who is using port 80

    netstat -plnt
    

    If you are not using that application, then kill it.

    kill -15 <pid>
    

    then you restart the apache server again

    service apache2 reload
    

    Hope it helps!!

    Login or Signup to reply.
  2. You almost never use commands like service or systemctl around Docker containers. If you need to restart the service running in a container, stop, delete, and restart the container

    docker stop my-apache
    docker rm my-apache
    docker run --name my-apache -p ... -v ... httpd:2.4
    

    Deleting and restarting containers this way is extremely routine. My sample docker run command has a placeholder -v option; typically you’d use this to inject configuration into the container at startup time, so that nothing is lost when you do delete the container.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search