New Plugin Help - Apache Status

kebirhost

Verified User
Joined
Jul 8, 2019
Messages
110
Hello,

I am trying to add Apache Status page plugin as Apache status on WHM. I have tried to add example plugin and modify it.

I have installed:
http://www.directadmin.com/hello_world.tar.gz

After that i tried to modify the index.html under the path:

/usr/local/directadmin/plugins/hello_world/admin/

I modified the index.html as:

#!/usr/local/bin/php
Hello World!<br>
This script is a <b>Admin</b> Script being run as <?=getenv('USERNAME')?><br>
<textarea rows=30 cols=85><?=shell_exec('apachectl fullstatus'); ?></textarea>



But blank page appeared. Could you help me to fix this issue please?

Thanks,
Melih
 
Hello,

It is most-likely due to a shell_exec() which is disabled in php.ini.
 
Hello,

I can run the command in php file via ssh.

php -f index.php

It shows apachectl fullstatus output without any issue.

This is very important section but i could not find in DA. I hope they will add Apache Status section ASAP.

Thanks,
Melih
 
Hello,

php -f index.php is working. There is no problem on ssh. We cannot see the output via browser.

Thanks,
Melih
 
Do you run plugin as root? I believe not.

Do regular users on your server have /sbin/ folder in their PATH ? I believe not.
 
login as admin
choose reseller
choose reseller tools
choose Customize Evolution skin

pick Admin or whichever level you want it on tab

choose the category to display in

I choose System info and files
it brings up add entry on right side.

choose Link not route
put in https://servername.domainname.com/server-status

name it and save

done
 
Hello,

Yes but everyone can see this link and see apache status also. Is not it true?

Thanks,
Melih
 
Hello Again,

You can do this adding route but i do not know where this folders located on server. For example;

PHP Configuration => Route => /admin/php-safe-mode

Thanks,
Melih
 
https://help.directadmin.com/item.php?id=91

no its based on what you put here

Code:
[COLOR=#000000][FONT='inherit']<Location /server-status>[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        SetHandler server-status[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        Order deny,allow[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        Deny from all[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        Allow from [/FONT][/COLOR][B]1.2.3.4
[FONT='inherit']</Location>[/FONT][/B]

I put only my IP here. Users don't need to see Apache status just the Admin.
 
Back
Top