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.
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.
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.