### Plugin Development - First Steps Source: https://www.ispmanager.com/docs/developer-guide/add-a-custom-frame-to-the-panel-interface Guides for getting started with plugin development, including a 'Hello, World!' example. ```APIDOC ## First Steps: "Hello, World!" plugin ### Description This section provides a basic 'Hello, World!' example to help developers get started with creating plugins for ispmanager. ### Method N/A (Documentation Guide) ### Endpoint N/A (Documentation Guide) ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### ISPmanager Installation Guide Source: https://www.ispmanager.com/docs/ispmanager/automatic-troubleshooting Provides a general overview and steps for installing ispmanager on a server. It may include prerequisites, installation commands, and initial setup procedures. ```bash # Example command to start ispmanager installation script (hypothetical) # sh install.sh # Example command to update ispmanager # yum update ispmanager-panel # or # apt-get update && apt-get upgrade ispmanager-panel ``` -------------------------------- ### ispmanager Installation Guide Source: https://www.ispmanager.com/docs/ispmanager/create-a-database This section provides a detailed guide for installing ispmanager. It covers system requirements and the step-by-step process for setting up the control panel on a server. ```ispmanager ### ispmanager installation guide ``` -------------------------------- ### Install and Configure PHP Source: https://www.ispmanager.com/docs/ispmanager/data-import-for-administrators Guides on setting, changing, and managing PHP versions and extensions within ispmanager. Includes instructions for adding alternative PHP versions and installing extensions manually. ```bash # Example: Installing a PHP extension using pecl # Ensure you have the correct PHP development headers installed. # Replace 'imagick' with the desired extension name. # Install the extension using pecl pecl install imagick # Add the extension to your php.ini file (path may vary) echo "extension=imagick.so" >> /etc/php/8.1/fpm/conf.d/20-imagick.ini # Restart the PHP-FPM service systemctl restart php8.1-fpm ``` ```bash # Example: Installing Composer for PHP project management # Download the installer php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" # Verify the installer signature (optional but recommended) php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce6548638190f3718471b762141c32840082f175533624077a5b96571945672743984f089348735219760633720062') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" # Run the installer php composer-setup.php # Remove the installer php -r "unlink('composer-setup.php');" # Move composer.phar to a global location (optional) mv composer.phar /usr/local/bin/composer ``` -------------------------------- ### PHP Setup API Source: https://www.ispmanager.com/docs/ispmanager/ispmanager-api Manages PHP versions and their configurations. ```APIDOC ## POST /phpinstall ### Description Manages PHP versions and their configurations, including CGI, Apache module, and FastCGI settings. ### Method POST ### Endpoint /phpinstall ### Parameters #### Query Parameters - **name** (string) - Required - The PHP version to install or manage. - **props** (string) - Optional - The status of the PHP version (e.g., 'on', 'off'). - **mod_cgi** (string) - Optional - Enable or disable CGI for the PHP version. - **mod_apache** (string) - Optional - Enable or disable Apache module for the PHP version. - **mod_fpm** (string) - Optional - Enable or disable FastCGI (Nginx + PHP-FPM) for the PHP version. ### Request Example ```json { "name": "8.1", "mod_fpm": "on" } ``` ### Response #### Success Response (200) - **message** (string) - Success or error message indicating the result of the PHP setup operation. #### Response Example ```json { "message": "PHP 8.1 FastCGI enabled successfully." } ``` ``` -------------------------------- ### Working with Python and Django in ispmanager Source: https://www.ispmanager.com/docs/ispmanager/waf This guide covers setting up and managing Python applications, including installing the Django framework, within ispmanager. It enables hosting Python-based web applications. Requires Python environment setup. ```bash # Example command to install Django (conceptual, ispmanager may offer integrated solutions) # pip install django ``` ```bash # Example command to run a Python application (conceptual) # python manage.py runserver 0.0.0.0:8000 ``` -------------------------------- ### Database Management (MySQL, PostgreSQL) Source: https://www.ispmanager.com/docs/ispmanager/spamexperts Instructions for setting up and managing database systems like MySQL and PostgreSQL. Covers creating DBMS, adding existing ones, configuring databases and users, and performing import/export operations. ```bash # Example: Creating a MySQL database (conceptual) mysql -u root -p -e "CREATE DATABASE mydatabase;" ``` ```bash # Example: Creating a PostgreSQL database (conceptual) # Assumes postgres user has necessary privileges createdb -U postgres mydatabase ``` ```bash # Example: Importing a MySQL database from a file (conceptual) mysql -u myuser -p mydatabase < backup.sql ``` ```bash # Example: Exporting a MySQL database to a file (conceptual) mysqldump -u myuser -p mydatabase > backup.sql ``` -------------------------------- ### PHP Example: Using Monolog Dependency Source: https://www.ispmanager.com/docs/ispmanager/php-composer This PHP code demonstrates how to use the Monolog logging library after it has been installed via Composer and its autoloader included. It shows basic logger setup and logging of different severity levels. ```php pushHandler(new StreamHandler('app.log', Logger::DEBUG)); $logger->info('This is log'); $logger->warning('This is log warning'); $logger->error('This is log error'); ?> ``` -------------------------------- ### Plugin Examples - Solving Typical Problems Source: https://www.ispmanager.com/docs/developer-guide/add-a-custom-frame-to-the-panel-interface A collection of practical examples demonstrating how to solve common problems using plugins in PHP, Python, and Node.js. ```APIDOC ## Examples of solving typical problems ### Description This section provides practical code examples in PHP, Python, and Node.js to illustrate how to implement various functionalities and solve common challenges when developing ispmanager plugins. ### Method N/A (Documentation Guide) ### Endpoint N/A (Documentation Guide) ### Parameters #### Examples of plugins in PHP, Python, Node.js - **language** (string) - The programming language used for the plugin example (PHP, Python, Node.js). - **functionality** (string) - A brief description of the problem the example solves. #### Plugin example. Standard website creation button - **description** (string) - Details on how to create a plugin that adds a standard website creation button. #### Report plugin example - **description** (string) - Guidance on developing plugins to generate custom reports. #### Example of using ispmanager API in plugin: output of a database list - **api_call** (string) - Example demonstrating how to call the ispmanager API to retrieve a list of databases. #### Example of using form field values in the handler - **description** (string) - How to access and utilize values submitted through plugin forms within the handler code. #### How to add a quick action to the dashboard - **description** (string) - Instructions for adding custom quick action buttons to the ispmanager dashboard. #### Plug-in example: how to add a menu item - **description** (string) - Steps to add new menu items to the ispmanager interface via a plugin. #### Plug-in example. How to add icons to custom menu items - **description** (string) - Guidance on incorporating icons for custom menu items created by plugins. #### Add checkbox to a form - **description** (string) - How to include checkbox input fields in plugin-generated forms. #### Plugin example. Adding a new S3 storage - **description** (string) - Example demonstrating how to add support for S3 storage as a new module. #### Add module to ispmanager - **description** (string) - General instructions on how to add new modules to the ispmanager panel. #### Plug-in example: templates engine management - **description** (string) - Example of a plugin that manages the templates engine. #### How to add a custom frame to the panel interface - **description** (string) - Instructions on embedding external web content as frames within the ispmanager panel interface, using Ubuntu 20 and Roundcube as an example. #### Notifications center - **description** (string) - Information on how to integrate with or utilize the ispmanager notifications center. #### Add a new language to the control panel - **description** (string) - Steps for adding support for a new language to the ispmanager control panel. ### Request Example N/A ### Response N/A ``` -------------------------------- ### Composer Configuration File Example (composer.json) Source: https://www.ispmanager.com/docs/ispmanager/php-composer An example of a composer.json file, which is the main configuration file for Composer. It specifies project metadata and the dependencies required for the project, including their version constraints. ```json { "require": { "monolog/monolog": ">=1.0.2 <2.1.2" }, "description": "This example", "keywords": ["testing", "example"], "type": "project", "version": "1.0.0", "homepage": "https://example.com", "readme": "readme.md", "license": "MIT", "authors": [{ "name": "User", "email": "user@example.com", "homepage": "https://www.example.com", "role": "Developer" }], "support": { "email": "support@example.org" } } ``` -------------------------------- ### ispmanager Installation with Specific Version Source: https://www.ispmanager.com/docs/ispmanager/ispmanager-installation-guide Installs a specific version of ispmanager (e.g., 6.40). The release parameter uses a calculated version number based on the changelog. This example installs ispmanager-lite. ```shell sh install.eu.sh --release 5.335 ispmanager-lite ``` -------------------------------- ### Run ispmanager Installation Script Source: https://www.ispmanager.com/docs/ispmanager/ispmanager-installation-guide This command executes the downloaded ispmanager installation script. The script will guide you through the installation process, including selecting update branches, editions, and software components. ```bash sh install.eu.sh ``` -------------------------------- ### Set Up Websites and Redirects in ispmanager Source: https://www.ispmanager.com/docs/ispmanager/two-step-authentication Guides on adding new websites, configuring their settings, and implementing redirects for URL management within ispmanager. Covers basic website setup and advanced redirection rules. ```bash # Example command to add a website via ispmanager CLI # Actual commands and parameters may vary. # This is a conceptual representation. /usr/local/ispmanager/sbin/ispmgr --add-site example.com --owner user1 ``` ```apache # Example Apache configuration for a redirect ServerName old-example.com Redirect permanent / http://www.example.com/ ``` ```nginx # Example Nginx configuration for a redirect server { listen 80; server_name old-example.com; return 301 http://www.example.com$request_uri; } ``` -------------------------------- ### Install Django with Python in ispmanager Source: https://www.ispmanager.com/docs/ispmanager/monitoring This guide explains how to work with Python applications in ispmanager, specifically focusing on installing the Django framework. It assumes Python is already configured or installed. ```bash # Example command to install Django using pip within a virtual environment: # First, ensure Python and pip are available and potentially set up a virtual environment. # python3 -m venv myenv # source myenv/bin/activate # pip install django # To configure a web server (like Apache or Nginx) to serve a Django application, # you would typically use a WSGI server like Gunicorn or uWSGI, configured via ispmanager. ``` -------------------------------- ### Install Django with Python in ispmanager Source: https://www.ispmanager.com/docs/ispmanager/ansible-scripts This guide provides instructions on how to install and work with Python, specifically focusing on installing the Django framework within the ispmanager environment. ```bash # Example command to install Django using pip pip install django ``` -------------------------------- ### Manage Databases (MySQL, PostgreSQL) Source: https://www.ispmanager.com/docs/ispmanager/customizing-the-panel Instructions for setting up and managing database management systems (DBMS) like MySQL and PostgreSQL. Covers creating databases, users, importing/exporting, and remote access configurations. ```sql -- Example: Creating a MySQL database -- CREATE DATABASE mydatabase; -- GRANT ALL PRIVILEGES ON mydatabase.* TO 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; -- FLUSH PRIVILEGES; ``` ```sql -- Example: Creating a PostgreSQL database -- CREATE DATABASE mypgdatabase; -- CREATE USER mypguser WITH PASSWORD 'mypgpassword'; -- GRANT ALL PRIVILEGES ON DATABASE mypgdatabase TO mypguser; ``` ```bash # Example: Importing a MySQL database using mysqldump # mysqldump -u root -p mydatabase < backup.sql ``` ```bash # Example: Exporting a MySQL database using mysqldump # mysqldump -u root -p mydatabase > backup.sql ``` -------------------------------- ### Execute Hello World Plugin with Form Field and User Context using mgrctl Source: https://www.ispmanager.com/docs/developer-guide/handlers This example demonstrates how to use the `mgrctl` command to execute a 'Hello, World!' plugin. It shows how to specify the output format as 'devel' for debugging, pass a form field value ('name=John'), and execute the request on behalf of another user ('su=john'). This is useful for testing plugin interactions and user-specific behaviors. ```bash mgrctl -o devel helloworld name=John su=john ``` -------------------------------- ### Install Django with Python in ispmanager Source: https://www.ispmanager.com/docs/ispmanager/license-activation A step-by-step guide on how to install the Django framework for Python applications within the ispmanager environment. ```ispmanager configuration How to install Django ``` -------------------------------- ### Get WWW Domains (curl Example) Source: https://www.ispmanager.com/docs/coremanager/guide-to-ispsystem-software-api Example using curl to retrieve a list of WWW domains from ispmanager in XML format. ```APIDOC ## Get WWW Domains (curl Example) ### Description This example demonstrates how to retrieve a list of WWW domains using the `curl` utility. The output is requested in XML format. ### Method GET ### Endpoint `https://IP-address:1500/ispmgr` ### Query Parameters - **authinfo** (string) - Required - Authentication credentials in the format `login:password`. - **out** (string) - Required - Specifies the output format, `xml` in this case. - **func** (string) - Required - The function to call, `webdomain` for listing WWW domains. ### Request Example ```bash curl -k -s "https://IP-address:1500/ispmgr?authinfo=login:password&out=xml&func=webdomain" ``` ``` -------------------------------- ### Create a "Hello, World!" Plugin with Bash Handler Source: https://www.ispmanager.com/docs/developer-guide/hello-world-plugin This snippet demonstrates how to create a basic "Hello, World!" plugin in ispmanager using a bash script as the handler. It results in a new menu item that displays a "Hello, world!" page. Requires file editing and root privileges. ```bash # Example bash script for a "Hello, World!" plugin handler echo "Hello, world!" ```