### Start Apache Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Start the Apache web server. ```bash /etc/init.d/apache2 start ``` -------------------------------- ### POST sites_aps_install_package Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/sites_aps_install_package.html Starts the installation of a selected APS package in a given main domain web folder. ```APIDOC ## POST sites_aps_install_package ### Description Starts installation of the selected package in the given main_domain webfolder. ### Method POST ### Parameters #### Input Variables - **session_id** (string) - Required - The session ID for authentication. - **primary_id** (int) - Required - The ID of the package or site context. - **params** (array) - Required - An array containing installation parameters. #### Parameters (in $params) - **main_domain** (varchar(255)) - Required - The domain where the package should be installed. ### Response - **instance_id** (int/boolean) - Returns the new instance ID on success, or false on failure. ``` -------------------------------- ### Install Apache Dependencies Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Install essential dependencies required for Apache on the new server before proceeding with the migration or setup. ```bash apt-get install debootstrap libpcre3 libaprutil1 libxml2 mime-support ``` -------------------------------- ### Install Apache and PHP in chroot Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Install web server and PHP components, then stop Apache. ```bash apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libopenssl-ruby /etc/init.d/apache2 stop ``` -------------------------------- ### Install ISPConfig Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Download, extract, and run the ISPConfig installation script. ```bash cd /tmp wget https://www.ispconfig.org/downloads/ISPConfig-3.0.1.4-beta-2.tar.gz tar xvfz ISPConfig-3.0.1.4-beta-2.tar.gz cd ispconfig3_install/install/ php -q install.php cd /tmp/ rm -rf ispconfig3_install rm -f ISPConfig-3.0.1.4-beta-2.tar.gz ``` -------------------------------- ### Install required packages Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Install the necessary packages for chroot and Apache support. ```bash apt-get install debootstrap libapache2-mod-chroot ``` -------------------------------- ### Install Chroot Dependencies and Environment Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Commands to install required packages and bootstrap the Debian chroot environment. ```shell apt-get install debootstrap libpcre3 libaprutil1 libxml2 mime-support patch make gcc mysql-server subversion ssh openssh-server ntp ntpdate vim libdbd-mysql libdbi-perl dnsutils apt-get install postfix postfix-mysql postfix-doc mysql-client openssl getmail4 rkhunter amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl pure-ftpd-common pure-ftpd-mysql quota quotatool apt-get install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop apt-get install bind9 bind9utils time debootstrap --arch=amd64 lenny /var/www/html/ ftp://ftp.fr.debian.org/debian/ echo "/proc /var/www/html/proc proc defaults 0 0">>/etc/fstab echo "devpts /var/www/html/dev/pts devpts defaults 0 0">>/etc/fstab mount -a ``` -------------------------------- ### Install and Configure mini_sendmail Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Installs mini_sendmail, a lightweight sendmail replacement, and configures PHP to use it for sending emails. ```bash cd /tmp/ wget http://acme.com/software/mini_sendmail/mini_sendmail-1.3.6.tar.gz tar xzf mini_sendmail-1.3.6.tar.gz wget http://users1.leipzig.freifunk.net/~firmware-build/brcm_2_4_Broadcom_default/build/openwrt_packages/mail/mini_sendmail/patches/200-fullname.patch patch -p0 < 200-fullname.patch cd mini_sendmail-1.3.6 make mv /var/www/html/usr/lib/sendmail /var/www/html/usr/lib/sendmail_old mv /var/www/html/usr/sbin/sendmail /var/www/html/usr/sbin/sendmail_old cp mini_sendmail /var/www/html/usr/sbin/mini_sendmail cd /var/www/html/usr/lib/ && ln -s ../sbin/mini_sendmail sendmail cd /var/www/html/usr/sbin && ln -s mini_sendmail sendmail ``` ```bash sed -i -e 's#^;sendmail_path =$#sendmail_path = /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1#' /var/www/html/etc/php5/apache2/php.ini /var/www/html/etc/php5/cli/php.ini /var/www/html/etc/php5/cgi/php.ini ``` -------------------------------- ### Cron Schedule Examples Source: https://github.com/ispconfig/ispconfig3/blob/develop/interface/web/sites/templates/cron_edit.htm Examples for setting cron job schedules. Use '*' for all values, '*/n' for every n units, or a range 'n-m'. ```text e.g. *, */3, 10-20 ``` ```text e.g. *, */2, 0, 10-12 ``` ```text e.g. *, */4, 1-5 ``` ```text e.g. *, 1-6 ``` ```text e.g. *, 0, 1-5 ``` -------------------------------- ### PHP Autoinstall Configuration Example Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/AUTOUPDATE.md A template for the PHP-based autoinstall configuration file, including database and service settings. ```php ``` -------------------------------- ### Check for Apache or PHP Installations Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Command to list installed packages and search for Apache or PHP related entries. ```shell dpkg -l|egrep --color -i 'apache|php' ``` -------------------------------- ### Update and install packages in chroot Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Update package lists and install required software inside the chroot. ```bash apt-get update apt-get install fakeroot --force-yes -y apt-get install locales ``` -------------------------------- ### Install ISPConfig 3 Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Follow these commands to download and set up ISPConfig 3 from SVN. Ensure you have the necessary permissions and directory structures. ```bash cd /tmp/ svn co svn://svn.ispconfig.org/ispconfig3 svn.ispconfig.org ``` ```bash mv /usr/local/ispconfig /var/www/html/usr/local/ ln -s /var/www/html/usr/local/ispconfig /usr/local/ispconfig ``` ```bash mv /var/www/apps /var/www/html/var/www/ mv /var/www/php-fcgi-scripts /var/www/html/var/www/ mv /var/www/ispconfig /var/www/html/var/www/ ln -s /var/www/html//var/www/ispconfig /var/www/ispconfig ln -s /var/www/html/var/www/php-fcgi-scripts /var/www/php-fcgi-scripts ln -s /var/www/html/var/www/apps /var/www/apps ``` ```bash cp -r /etc/{passwd,group,apt} /var/www/html/etc/ ``` ```bash apache2ctl stop apache2ctl start ``` -------------------------------- ### Mount and Directory Setup for Chroot Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Commands to mount partitions and create necessary directory structures for the chroot environment. ```shell mount /dev/lvm_foobar1/chroot_lv /var/www/ mkdir -p /var/www/html/var/log/apache2 /var/www/html/var/www/html mount /dev/lvm_foobar2/apachelogs_lv /var/www/html/var/log/apache2 mount /dev/lvm_foobar3/hosting_lv /var/www/html/var/www/html ``` -------------------------------- ### GET openvz_vm_get_by_client Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/openvz_vm_get_by_client.html Retrieves a list of all virtual machines belonging to a specific client. ```APIDOC ## GET openvz_vm_get_by_client ### Description Shows all of a client's virtual machines. ### Method GET ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID for authentication. - **client_id** (int) - Required - The ID of the client whose VMs are to be retrieved. ### Response #### Success Response (200) - **result** (array) - Returns an array of parameters for the target client's virtual machines. ``` -------------------------------- ### Correct PHP Coding Style Source: https://github.com/ispconfig/ispconfig3/blob/develop/CONTRIBUTING.md Example of proper class structure using camel-case for methods and lowercase for properties. ```php class MyClass { private $issue_list = []; private function getMyValue() { } } ``` -------------------------------- ### PHP: Incorrect Array Formatting Examples Source: https://github.com/ispconfig/ispconfig3/blob/develop/CONTRIBUTING.md Shows incorrect array formatting, including empty arrays with braces on separate lines and improperly formatted nested arrays. ```php $array=[ ]; $array = [ 1, 4, 35, 23, 345, 11, 221, 'further', '...' ]; $array=['conf'=>['settings'=>['window' => 'open', 'door' => 'closed]]]; ``` -------------------------------- ### Configure SSH Users and Apache Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Sets up the sshusers group, installs necessary packages within a chroot environment, and configures Apache for chroot and suexec. ```bash echo "@sshusers - chroot /var/www/html/">>/etc/security/limits.conf chroot /var/www/html apt-get update chroot /var/www/html apt-get install fakeroot --force-yes -y chroot /var/www/html apt-get install locales chroot /var/www/html dpkg-reconfigure locales mv /usr/lib/apache2 /usr/lib/apache2_old mv /var/log/apache2 /var/log/apache2_old mv /var/lock/apache2 /var/lock/apache2_old mv /var/lib/apache2 /var/lib/apache2_old mv /usr/lib/php5 /usr/lib/php5_old mv /etc/apache2 /etc/apache2_old mv /etc/suphp /etc/suphp_old chroot /var/www/html apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libopenssl-ruby libapache2-mod-chroot php-apc libtimedate-perl chroot /var/www/html /etc/init.d/apache2 stop chroot /var/www/html a2enmod mod_chroot chroot /var/www/html a2enmod suexec echo "ChrootDir /var/www/html" > /var/www/html/etc/apache2/conf.d/mod_chroot.conf sed -i -e 's#DocumentRoot /var/www/#DocumentRoot /var/www/html/#' /var/www/html/etc/apache2/sites-enabled/000-default sed -i -e 's#x-httpd-php=php:/usr/bin/php-cgi#x-httpd-php=php:/usr/bin/php-cgi\nx-httpd-suphp=php:/usr/bin/php-cgi\nx-httpd-php=php:/usr/bin/php-cgi#' /var/www/html/etc/suphp/suphp.conf sed -i -e 's#/var/run/apache2.pid#/var/run/apache2/apache2.pid#' /var/www/html/etc/apache2/envvars sed -i -e 's/^"syntax on/syntax on/' /etc/vim/vimrc sed -i -e 's/^"syntax on/syntax on/' /var/www/html/etc/vim/vimrc chown root:root /var/www/html/etc/apache2/ && chmod 700 /var/www/html/etc/apache2/ chmod 711 /var/www/html/etc/php5/ ``` -------------------------------- ### Initialize Autoinstall Configuration Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/AUTOUPDATE.md Copy the sample configuration file to the server's library directory to begin customization. ```bash cp /usr/local/ispconfig/docs/autoinstall_samples/autoinstall.conf_sample.php /usr/local/ispconfig/server/lib/autoinstall.conf.php ``` -------------------------------- ### Enter chroot environment Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Switch to the chroot environment. ```bash chroot /var/www ``` -------------------------------- ### Add OpenVZ VM from Template Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/openvz_vm_add_from_template.html Use this function to set up a virtual machine on the first available IP address using templates. It requires a session ID, client ID, ostemplate ID, and template ID. An optional array of override parameters can be provided. ```php openvz_vm_add_from_template($session_id, $client_id, $ostemplate_id, $template_id, $override_params = array()); ``` -------------------------------- ### Create chroot environment Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Initialize the chroot environment using debootstrap. ```bash debootstrap lenny /var/www/ ftp://ftp.fr.debian.org/debian/ ``` -------------------------------- ### GET sites_web_subdomain_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/sites_web_subdomain_get.html Retrieves information about a specific web subdomain from the ISPConfig system. ```APIDOC ## GET sites_web_subdomain_get ### Description Retrieves information about a web subdomain. ### Method GET ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **primary_id** (int) - Required - The ID of the web subdomain to retrieve. ### Response #### Success Response (200) - **data** (array) - Returns all fields and values of the chosen web subdomain. ``` -------------------------------- ### GET dns_srv_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_srv_get.html Retrieves information about a specific DNS SRV resource record. ```APIDOC ## GET dns_srv_get ### Description Retrieves information about a target DNS SRV resource record. ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **primary_id** (int) - Required - The ID of the DNS SRV record to retrieve. ### Response #### Success Response (200) - **record** (array) - Returns all fields and values of the chosen DNS SRV resource record. ``` -------------------------------- ### Initialize and Configure System Charts Source: https://github.com/ispconfig/ispconfig3/blob/develop/interface/web/dashboard/dashlets/templates/metrics.htm Initializes multiple line charts for system metrics and defines the createChart function using the Chart.js library. ```javascript createChart('loadchart', '{tmpl_var name="loadchart_label"}', [{tmpl_var name='label'}], [{tmpl_var name='loadchart_data'}]); createChart('memchart', '{tmpl_var name="memchart_label"}', [{tmpl_var name='label'}], [{tmpl_var name='memchart_data'}]); createChart('rxchart', '{tmpl_var name="rxchart_label"}', [{tmpl_var name='label'}], [{tmpl_var name='rxchart_data'}]); createChart('txchart', '{tmpl_var name="txchart_label"}', [{tmpl_var name='label'}], [{tmpl_var name='txchart_data'}]); function createChart(chartname, label, labels, data) { var ctx = document.getElementById(chartname).getContext('2d'); var chart = new Chart(ctx, { type: 'line', // Type of chart data: { labels: labels, // Empty array to remove labels datasets: [{ label: label, // Name of the dataset data: data, // Data points borderWidth: 1, tension: 0.4, // Tension for cubic interpolation cubicInterpolationMode: 'default', // Can be 'default' or 'monotone' borderColor: 'rgb(75, 192, 192)', // Color of the line backgroundColor: 'rgba(75, 192, 192, 0.2)', // Color for filling the area below the line fill: true // Enable fill below the line }] }, options: { scales: { x: { display: false, // Hide the x-axis }, y: { beginAtZero: true // Start y-axis at zero } }, plugins: { legend: { labels: { generateLabels: function(chart) { const data = chart.data; return data.datasets.map(function(dataset, i) { return { text: dataset.label, fillStyle: 'white', // Set to empty string to hide the colored box hidden: !chart.isDatasetVisible(i), lineCap: dataset.borderCapStyle, lineDash: dataset.borderDash, lineDashOffset: dataset.borderDashOffset, lineJoin: dataset.borderJoinStyle, lineWidth: dataset.borderWidth, strokeStyle: 'white', pointStyle: 'white', // Set to empty string to hide the point style datasetIndex: i }; }); } } } } } }); } ``` -------------------------------- ### GET /dns_rr_get_all_by_zone Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_rr_get_all_by_zone.html Retrieves all resource records for a specified DNS zone ID. ```APIDOC ## GET dns_rr_get_all_by_zone ### Description Shows information about a zone's resource records. ### Method GET ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **zone_id** (int) - Required - The ID of the DNS zone to retrieve records for. ### Response #### Success Response (200) - **record** (array) - Returns a record of the zone's parameter values. ``` -------------------------------- ### Configure PHP and Apache paths Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Move configuration files and create symlinks for PHP and Apache. ```bash rm -rf /var/www/etc/php5/cgi/ mv -f /etc/php5/cgi/ /var/www/etc/php5/ ln -s /var/www/etc/php5/cgi /etc/php5/ rm -rf /var/www/etc/php5/apache2/ mv -f /etc/php5/apache2/ /var/www/etc/php5/ ln -s /var/www/etc/php5/apache2 /etc/php5/ ln -s /var/www/var/run/apache2.pid /var/run/apache2.pid ``` -------------------------------- ### Generate Autoinstall Configuration Script Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/AUTOUPDATE.md Execute the helper script to automatically generate an autoinstall configuration file based on current system settings. ```bash /usr/local/ispconfig/server/scripts/generate_autoinstall_conf.sh ``` -------------------------------- ### GET dns_ptr_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_ptr_get.html Retrieves information about a specific DNS PTR resource record. ```APIDOC ## GET dns_ptr_get ### Description Retrieves information about target dns ptr resource record. ### Method GET ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **primary_id** (int) - Required - The ID of the DNS PTR record to retrieve. ### Response #### Success Response (200) - **result** (array) - Returns all fields and values of the chosen dns ptr resource record. ``` -------------------------------- ### DNS CNAME Get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_cname_get.html Retrieves information about a specific DNS CNAME record. ```APIDOC ## dns_cname_get ### Description Retrieves information about target dns cname resource record. ### Method POST (Assumed, as it's a function call) ### Endpoint /remote/ (Assumed, typical for remote APIs) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **session_id** (string) - Required - The session ID for authentication. - **primary_id** (integer) - Required - The ID of the DNS CNAME record to retrieve. ### Request Example ```json { "session_id": "your_session_id", "primary_id": 123 } ``` ### Response #### Success Response (200) - **all fields and values** (object) - All fields and values of the chosen dns cname resource record. #### Response Example ```json { "return": { "id": "123", "name": "www.example.com.", "type": "CNAME", "data": "example.com.", "ttl": "86400" } } ``` ``` -------------------------------- ### POST openvz_vm_add_from_template Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/openvz_vm_add_from_template.html Creates a new OpenVZ virtual machine based on specified OS and hardware templates. ```APIDOC ## POST openvz_vm_add_from_template ### Description Sets up a virtual machine on the first available IP by using templates. ### Method POST ### Parameters #### Input Variables - **session_id** (string) - Required - The session ID for authentication. - **client_id** (int) - Required - The ID of the client owning the VM. - **ostemplate_id** (int) - Required - The ID of the OS template to use. - **template_id** (int) - Required - The ID of the hardware template to use. - **override_params** (array) - Optional - Additional parameters to override template defaults. ### Response - **vm_id** (int) - Returns the ID of the newly created virtual machine. ``` -------------------------------- ### GET dns_aaaa_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_aaaa_get.html Retrieves information about a specific IPv6 DNS resource record. ```APIDOC ## GET dns_aaaa_get ### Description Retrieves information about target dns IPv6 resource record. ### Method GET ### Endpoint dns_aaaa_get ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **primary_id** (int) - Required - The ID of the DNS AAAA record to retrieve. ### Response #### Success Response (200) - **record** (array) - Returns all fields and values of the chosen dns IPv6 resource record. ``` -------------------------------- ### GET dns_a_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_a_get.html Retrieves information about a target DNS IPv4 resource record. ```APIDOC ## GET dns_a_get ### Description Retrieves information about target dns IPv4 resource record. ### Method GET ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **primary_id** (int) - Required - The ID of the DNS A record to retrieve. ### Response #### Success Response (200) - **record** (array) - Returns all fields and values of the chosen dns IPv4 resource record. ``` -------------------------------- ### GET dns_zone_get_by_user Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_zone_get_by_user.html Retrieves a record of DNS zones for a specific client on a specific server. ```APIDOC ## POST dns_zone_get_by_user ### Description Shows information about a client's DNS zones. ### Method POST ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **client_id** (int) - Required - The ID of the client. - **server_id** (int) - Required - The ID of the server. ### Response #### Success Response (200) - **record** (array) - Returns a record of parameters of the client's zones, including id and origin. ``` -------------------------------- ### DNS Alias Get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_alias_get.html Retrieves information about a DNS server-side alias resource record. ```APIDOC ## GET /dns_alias_get ### Description Retrieves information about a DNS server-side alias resource record. ### Method GET ### Endpoint /dns_alias_get ### Parameters #### Query Parameters - **session_id** (string) - Required - The session ID for authentication. - **primary_id** (integer) - Required - The ID of the DNS alias record. ### Response #### Success Response (200) - **alias_record** (object) - Contains all fields and values of the chosen DNS alias resource record. ``` -------------------------------- ### Create symlinks for chroot Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Set up necessary symlinks within the chroot directory structure. ```bash cd /var/www/var/ rm -rf /var/www/var/www ln -s / www ``` -------------------------------- ### Client Get API Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/client_get.html Retrieves detailed information about a specific client using their ID. ```APIDOC ## client_get($session_id, $client_id) ### Description Retrieves information about a client. ### Method POST ### Endpoint /api/client/get ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **session_id** (string) - Required - The session ID for authentication. - **client_id** (integer) - Required - The ID of the client to retrieve. ### Request Example ```json { "session_id": "your_session_id", "client_id": 123 } ``` ### Response #### Success Response (200) - **client_data** (object) - Contains all fields and values of the chosen client. #### Response Example ```json { "success": true, "message": "Client data retrieved successfully.", "data": { "client_id": 123, "customer_no": "C1001", "company_name": "Example Corp", "contact_name": "John Doe", "email": "john.doe@example.com" // ... other client fields } } ``` ``` -------------------------------- ### Run dist-upgrade Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Perform a distribution upgrade inside the chroot. ```bash fakeroot apt-get dist-upgrade ``` -------------------------------- ### GET /sites_aps_instance_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/sites_aps_instance_get.html Retrieves the record of a specific APS instance based on the provided primary ID. ```APIDOC ## GET sites_aps_instance_get ### Description Gets the record of a given APS instance ID. ### Method POST (Remote API call) ### Endpoint sites_aps_instance_get ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **primary_id** (integer) - Required - The ID of the APS instance to retrieve. ### Response #### Success Response (200) - **record** (array) - Returns the record of the APS instance. ``` -------------------------------- ### GET openvz_get_free_ip Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/openvz_get_free_ip.html Retrieves a list of unreserved IP addresses available for OpenVZ virtual machines. ```APIDOC ## GET openvz_get_free_ip ### Description Shows the unreserved IPs for openvz virtual machines. ### Method GET ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **server_id** (integer) - Optional - The ID of the server to check. Defaults to 0. ### Response #### Success Response (200) - **IPs** (array) - Returns the IPs available for an openvz virtual machine. ``` -------------------------------- ### Initialize ISPConfig Charts Source: https://github.com/ispconfig/ispconfig3/blob/develop/interface/web/monitor/templates/show_sys_state.htm These lines of code demonstrate how to call the `createChart` function to initialize different charts for load, memory, received data, and transmitted data. Each call specifies a unique chart ID, a label, and the data arrays. ```javascript createChart('loadchart', '{tmpl_var name="loadchart_label"}', [{tmpl_var name='label'}], [{tmpl_var name='loadchart_data'}]); createChart('memchart', '{tmpl_var name="memchart_label"}', [{tmpl_var name='label'}], [{tmpl_var name='memchart_data'}]); createChart('rxchart', '{tmpl_var name="rxchart_label"}', [{tmpl_var name='label'}], [{tmpl_var name='rxchart_data'}]); createChart('txchart', '{tmpl_var name="txchart_label"}', [{tmpl_var name='label'}], [{tmpl_var name='txchart_data'}]); ``` -------------------------------- ### GET get_function_list Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/get_function_list.html Retrieves a list of all available remote API functions for the ISPConfig 3 system. ```APIDOC ## GET get_function_list ### Description Shows all available remote API functions. ### Method GET ### Endpoint get_function_list($session_id) ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from the login process. ### Response #### Success Response (200) - **functions** (array) - A record of all available remote API functions. ``` -------------------------------- ### Enable mod_chroot Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Enable the Apache chroot module and configure the root directory. ```bash a2enmod mod_chroot echo "ChrootDir /var/www" > /etc/apache2/conf.d/mod_chroot.conf ``` -------------------------------- ### DNS Zone Get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_zone_get.html Retrieves information about a specific DNS zone using its primary ID. ```APIDOC ## DNS Zone Get ### Description Retrieves information about a dns zone. ### Method POST ### Endpoint /remote/index.php ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **session_id** (string) - Required - The session ID for authentication. - **primary_id** (integer) - Required - The primary ID of the DNS zone to retrieve. ### Request Example ```json { "session_id": "your_session_id", "primary_id": 123 } ``` ### Response #### Success Response (200) - **zone_data** (object) - Contains all fields and values of the chosen DNS zone. #### Response Example ```json { "zone_data": { "id": "123", "server_id": "1", "zone": "example.com", "created_at": "2023-01-01 10:00:00", "updated_at": "2023-01-01 10:00:00" } } ``` ``` -------------------------------- ### Migrate Web Directories with rsync Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Use rsync within a screen session for efficient and robust migration of web directories to a new server. This command preserves file attributes and permissions. ```bash screen time rsync -a --progress root@host1:/var/www/ /var/www/ ``` -------------------------------- ### PHP: Incorrect Old Array Syntax Source: https://github.com/ispconfig/ispconfig3/blob/develop/CONTRIBUTING.md Examples of the deprecated old array syntax (`array()`) which should not be used. ```php $var = array(); $var2 = array( 'conf' => array( 'setting1' => 'value1' ) ); ``` -------------------------------- ### Configure fstab mountpoints Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Add proc and devpts mountpoints to the fstab file. ```bash echo "/proc /var/www/proc proc defaults 0 0">>/etc/fstab echo "devpts /var/www/dev/pts devpts defaults 0 0">>/etc/fstab ``` -------------------------------- ### Create Symbolic Links for Apache and PHP Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/CHROOTED_DEBIAN_5.0.txt Establishes necessary symbolic links to ensure proper functioning of Apache, PHP, and related modules within the chroot environment. ```bash ln -s /var/www/html/etc/apache2 /etc/apache2 ln -s /var/www/html/etc/suphp /etc/suphp ln -s /var/www/html/var/run/apache2 /var/run/apache2 ln -s /var/www/html/var/run/apache2.pid /var/run/apache2.pid ln -s /var/www/html/usr/sbin/apache2ctl /usr/sbin/apache2ctl ln -s /var/www/html/usr/sbin/apache2 /usr/sbin/apache2 ln -s /var/www/html/usr/lib/apache2 /usr/lib/apache2 ln -s /var/www/html/usr/sbin/a2enmod /usr/sbin/a2enmod ln -s /var/www/html/usr/sbin/a2dismod /usr/sbin/a2dismod ln -s /var/www/html/usr/sbin/a2ensite /usr/sbin/a2ensite ln -s /var/www/html/usr/sbin/a2dissite /usr/sbin/a2dissite ln -s /var/www/html/var/log/apache2 /var/log/apache2 ln -s /var/www/html/var/lock/apache2 /var/lock/apache2 ln -s /var/www/html/var/lib/apache2 /var/lib/apache2 ln -s /var/www/html/usr/lib/php5 /usr/lib/php5 ln -s /var/www/html/etc/init.d/apache2 /etc/init.d/apache2 ln -s /var/www/html/usr/bin/php5 /usr/bin/php5 ln -s /var/www/html/etc/alternatives/php /etc/alternatives/php ln -s /var/www/html/usr/bin/php /usr/bin/php ln -s /var/www/html/etc/php5 /etc/php5 ``` -------------------------------- ### GET /openvz_template_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/openvz_template_get.html Retrieves information about an OpenVZ template using the provided session ID and template ID. ```APIDOC ## POST openvz_template_get ### Description Retrieves information about an openvz template. ### Method POST ### Endpoint openvz_template_get ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **template_id** (int) - Required - The ID of the OpenVZ template to retrieve. ### Response #### Success Response (200) - **template_data** (array) - Returns all fields and values of the chosen template. ``` -------------------------------- ### GET openvz_ip_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/openvz_ip_get.html Retrieves information about an OpenVZ IP address using the session ID and IP ID. ```APIDOC ## GET openvz_ip_get ### Description Retrieves information about an openvz ip. ### Method GET ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **ip_id** (int) - Required - The ID of the OpenVZ IP to retrieve. ### Response #### Success Response (200) - **result** (array) - Returns all fields and values of the chosen ip. ``` -------------------------------- ### GET mail_spamfilter_whitelist_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/mail_spamfilter_whitelist_get.html Retrieves information about a specific mailing spamfilter whitelist entry using its primary ID. ```APIDOC ## POST mail_spamfilter_whitelist_get ### Description Retrieves information about a mailing spamfilter whitelist entry. ### Method POST ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **primary_id** (int) - Required - The ID of the spamfilter whitelist entry. ### Response #### Success Response (200) - **Returns** (array) - Returns all fields and values of the chosen spamfilter whitelist entry. ``` -------------------------------- ### POST client_templates_get_all Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/client_templates_get_all.html Retrieves a list of all client templates defined in the ISPConfig system. ```APIDOC ## POST client_templates_get_all ### Description Returns all client templates available in the system. ### Method POST ### Parameters #### Request Body - **session_id** (string) - Required - The session ID obtained from the login function. ### Response #### Success Response (200) - **result** (array) - An array containing the parameter values of all client templates. ``` -------------------------------- ### sites_aps_instance_delete Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/sites_aps_instance_delete.html Starts the deletion of a selected APS instance. The associated database will not be deleted if the 'keep_database' parameter is set to true. ```APIDOC ## sites_aps_instance_delete ### Description Starts deletion of the selected APS instance. If param keep_database is set true, database will not be deleted. ### Method POST (Assumed, as it modifies data) ### Endpoint /api/v1/sites/aps_instance/delete ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **session_id** (string) - Required - The session ID for authentication. - **primary_id** (string) - Required - The ID of the APS instance to delete. - **params** (object) - Optional - Additional parameters for deletion. - **keep_database** (boolean) - Optional - If true, the database will not be deleted. ``` -------------------------------- ### Initialize ispconfigSearch jQuery Plugin Source: https://github.com/ispconfig/ispconfig3/blob/develop/interface/web/dns/templates/dns_slave_edit.htm Configures search functionality for DNS input fields using the ispconfigSearch plugin. ```javascript jQuery('#ns').ispconfigSearch({ dataSrc: '/dns/ajax_get_json.php?type=get_ipv4', resultsLimit: '$ % ', ResultsTextPrefix: '', noResultsText: '', noResultsLimit: '', minChars: 0, cssPrefix: 'df-', fillSearchField: true, fillSearchFieldWith: 'fill_text', searchFieldWatermark: '', resultBoxPosition: '' }); ``` ```javascript jQuery('#xfer').ispconfigSearch({ dataSrc: '/dns/ajax_get_json.php?type=get_ipv4', resultsLimit: '$ % ', ResultsTextPrefix: '', noResultsText: '', noResultsLimit: '', minChars: 0, cssPrefix: 'df-', fillSearchField: true, fillSearchFieldWith: 'fill_text', searchFieldWatermark: '', resultBoxPosition: '' }); ``` -------------------------------- ### Incorrect PHP Coding Style Source: https://github.com/ispconfig/ispconfig3/blob/develop/CONTRIBUTING.md Example of discouraged class structure using snake-case for methods and PascalCase for properties. ```php class my_class { private $IssueList = []; private function get_my_value() { } } ``` -------------------------------- ### Initialize ISPConfig Global JavaScript Settings Source: https://github.com/ispconfig/ispconfig3/blob/develop/interface/web/themes/default/templates/main.tpl.htm Configures global UI behaviors such as tab change warnings and search functionality upon document readiness. ```javascript //$('.ttip').tipsy({live: true, gravity: 'ne', html: true}); ISPConfig.tabChangeDiscard = ''; ISPConfig.tabChangeWarning = ''; ISPConfig.tabChangeWarningTxt = ''; ISPConfig.tabChangeDiscardTxt = ''; ISPConfig.setOption('useLoadIndicator', true); ISPConfig.setOption('useComboBox', true); $(document).ready(function() { $('#globalsearch').ispconfigSearch({ dataSrc: '/dashboard/ajax_get_json.php?type=globalsearch', resultsLimit: '$ % ', noResultsText: '', noResultsLimit: '', searchFieldWatermark: '', resultBoxPosition: '' }); ISPConfig.loadInitContent(); }); //--> ``` -------------------------------- ### Access Server Web Configuration Source: https://github.com/ispconfig/ispconfig3/blob/develop/CONTRIBUTING.md Retrieve server-specific web configuration settings. Requires the server ID and the 'web' module name. Ensure 'ini_parser' and 'getconf' plugins are loaded. ```php $app->uses('ini_parser,getconf'); $web_config = $app->getconf->get_server_config($server_id,'web'); ``` -------------------------------- ### Mount filesystems Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Mount all filesystems defined in fstab. ```bash mount -a ``` -------------------------------- ### PHP: Incorrect Spacing and Parentheses Usage Source: https://github.com/ispconfig/ispconfig3/blob/develop/CONTRIBUTING.md Examples of incorrect spacing and parentheses usage, violating the established coding standards. ```php if ($variable===$condition) { } while(($condition!==false||$condition2===true))&&$n<=15){ } ``` -------------------------------- ### Update ISPConfig 3.3.1p1 via CLI Source: https://github.com/ispconfig/ispconfig3/blob/develop/RELEASE.md Execute these commands as the root user to download and run the update script. ```bash cd /tmp wget https://www.ispconfig.org/downloads/ISPConfig-3.3.1p1.tar.gz tar xvfz ISPConfig-3.3.1p1.tar.gz cd ispconfig3_install/install php -q update.php ``` -------------------------------- ### Execute Unattended Update Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/AUTOUPDATE.md Run the update process using the specified autoinstall configuration file via script or CLI. ```bash ispconfig_update.sh --autoinstall=/usr/local/ispconfig/server/lib/autoinstall.conf.php ``` ```bash ispc update --autoinstall=/usr/local/ispconfig/server/lib/autoinstall.conf.php ``` -------------------------------- ### GET dns_rp_get Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_rp_get.html Retrieves information about a specific DNS RP resource record using the session ID and primary ID. ```APIDOC ## POST dns_rp_get ### Description Retrieves information about target dns rp resource record. ### Method POST ### Endpoint dns_rp_get ### Parameters #### Path Parameters - **session_id** (string) - Required - The session ID obtained from login. - **primary_id** (int) - Required - The ID of the DNS RP resource record. ### Response #### Success Response (200) - **Returns** (array) - Returns all fields and values of the chosen dns rp resource record. ``` -------------------------------- ### DNS DS Get Record Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/dns_ds_get.html Retrieves information about a specific DNS DS resource record using its primary ID. ```APIDOC ## DNS DS Get Record ### Description Retrieves information about target dns ds resource record. ### Method POST ### Endpoint /api/dns/dns_ds_get ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **session_id** (string) - Required - The session ID for authentication. - **primary_id** (integer) - Required - The primary ID of the DNS DS record to retrieve. ### Request Example ```json { "session_id": "your_session_id", "primary_id": 123 } ``` ### Response #### Success Response (200) - **dns_ds_record** (object) - Contains all fields and values of the chosen dns ds resource record. #### Response Example ```json { "dns_ds_record": { "id": "123", "server_id": "1", "rid": "12345", "key_tag": "123", "algorithm": "13", "digest_type": "2", "digest": "abcdef1234567890..." } } ``` ``` -------------------------------- ### system_config_get API Source: https://github.com/ispconfig/ispconfig3/blob/develop/remoting_client/API-docs/system_config_get.html Retrieves system configuration settings. You can fetch an entire section or a specific key within a section. ```APIDOC ## system_config_get ### Description Returns system config by section and optional key. ### Method POST ### Endpoint /api/v1/system_config_get ### Parameters #### Path Parameters None. #### Query Parameters None. #### Request Body - **session_id** (string) - Required - The session ID obtained after successful authentication. - **section** (string) - Required - The configuration section to retrieve (e.g., 'server', 'mail'). - **key** (string) - Optional - The specific configuration key within the section to retrieve. If omitted, the entire section is returned. ### Request Example ```json { "session_id": "your_session_id", "section": "server", "key": "webserver_type" } ``` ### Response #### Success Response (200) - **data** (array|string) - Returns an array with the system config's section values, or a string with the value if a specific config key was requested. #### Response Example ```json { "status": "success", "data": "nginx" } ``` #### Error Response (400/500) - **status** (string) - "error" - **message** (string) - Error description. ``` -------------------------------- ### Reconfigure locales Source: https://github.com/ispconfig/ispconfig3/blob/develop/docs/under_development/DEV_CHROOTED_DEBIAN_5.0.txt Run the locale reconfiguration tool. ```bash dpkg-reconfigure locales ```