Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a SaaS webapp service, so each time a new client is registered in my registration app, it creates a new subdomain and a new apache virtualhost config file, to enable this configuration I need to restart apache (is running on port 8080), how ever if I try to run either /etc/init.d/apache2 restart or apache2ctl restart under www-data (this is the user that is running my app) I get the following error:

Address already in use: make_sock: could not bind to address
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

How could I restart automatically apache?

OS is Ubuntu Server 10.10

share|improve this question
up vote 3 down vote accepted

You could add this to your sudoers file and then simply use sudo to you call the apache restart command.

Cmnd_Alias AP2RESTART=/etc/init.d/apache2
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.