4

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?

Septiadi Agus
  • 291
  • 1
  • 4
  • 10
  • 2
    This is reason number 14872582 to **not** use cPanel. – EEAA Jan 02 '13 at 06:49
  • Why the downvote if I may know? – Septiadi Agus Jan 03 '13 at 05: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 03 '13 at 05:17
  • And how do anyone manage hundreds of domains without cpanel? – Septiadi Agus Jan 03 '13 at 05:18
  • 1
    Honestly? [Vim](http://www.vim.org/). Or perhaps something like [Puppet](http://puppetlabs.com/). – EEAA Jan 03 '13 at 05:20
  • Again, I'd like to point out that many of us are *forced* to use cPanel. Often we're sysadmins at hosting companies. Neither `vim` nor Puppet provide *end users* with ways to manage their email addresses, create forwarders, edit `.htaccess` files using a GUI, view and manage log files and stats, track quota and bandwidth usage, install web software... the list goes on. Just because our companies make us use cPanel doesn't mean we're bad sysadmins :-) That being said, an Apache graceful restart should not bring Apache down and should not take 5-10 minutes. *That's* the issue here, not cPanel. – Josh Jul 21 '14 at 00:48
  • This question appears to be off-topic because it is about [`working with a service provider's management interface, such as cPanel`](http://serverfault.com/help/on-topic). – HopelessN00b Jan 13 '15 at 20:39

2 Answers2

3

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.

Khaled
  • 36,533
  • 8
  • 72
  • 99
jyotiprakash
  • 162
  • 1
  • 5
0

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.

shakaran
  • 356
  • 1
  • 7
  • 19