Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 0.0.0.0:8080
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

1 Answer 1

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
www-data ALL=NOPASSWD: AP2RESTART
share|improve this answer

Your Answer

 
discard

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.