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 want to add 300-400 add on domains and wild card subdomains.

Every time I add an add on domain, cpanel does a graceful restart.

The result is the whole server is down for 5-10minutes.

If I did:

tail -f /usr/local/apache/logs/error_log


    [Sun Dec 30 23:11:18 2012] [notice] Graceful restart requested, doing restart
[Sun Dec 30 23:18:01 2012] [notice] SSL FIPS mode disabled
[Sun Dec 30 23:18:01 2012] [notice] Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 configured -- resuming normal operations 

If I do:

tail -f /usr/local/cpanel/logs/error_log
[2012-12-30 23:11:17 -0600] info [parkadmin] Creating Addon domain 'massadult.com' on 'massadult.freemarketforever.com'.
[2012-12-30 23:11:23 -0600] info [parkadmin] 'local' datastore in use (/var/cpanel/conf/apache/local)
/usr/local/cpanel/bin/ftpadmin : Syncing Ftp Databases....
[2012-12-30 23:13:42 -0600] info [cpmysqladmin] Creating MySQL database freemark_massadult for user freemark 

Sometimes, [2012-12-30 22:37:36 -0600] info [ensure_vhost_includes] 'local' datastore in use (/var/cpanel/conf/apache/local) shows up in cpanel error_log which could be the problem of why it took so long to graceful restart httpd.

So basically I want to add tons of add on domains and then do apache restart once. I've heard we can modify a script slightly to prevent this from happening. But which script and how?

share|improve this question
2  
This is reason number 14872582 to not use cPanel. –  EEAA Jan 2 '13 at 6:49
    
Why the downvote if I may know? –  Septiadi Agus Jan 3 '13 at 5:12
    
The downvote wasn't from me. If I were to guess, though, it was due to the involvement of cPanel, which isn't looked upon well here. It tends to do things in non-standard ways and as such, makes troubleshooting quite difficult. My recommendation would be to ditch cPanel and commit to learning real linux sysadmin. –  EEAA Jan 3 '13 at 5:17
    
And how do anyone manage hundreds of domains without cpanel? –  Septiadi Agus Jan 3 '13 at 5:18
1  
Honestly? Vim. Or perhaps something like Puppet. –  EEAA Jan 3 '13 at 5:20

2 Answers 2

up vote 3 down vote accepted

Please note that graceful restart is done any time cPanel makes an update to the Apache configuration. It is not the same as a full Apache restart. After a graceful restart, the uptime reported by /usr/local/apache/bin/apachectl status stays the same. A graceful restart is really a reloading of the configuration values, and should not affect the functioning of your sites.

In your case, the graceful restart is taking a long time, it means there must be an issue with you cPanel server, in this case you need to contact your serever admin and recheck the issue completely. Also if you want you can open ticket in cPanel support ticket.

share|improve this answer
    
I am the server admin. I guess I'll make tickets. It tends to happen when server load is high. –  Septiadi Agus Jan 2 '13 at 6:01
    
4 more reputation and I can upvote :) –  Septiadi Agus Jan 6 '13 at 0:39

After add a domain cpanel invokes /scripts/restartsrv_apache internally. If you see the source code it invokes to /usr/local/cpanel/scripts/restartsrv_httpd script.

In that script, looking at source code, you can see interesting file flags for disable the apache restart like:

  • /etc/httpddisable
  • /etc/apachedisable
  • /etc/httpdisable
  • /var/cpanel/mgmt_queue/apache_update_no_restart

This last flag it is poorly documented in cPanel EasyApache docs.

Disabling that should help to mitigate the effect of restart/graceful apache each time that you add a domain. Remember restart Apache when you finish enable again the flag, because until apache will be restarted it would not notice the new domains for attend the requests.

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.