Displaying full Apache status in CWP

In this guide i am going to explain how to create a new module in CWP

The meny item under plugins are added in the file located at /usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php it holds the actual text displayed under plugins.

In this guilde we are going to make a module for the full apache status. CWP only display partial apache status under the Webserver Settings -> Apache Status page.

We need to add the following code to the 3rdparty.php file

After we have added the menu item its time to add the files needed to run the functions for getting the bandwidth statistics. In the code above it uses «?module=apache_status» as the plugin name/url.
You have to go to /usr/local/cwpsrv/htdocs/resources/admin/modules and add the file apache_status.php in that folder. The content i chose to use in that file are the following code.

<noscript>
<li class="custom-menu"> <!-- this class "custom-menu" was added so you can remove the Developer Menu easily if you want -->
        <a href="index.php?module=apache_status"><span class="icon16 icomoon-icon-arrow-right-3"></span>Apache Status</a>
</li>
</noscript>
<script type="text/javascript">
        $(document).ready(function() {
                var newButtons = ''
                +' <li>'
                +' <a href="?module=apache_status"><span aria-hidden="true" class="icon16 icomoon-icon-arrow-right-3"></span>Apache Status</span></a>'
                +'</li>';
                $("ul#mn-15-sub").prepend(newButtons);
        });
</script>

That will add the Menu item under plugins. Now we need to create the functions to get the apache status from the server. We are using the server-status module in Apache to do that.

After that is installed open nano and the file apache_status.php. You could also open FTP to edit these files.

nano /usr/local/cwpsrv/htdocs/resources/admin/modules/apache_status.php

Add this content to the file

<?php
// Apache Status - Accesses v0.3

$url = "http://localhost/server-status";
$ch_session = curl_init();
curl_setopt($ch_session, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch_session, CURLOPT_URL, $url);
$result_url = curl_exec($ch_session);
echo $result_url;
?>

Now open the CWP Admin and it will look something like this:

That all you have to do. Follow me to get more update and functions like this.