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
Something else is using the port clearly, try this command to find out who is using port 80
If you are not using that application, then kill it.
then you restart the apache server again
Hope it helps!!
You almost never use commands like
service
orsystemctl
around Docker containers. If you need to restart the service running in a container, stop, delete, and restart the containerDeleting 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.