Question

trouble installing, using php applications

Posted May 31, 2021 198 views
WordPressLAMP StackUbuntu 18.04

Hello,
from past few weeks i am having trouble using the applications such as prestashop, wordpress on my droplet with ip “167.172.240.226”. Often page does not respond or takes 3 to 5+ minutes just to get a response. I thought my prestashop got corrupted, so i re-installed the application and has the same issue. Even installing was very time consuming. It starts working fine, then all of a sudden it loads forever.

Same happpens with “phpmyadmin”, and “wordpress”.

Apache error logs says

[Mon May 31 10:21:55.693132 2021] [authz_core:error] [pid 3961] [client 45.146.164.125:44954] AH01630: client denied by server configuration: /var/www/html/vendor/phpunit

mysql error log is empty

followed this tutorial for LAMP installation on Digitalocean
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04

Ubuntu 18.04
Php 7.2 (tried 7.4)
mysql 5.7
using mysqlnativepassword

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hi @minhaj,

It seems to be your Apache Workers are full and this is causing your website slownest. I can see you are using a LAMP Stack so this might be beneficial for you.

So first, what are Apache Workers and what are they used for:

Imagine you are in a cinema, and there are 300 chairs inside. Those are the Apache Workers and the movie is your Webiste. If someone wants to watch the movie(your website) they need to sit in the chair (Apache Workers). If all 300 chars are taken, the 301 person needs to wait for someone to leave in order for them to sit and watch the movie. That’s how ApacheWorkers work. Once all ApacheWorkers are taken, a new person that wants to open your website waits for a spot to be open and only after that they can see your website.

Usually, these limits are set by 256 by default but they can be increased.

You can open your Apache configuration file. In there you should see something similar to:

ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000

Increase both the ServerLimit and MaxClients options, restart Apache, and see if this would solve your issue.

It’s possible they do not exist (haven’t been added) and the default values are the ones above. Adding them to the prefork content of apache mods should be fine as well.

Don’t forget to restart Apache afterward.

Regards,
KFSys

  • unfortunately it did not work. as always pages load initially, then all of a sudden while navigating to the same webpages just keep loading, and finally i get “the connection was reset” error page.

    • Hi @minhaj,

      When this happens can you check your Apache Workers and see if there are any free? This is the exact behaviour of filled up ApacheWOrkers.

Hi @minhaj,

To check your Apache Status you need to do a couple of changes.

*Enable mod_status:
*

sudo a2enmod status

Grant yourself access.

Open /etc/apache2/mods-enabled/status.conf:

Set ExtendedStatus to On (optional, but more awesomeness and a little slower)

Within the <Location /server-status>, append your IP address like so:

        <Location /server-status>
                SetHandler server-status
                Require local
                Require ip Your-IP-Address
        </Location>

Restart Apache:

sudo service apache2 restart

Enjoy the tool in your browser, for example: http://1.2.3.4/server-status

Keep pressing F5 to get updates.

When your Website starts loading endeslly, can you open it and see if all ApacheWorkers are actually filled up?

The ApacheWorkers are those ’.’ that can be see under the legend