# aps: Application Catalog

The `aps` utility is used for downloading applications from application catalogs and installing them on websites.

## Usage

    aps <command> [options]

## Example

To install the WordPress application with package ID 13 at http://example.com/blog:

    >aps --install "\tmp\apps\WordPress.xml" -package-id 13 -domain example.com -ssl false -url-prefix blog -db-name WordPress -db-user BlogAdmin -passwd P4$$w0rd

`WordPress.xml` here is the WordPress application metadata file. Get more information on application metadata files from the Application Packaging Standard ( APS ) specification.

According to the APS, the metadata file must be in the root directory of the application ZIP archive. It is recommended to use the metadata file from the very package you are going to install.

## Commands

Command | Parameter | Description | Example
--- | --- | --- | ---
`--import-package` or `-ip` | `<file name>` | Imports an uploaded application package from the specified file and adds it to the Application Catalog in Plesk. | To import the uploaded SugarCRM-5.0.0-16.app.zip package to Plesk:
    plesk bin aps --import-package /home/root/SugarCRM-5.0.0-16.app.zip"
`--download` or `-d` | `-package-name <package name>` | Downloads an application package from the Application Catalog to the server and extracts it to the internal application cache to speed up future installations. | To download a package with WordPress application of the latest version and release from Application Catalog at http://apscatalog.com:
    plesk bin aps -d -package-name WordPress -catalog-url http://apscatalog.com
`--get-download-status` or `-g` | `<task id>` | Shows information about package download progress. | To view the status of a download task with ID 1:
    plesk bin aps -g 1
`--import-config` or `-ic` | `<path to file>` | Imports the configuration file where you define the URL of a custom Application Catalog. The configuration file catalogs.ini should be placed in any of the following directories: The Plesk’s temporary directory: /opt/psa/tmp on Debian, and /usr/local/psa/tmp on other LinuxUnix systems. The operating system’s temporary directory /tmp. The details on the configuration file format are provided below, at the end of this section. | To import the Application Catalog configuration from the file /tmp/catalogs.ini:
    plesk bin aps -ic /tmp/catalogs.ini
`--get-package-list` or `-gp` |  | Lists the packages currently available from the Application Vault. | To view the packages available from the Application Vault:
    plesk bin aps -gp
`--install` or `-i` | `<filename>|-` | Installs an application on a website. Requires an XML-formatted description of application installation settings, which can be read from a file or stdin. | The following command installs application from package with ID 13 on website example.com; the application will be accessible by URL example.com/blog, its settings are defined in the file WordPress.xml, and upon its installation database WordPress will be created:
    plesk bin aps -i /home/apps/WordPress.xml -package-id 13 -domain example.com -ssl
    false -url-prefix blog -db-name WordPress -db-user BlogAdmin -passwd
    P4$$w0rd
`--update-package` or `-up` | `<Package ID>` | Changes settings for an APS package in the Application Vault. | To make the application with the ID 1 unavailable to customers:
    plesk bin aps -up 1 -visible false
`--get-install-settings-template` or `-it` | `<filename|->` | Creates a settings template for installing applications with the “–install” command. | To create a file `/tmp/template.xml` containing a settings template for the application with the ID 1:
    plesk bin aps -it /tmp/template.xml -package-id 1 -domain example.com -ssl false -url-prefix blog -db-name WordPress -db-user BlogAdmin -passwd P4$$w0rd
–clear-cache or -c |  | Deletes all temporary files that were created during download of application packages and installation of applications. | To delete temporary files:
    ./aps -c
`--help` or `-h` |  | Displays help on the utility usage. | To view the help reference for the utility:
    plesk bin aps -h

## Options

Option | Parameter | Description | Example
--- | --- | --- | ---
`-catalog-url` | `<URL>` | Specifies URL of the Application Catalog. This option can be used only with the `-download` option. | To download a package with WordPress application of the latest version and release from Application Catalog at http://apscatalog.com:
    plesk bin aps -d -package-name WordPress -catalog-url http://apscatalog.com
`-package-name` | `<name>` | Specifies package name. |
`-package-version` | `<version>` | Specifies package version. | To download a package version 1.10 with ID 3, developed by John Smith, and packaged by John Doe:
    plesk bin aps -d -package-id 3 -package-version 1 -package-release 10 -package-vendor "John Smith" -package-packager "John Doe"
`-package-release` | `<release>` | Specifies package release. |
`-package-vendor` | `<vendor>` | Specifies package vendor. |
`-package-packager` | `<packager>` | Specifies application packager. |
`-package-id` | `<ID>` | Specifies package ID. |
`-domain` | `<domain name>` | Specifies the domain name where you want to install an application. | The following command installs application from package with ID 13 on website example.com and turns on automatic updates for it; the application will be accessible by URL example.com/blog, its settings are defined in the file WordPress.xml, and upon its installation the database WordPress will be created on the server with IP address 10.52.52.67:
    plesk bin aps -i /home/apps/WordPress.xml -package-id 13 -domain example.com -ssl false -url-prefix blog -db-server 10.52.52.67:3306 -db-name WordPress -prefix myblog_ -db-user BlogAdmin -passwd P4$$w0rd -aps-force-updates true
`-subdomain` | `<subdomain name>` | Specifies the subdomain name where you want to install an application. |
`-ssl` | `true|false` | Specifies whether the application will be accessible via HTTPS protocol or not. |
`-url-prefix` | `<prefix>` | Specifies the URL relative to the domain/subdomain, by which the installed application will be accessible on the Web. For example, if you install a blog-engine application and specify the URL prefix “blog”, the application will be available at http://domain-name/blog. |
`-db-server` | `<host:port>|<IP address>` | Specifies the database server that will be used by the application. |
`-db-name` | `<name>` | Specifies name of the database that will be created for the application during its installation. |
`-db-user` | `<login` `name>` | Specifies the name of database user that will be created for the application during its installation. |
`-passwd` | `<password>` | Specifies password of database user that will be created for the application during its installation. |
`-prefix` | `<prefix>` | The prefix for the names of the tables in the database used by the application. For example, if you specify the prefix `myblog_`, the tables used by the app will be named as follows: `myblog_<tablename>`. |
`-visible` | `true|false` | Specifies whether an APS package must be available to customers. |
`-aps-force-updates` | `true|false` | Turns on/off automatic updates for the app. |

## About the Application Catalog Configuration File

The Application Catalog configuration file is a text document including the following lines:

    [apscatalog]
    type = apscatalog
    url = http://apscatalog.com

http://apscatalog.com is the official address of the Application Catalog maintained by Plesk. If you want Plesk to use an Application Catalog at another location, in the `[apscatalog]` section of the file, change the `url` field value to point to another address. After that, import the file to Plesk by using the `aps -ic` command.

For the customization to work, also add the following lines to the panel.ini file:

    [aps]
    catalogsCustomization = on