How to build a CWP Module

How to build a CWP Module

How to Build a new module for CentOS Web Panel (CWP)?

It’s very easy to build a new module for the CentOS-WebPanel
Let’s create file named: test2.php



<?php $cpu_info = shell_exec("cat /proc/cpuinfo"); echo "This is example module<br>"; echo "You can edit this file and make new modules based on this file<br>"; echo "Examples and functions are on our website: centos-webpanel.com<br>"; echo "<h3>CPU INFO</h3>"; echo "<pre>".$cpu_info."</pre>"; ?>

to open this file in CentOS-WebPanel, upload it to the modules folder and use this link path:
https://SERVER_IP:2030/index.php?module=FILE_NAME

eg. https://123.123.123.123:2030/index.php?module=test2

How to add this module into the CentOS-WebPanel menu?

It’s easy, go to include folder and make a new file named 3rdparty.php, in this file you can add links (one per a line).
eg.

cwp.admin: /usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php
cwp.client: /usr/local/cwpsrv/htdocs/resources/client/include/3rdparty.php

<li><a href="index.php?module=test2"><span class="icon16 icomoon-icon-arrow-right-3"></span>Test2 Module</a></li>
<li><a href="index.php?module=test3"><span class="icon16 icomoon-icon-arrow-right-3"></span>Test3 Module</a></li>


All useful modules will be added in CWP installation

Admin panel modules location
/usr/local/cwpsrv/htdocs/resources/admin/modules

Client panel modules location
/usr/local/cwpsrv/htdocs/resources/client/modules

Example module developed by the 3rdParty

https://github.com/boxbillinggit/cwp_modules/blob/master/php_phalcon.php

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Initial Server Setup with CentOS 7

Initial Server Setup with CentOS 7  Introduction When you first create a new server, there are...

How To Create an SSL Certificate on Apache for CentOS 7

How To Create an SSL Certificate on Apache for CentOS 7  Introduction TLS, or "transport layer...

How to Install and Configure phpMyAdmin on CentOS 7

phpMyAdmin is an open source tool used for the administration of MySQL. In addition to offering...

How To Set Up Apache Virtual Hosts on CentOS 7

Introduction The Apache web server is the most popular way of serving web content on the...

How To Connect To Your Droplet with SSH

How To Connect To Your Droplet with SSH  Introduction If you have recently created a...