New Plugin Help - Apache Status

kebirhost

Verified User
Joined
Jul 8, 2019
Messages
84
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
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,893
Location
GMT +7.00
Hello,

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

kebirhost

Verified User
Joined
Jul 8, 2019
Messages
84
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
 

kebirhost

Verified User
Joined
Jul 8, 2019
Messages
84
Hello,

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

Thanks,
Melih
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,893
Location
GMT +7.00
Do you run plugin as root? I believe not.

Do regular users on your server have /sbin/ folder in their PATH ? I believe not.
 

kebirhost

Verified User
Joined
Jul 8, 2019
Messages
84
Hello,

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

Thanks,
Melih
 

kebirhost

Verified User
Joined
Jul 8, 2019
Messages
84
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
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
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.
 
Top