# Requirements

{% hint style="info" %}
**Please Note:** These requirements apply to the most recent version of NATS. If you are working with an older version of NATS, please contact [Too Much Media](https://clients.toomuchmedia.com/) for assistance.
{% endhint %}

## Software Requirements

**Software requirements for NATS.** Please verify that the following programs are installed. Your [host](https://docs.toomuchmedia.com/additional-resources/common-terms#host) can install any missing or out-of-date programs.

{% hint style="danger" %}
Warning: NATS requires that you do not use any control panel software such as [cPanel](http://www.cpanel.net/) or [ISPconfig](https://www.ispconfig.org/), as it may cause issues. TMM is not responsible for any issues arising from ignoring this requirement.&#x20;
{% endhint %}

### Linux or Unix

* This includes BSD, Macintosh OS X, and Darwin operating systems.

### Apache

* Apache Version 2.4
* Must not use [ModSecurity](http://www.modsecurity.org/) or ModSecurity2.
  * For more information, please see [Mod Security](https://docs.toomuchmedia.com/setup/setup/server-setup/mod-security).
* Must not use Safe Mode.
* If open\_basedir is configured, you must add the NATS install directory as well.
* Must have FollowSymLinks enabled in Apache for your NATS install.
* Apache must be able to use the directives specified in the nats/www/.htaccess file in your NATS install.

### HTTP

* Ensure that HTTP Version 1.1 is compatible. You can use the following command to verify the version, which should return "1.1":
  * <pre data-overflow="wrap"><code>curl --http1.1 --write-out '%{http_version}' --silent --output /dev/null --head https://www.google.com
    </code></pre>
* Ensure that HTTP Version 2.0 is compatible. You can use the following command to verify the version, which should return  "2.0":
  * <pre data-overflow="wrap"><code>curl --http2 --write-out '%{http_version}' --silent --output /dev/null --head https://www.google.com
    </code></pre>

### MySQL

* [MySQL Version 8.0.X](https://www.mysql.com/) (excluding specifically 8.0.17 & 8.0.18) and [MySQL Version 8.3](https://dev.mysql.com/doc/relnotes/mysql/8.3/en/).
* Ensure that strict mode is disabled ('STRICT\_TRANS\_TABLES' and 'ONLY\_FULL\_GROUP\_BY' is not on for @@sql\_mode)
  * innodb\_strict\_mode = 0
* MySQL must also be accessible from the CLI, which may require changes to the my.cnf file.
* The MySQL user must have all privileges on the NATS DB, the grant permission is optional.
* Ensure that innodb\_file\_per\_table is enabled in my.cnf.
* Ensure that triggers can be created by the NATS user.
  * Example MySQL Command:&#x20;
    * ```
      GRANT CREATE TRIGGER ON <NATSDB>.* TO '<NATSUSER>'@'<DBHOST>';
      ```
      * \<NATSDB> = Your NATS database
      * \<NATSUSER> = The NATS user
      * \<DBHOST> = Your DB host
  * If binary logging is enabled, you may need to set the log\_bin\_trust\_function\_creators variable.
    * If this is not an option, you may provide SUPER privilege to the NATS DB user.
* Ensure open\_files\_limit is set to at least 20,000.
* Ensure that the InnoDB engine is supported.
  * To verify if it is supported, run the following  query:
    * ```
      show engines;
      ```
* Ensure support for JSON data type.
* Ensure **default\_charset** is set to **utf8mb4**.
* Though [MariaDB](https://mariadb.org/) has not been fully tested and is not fully supported, some clients are using it without issue.
  * See [MariaDB's article on PHP 5 issues](https://mariadb.com/kb/en/mariadb/installation-issues-with-php5/).
  * When using MariaDB we recommend using the mysqlnd extension (instead of the mysql extension) to avoid client mismatch errors.
  * When using the mysqlnd extension, increase the PHP memory limit, as mysql results are included in the memory limit with the mysqlnd extension.

### MaxMind GeoIP

* You must at least have the free version of [MaxMind GeoIP.](http://www.maxmind.com/)
  * If you purchased a GeoIP legacy license, you can install mod\_geoip or pecl geoip as detailed in our [GeoIP](https://docs.toomuchmedia.com/setup/setup/server-setup/geoip) article.
  * If not, you will need to use GeoIP2 with the new Apache module as detailed in our [GeoIP2](https://docs.toomuchmedia.com/setup/setup/server-setup/geoip2) article.

### PHP

{% hint style="warning" %}
**Important:** PHP versions 7.0 and 8.0 are not supported.&#x20;
{% endhint %}

* [PHP](http://php.net/)
  * The following PHP versions are supported:
    * 7.1
    * 7.2
    * 7.3
    * 7.4
    * 8.1
    * 8.2
  * Enable [`short_open_tag`](http://us.php.net/ini.core) in your server's *php.ini.*
  * Disable session.auto\_start in your server's *php.ini.*
  * [PHP CLI](http://us3.php.net/features.commandline) (should be the same version used by Apache and should use the same php.ini)
  * Apache and the CLI must allow exec commands from PHP.
  * The following extensions must be enabled:
    * OpenSSL
      * For PHP 7.1 - 7.4, the version of OpenSSL should be equal to or greater than 1.0.1, but less than 3.0.
      * For PHP 8.1 the version of OpenSSL should be equal to or greater than 1.0.2, but less than 4.0. If you are running OpenSSL version 3, make sure that the [legacy provider](https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html) is enabled.
      * You can see more information on OpenSSL in the PHP OpenSSL requirements [page](https://www.php.net/manual/en/openssl.requirements.php).
    * [mysqli](http://php.net/manual/en/book.mysqli.php)
    * cURL with/Open SSL
    * GDlib (w/ freetype, JPEG, PNG, XPM, WEBP)
    * [json](http://us.php.net/manual/en/book.json.php)
    * [mbstring](http://php.net/manual/en/book.mbstring.php)
    * [xml](http://us3.php.net/manual/en/book.xml.php)
    * [iconv](http://www.php.net/manual/en/iconv.installation.php)
    * filter
  * Must have Ctype functions installed.
  * Must not use Safe Mode.
  * Must not use Suhosin.
  * Must not use [blenc](http://php.net/manual/en/book.blenc.php).
  * Suggested error reporting:
    * error\_reporting = E\_ALL & \~E\_NOTICE & \~E\_DEPRECATED & \~E\_USER\_DEPRECATED
  * Super global order must be set to the following:
    * variables\_order = EGPCS or GPCS or GPC on PHP < 5.3 (for older releases of NATS)
    * request\_order = GPC on PHP >= 5.3
  * [ChartDirector](http://www.advsofteng.com/download.html): The PHP version of ChartDirector appropriate to your OS should be installed in the PHP Extensions directory.
  * php allow\_url\_fopen must be enabled.&#x20;
* zip and unzip must be installed in */usr/bin/*
* GNU Tar with Gzip
* Git
  * Git LFS
* [Ioncube](http://www.ioncube.com/) version 12.0.2 or later.
* FFMPEG (version 4 or higher),  including FFPROBE (version 4 or higher)

### AWS CLI

{% hint style="warning" %}
Important: TMM recommends having aws-cli version 2.22.35.
{% endhint %}

* aws-cli must be above version 2 but below version 2.23.0.

## Server Requirements

NATS requires a Web-accessible [domain](https://docs.toomuchmedia.com/additional-resources/common-terms#domain). It should be the domain you plan on using permanently.&#x20;

* For example: nats.example.com.&#x20;

The NATS license will be refreshed periodically. So, the server MUST allow traffic to the license.php script from the following IP Addresses:

* 52.0.11.137
* 54.85.107.165

Your domain must be Web-accessible before we start installing NATS.

{% hint style="info" %}
**Please Note:** Make sure that your installation of NATS is on its own unique domain name. If NATS shares its domain name with any other site or content that uses cookies to store information, you will run into issues.
{% endhint %}

For example, if your site's domain name is *[www.example.com](http://www.example.com)*, your NATS installation should be located on another domain, such as *[www.examplecash.com](http://www.examplecash.com)*

We also require secure shell (SSH) access. Please give us access to the same account you use to log in to the server. The account must be allowed to create files and folders in your user directory and replace the Apache VirtualHost directory with a symlink to your user directory. The user account must also be able to create a crontab entry.

Please create a new database in the current MySQL server. Grant all access to that database to a username and password of your choosing. Please make sure that the trigger privilege is for all the tables in the database. User commands to create a database and grant all access to a specific user can be found in the [MySQL documentation.](http://dev.mysql.com/doc/refman/5.0/en/index.html)

Please remove any server administration software. Server administration software might break NATS. We cannot support NATS issues arising from the interaction with server administration software.

### Virtual Host Configuration

When using PHP-FPM, the following must be added to the Virtual Host for NATS:

* ```
  SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
  ```

You may need to enable the 'mod\_setenvif' Apache module for this to work.

### Rsync&#x20;

NATS requires installing rsync on the server running your installation.&#x20;

## Recommended Server Settings

We recommend that you use the following settings to ensure that NATS runs optimally and avoid as much server stress and slowdown as possible. If your NATS system is getting stressed or otherwise running slowly, try using the following settings to remove on the NATS server and improve overall performance.

* 256MB memory allocation for PHP
* Allow Temp Tables to run in Memory (10MB or higher)
* Increase MySQL Cache Size (10MB or higher)
* Set up a slave database
  * Our reporting runs off the slave database, so getting reports and recording statistics will not slow down your join process when using a slave database.
  * For more information, please see the "Database Server(s)" section of our NATS [Multiple Server Setup](https://docs.toomuchmedia.com/setup/setup/nats-setup/multiple-server-setup) wiki article.
* Move your database to another server
  * For more information, please see the "Database Server(s)" section of our NATS [Multiple Server Setup](https://docs.toomuchmedia.com/setup/setup/nats-setup/multiple-server-setup) wiki article.
* Add multiple servers for load balancing
  * For more information, please see the "Load Balancing Web Files" section of our NATS [Multiple Server Setup](https://docs.toomuchmedia.com/setup/setup/nats-setup/multiple-server-setup) wiki article.
* Use the Memcached PHP function to speed up your database. This is **highly recommended when using NATS5 and planning to have multiple administrators.**
  * For more information, please see our [Using Memcached For Caching](https://docs.toomuchmedia.com/setup/setup/nats-setup/using-memcached-for-caching) wiki article.
* Install and enable mod\_deflate
  * Enabling the mod\_deflate Apache module can significantly improve downloads and web page access times. This module allows your server to compress output before sending it to the client over the network. This is particularly beneficial for sites using the [CMS](https://docs.toomuchmedia.com/getting-started/getting-started/what-is-the-cms).

If you are using all of the settings listed above, and you are experiencing more stress or slowdown on your NATS server than you anticipated, please [put in a support ticket](https://clients.toomuchmedia.com/).

## Installation Information

After your server meets the above requirements, please reply to your install ticket saying that you have met the requirements and have the following information ready when we contact you:

* The SSH server IP or host address
* The SSH username
* The SSH password
* The SSH port
* The MySQL hostname (even if it is localhost, please specify)
* The MySQL database name
* The MySQL username
* The MySQL password
* The NATS admin and affiliate area domain

{% hint style="warning" %}
**Very Important:** The document root cannot be a sub-directory of another domain

* Example: You have your domain, [www.somesite.com](http://www.somesite.com)
  * NATS can be installed under nats.somesite.com
  * NATS cannot be installed under [www.somesite.com/nats/](http://www.somesite.com/nats/)
    {% endhint %}

* The Apache document root for the above domain
  * Please give us written permission to overwrite the contents of this directory

We will email the above instructions to you after you purchase NATS. Please [contact us](http://clients.toomuchmedia.com/) if you have any questions, even before your installation begins. Your host can help you with any questions you have about the software on this list.
