Status->Apache restart not working

When I click on Restart Apache button, I have this error:

[code:1]* Starting web server apache2
(98)Address already in use: make_sock: could not bind to address
no listening sockets available, shutting down
Unable to open logs
And Apache not working.

And when I am trying to start Apache:

[code:1]Failed to start service :


  • Starting web server apache2
    (Apache now woks)

When I use terminal /etc/init.d/apache2 restart Apache restarts and WEB server is working (restarting takes about 10 seconds).

Maybe it is because I have installed many php modules (php5-ffmpeg, php5-mysql, php-mcrypt, php-gettext, php getid3 and some other modules)?

How and where can I add additional shell command when someone is trying to stop or restart apache (for example, when adding new site, update site…)? Where do I put killall -v apache2?

Any clues in the Apache logs as to why startup is so slow? I wouldn’t think a few PHP modules would slow it down that much. (Also, why not run php under mod_fcgid/mod_suexec, and avoid including mod_php entirely? It’s more secure, and about the same performance for almost all use cases. This is orthogonal to your problem, I think, I’m just curious.)

Anyway, starting and stopping of Apache is configurable in the Apache module.

Browse to Webmin:Servers:Apache Webserver

Click on Module Config

Select System Configuration

And set "Command to Stop Apache" and optionally "Command to apply configuration".