If you can access httpd.conf or apache2.conf (depending on your system), set the value of Timeout to a larger value.
E.g.
Timeout 300
If you are using CentOS Web Panel (CWP), you need to modifiy the following file to set Timeout to a large value:
/usr/local/apache/conf/extra/httpd-default.conf
After updating the file, restart Apache.