Score:1

Find the script an Apache process is running

bf flag
Tom

I have Apache 2.4 configured as mpm_prefork on an Ubuntu server.

It happens that via htop I have seen that there are processes that use a lot of CPU.

How do I find out exactly what url/php script this Apache process is running on my site? Eg.:

PID CPU Time User Command Script (information I don't have)
123 80% 0:01:30 www-data /usr/bin/apache2 -k start /site-folder/index.php/controller/function_abc
123 5% 0:02:30 www-data /usr/bin/apache2 -k start /site-folder/index.php/controller_2/function_123

I cannot activate mod_status as CIS does not recommend using this module.

Score:1
us flag
Rob

The recommendation not to enable mod_status is rooted in the fact that if it is made available, then it will be available server-wide.
When you then also allow .htaccess files (which is default or most Apache httpd deployments) then every user that can edit/create .htaccess files can enable the status URL. Unlike most directives that can be enabled/configured from .htaccess files the scope of the status URL is not limited to the directory path in which the .htaccess file is placed, but exposes the status of the whole server and all sites hosted there. That can be a severe security risk/information leak on a shared server.

That security risk does not need to exist.

When the server is not used by many different webmasters rather than relying on .htaccess files the server admins can load all directives into the static configuration, in the httpd.conf (and/or into snippets that get included from the sites-enabled and/or conf.d etc. sub-directories. ).
Then disable all .htaccess (by setting AllowOverride none). That also improves performance by the way.
Then only the administrator can enable the status URL and when proper access controls are set on that URL there is no risk in using mod_status.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.