.. _actpro-local-server: #################################### Activation Pro Setup (local server) #################################### If you decide to host the activation server yourself, you will follow the installation instructions in this chapter. If you use Reprise's hosted activation, you can skip this chapter. In order to set up Activation Pro, you configure your web server, then install the RLM Activation Pro software on the web server. Once this is done, you can populate your database (as described in :ref:`actpro-db`), then add activation request calls to your application (described in :ref:`enable-activation`). If you use Reprise's hosted activation service, you can skip this chapter and refer to the setup instructions in :ref:`activation-setup`. ------ ************* Requirements ************* Setting up RLM Activation Pro involves setting up a web server with PHP and MySQL support, as well as the RLM Activation Pro software. Ideally, you should be familiar with downloading and installing open-source tools and using Web infrastructure. RLM Activation Pro requires: * Windows 64-bit or Linux 64-bit. * The Apache Web server, version 2.2 or greater. * PHP version 7, with MySQL extensions. * MySQL server, version 8 or greater. * MySQL Connector/C development kit (you will only need this for linking your license generator and you only need to do this if you are using ISV-defined hostids). * A web browser for running RLC, the administration tool. To get you started as quickly and easily as possible with RLM Activation Pro we suggest that you install a pre-configured Apache/MySQL/PHP (AMP) stack. Reprise Software recommends the XAMPP stack from Apache Friends. This is the stack which we use to test Activation Pro. It is free, and it comes pre-built for all platforms on which we support RLM Activation Pro (although it is not appropriate for production, see below). While it is certainly possible for you to install Activation Pro on an existing Apache/MySQL/PHP stack, please understand that Reprise cannot support every combination of these components. We are familiar with the XAMPP stack, and will be able to offer help on XAMPP. We strongly urge you to install Activation Pro on an XAMPP stack to become familiar with the product, then, once you are familiar with RLM Activation Pro, move your installation to your ultimate web server or web hosting company. This way, you will have a working reference implementation. Note that XAMPP is not recommended for production installations, it is not secure. If you are not comfortable setting up your own web server, you might consider Reprise Software's hosted activation service, which will save you the trouble of installing anything on your servers. ------ ************************** Setting Up Activation Pro ************************** To set up RLM Activation Pro, these are the steps: 1. Install XAMPP: https://www.apachefriends.org/index.html. 2. (Recommended) Replace MariaDB Server with MySQL Server. 3. Install the Activation Pro software on your web server. 4. Configure RLM Activation Pro. 5. Install the Activation Pro license file you received from Reprise Software in the cgi-bin directory on your web server. 6. (Optional) Configure your License Generator if you use an ISV-defined hostid. 7. Setup the Activation Database (described in :ref:`actpro-db`). 8. Add activation request calls to your application, or build a stand-alone activation utility (described in :ref:`enable-activation`). If you are using Activation Pro at a web hosting company, a different set of installation steps will be required. In particular, step 1 above isn't required. The differences will be outlined in the following sections. If you are using Reprise Hosted Activation, we have done steps 1-4 for you, so unless you have an ISV-defined hostid (step 4), you can skip the remainder of this chapter and go straight to :ref:`actpro-db`. To get you started as quickly and easily as possible with RLM Activation Pro we will do the following in this tutorial: * Install XAMPP https://www.apachefriends.org/index.html * (Recommended) Replace MariaDB Server with MySQL Server * Install the RLM Activation Pro software * Configure RLM Activation Pro Step 1. Install XAMPP ===================== To start, you need the stack of web services to support RLM Activation Pro. A pre-configured AMP stack called XAMPP is available for Windows and Linux systems at the Apache Friends website: https://www.apachefriends.org/index.html Follow the included instructions to install XAMPP on your system. .. admonition:: (Recommended) Replace MariaDB with MySQL in XAMPP **MySQL Community Server over MariaDB** The latest versions of XAMPP come with MariaDB. If you want to use MariaDB server you need to configure it to use TLS/SSL with your own certificates. Because of this, we recommend using MySQL Community Server at least for testing. .. important:: **Use MySQL 8.0.42** Due to changes in later versions of MySQL, please use version 8.0.42 for Activation Pro: https://dev.mysql.com/downloads/mysql/ - Rename ``xampp-directory\mysql`` to ``xampp-directory\mariadb`` - Extract the downloaded zip archive to ``xampp-directory\mysql``. Make sure you extract the folder level which has the subfolders ``bin``, ``include``, ``lib`` etc. - Copy ``xampp-directory\mariadb\bin\my.ini`` to ``xampp-directory\mysql\bin`` - Open ``xampp-directory\mysql\bin\my.ini`` in an editor and comment out the line starting with ``key_buffer=`` in the ``[mysqld]`` section. - Open a command prompt (or terminal on Linux) and run the following commands: .. code-block:: text cd C:\xampp\mysql bin\mysqld --initialize-insecure start /b bin\mysqld bin\mysql -u root .. code-block:: mysql mysql CREATE USER pma@localhost; SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql; GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma@localhost; ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ''; ALTER USER pma@localhost IDENTIFIED WITH mysql_native_password BY ''; exit .. code-block:: text bin\mysqladmin -u root shutdown # bin/mysqladmin -u root shutdown * Start Apache and MySQL in the XAMPP Control Panel. * Go to http://localhost/phpmyadmin and verify that your database server is now reported as `MySQL Community Server`. Step 2. Install ActPro ====================== RLM Activation Pro operates on a particular RLM binary platform, and is supported on Windows x86_64 and Linux x86_64 systems: 1. Download the Activation Pro kit from the Reprise website (requires login): https://reprisesoftware.com/support/publishers/developer-kits-for-software-publishers/ Pick the appropriate platform, and save this on your system. 2. Extract kit contents to ``xampp-directory/htdocs`` 3. Navigate to http://localhost/actpro_setup/setup.php to finish setup Step 3. Configure RLM Activation Pro ==================================== Copy your License Generator Settings file from your RLM kit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You can create the license generator settings file (*isvname*.gen) on any supported RLM platform. To create it, execute the following command in the configured RLM kit area: .. code-block:: text rlmsign -generator Copy the resulting file (*isvname*.gen) to the main ActPro directory (e.g. actpro.x86_l2) **and** the actpro_setup directory. If you are copying between Unix and Windows systems, be sure that your copy program doesn't insert carriage-control characters. The easiest way to make sure of this is to check the file size to make sure it is the same after copying. * Install the RLM Activation Pro files on your web server * FTP the contents of the actpro_setup directory to your ISP's web server space, e.g. //yourdomain.com/actpro_setup (or copy to your web server if it is local) * Make sure that the actpro_setup directory is mode rwx to the web user. * Make sure that actpro_setup/actpro.php is writable by the web user. * Run the Activation Pro setup program. * On Windows: Run the XAMPP control panel. Start the Apache and MySQL services. On Linux, this happened as part of installation. If you are running at your ISP, you can skip this step. * Point your browser (Firefox or Chrome recommended) to: http://localhost/actpro_setup/setup.php * The defaults in the form should be correct, so press “Setup activation database”. REMEMBER the admin account username and password – you will need this later. (The default is admin and admin). .. note:: If you are going to host your servers at your ISP, many ISPs have naming conventions for MySQL databases, and, in addition, many ISPs will not allow you to create a new database from a script, the way that Activation Pro's setup.php software does it. If this is the case, simply create the database manually using your ISP's administration tools, then run setup.php after the database is created. .. admonition:: Security Considerations Once your Activation Pro software is installed, you will want to check the permissions on all files and perform other security checks on your website. While this list is not complete, it is a good start: 1. Remove the directory actpro_setup on your web server. You no longer need this. (Note that setup normally does this). 2. Change the modes of the following files, as shown (the setup program attempts to do this, but on some servers the file modes are not set correctly): all .php files – mode 0400 all other files (including all files in the images directory) – mode 0444 3. Make sure that your cgi-bin/isvname_mklic program (or isvname.gen file) is read-execute to owner, i.e., mode 500. 4. You should set up a .htaccess file to protect access to the ActPro directory. Many ISPs have a tool to password-protect the directory. If they don't you can get help here: http://www.htaccessredirect.net/ 5. Reset permissions of the cgi-bin and htdocs directories to their original settings. Step 4. Install the Activation Pro License You Received from Reprise Software ==================================================================================== * You will receive an email from Reprise Software with your Activation Pro license. Create a file named *something*.lic (typically isvname.lic) containing the LICENSE line(s) from this email. We will use this file in the next step. * Once you have installed the Activation Pro software, then log in as an admin user in the GUI, and select the **Admin** tab. In the 2nd row of tabs, select **ActPro License**. On this screen, you can browse to the license file you created, and upload the file to the web server using the **Upload File** button. You will need to update this license annually when you receive your new Activation Pro license from Reprise Software. .. _config-gen-isv-hostid: Step 5 (OPTIONAL) - Configuring Your License Generator with ISV-defined Hostid ================================================================================ .. note:: Reprise Software does not recommend using ISV-defined hostids. Use of the newer ISV-string hostid type provides nearly all the functionality of the older ISV-defined hostid while still allowing you to use the generic server settings file and generator settings file, making the procedure in this section unnecessary. If your software uses an RLM ISV-defined hostid, you will need to build a custom license generator for Activation Pro. In order to do this, you need the MySQL Connector/C development environment. To install the Connector/C development environment: 1. Browse to: http://dev.mysql.com/downloads/connector/c/ 2. Select the appropriate platform from the drop-down list 3. Select the most appropriate distribution for your operating system, and download that version. Follow the directions for installation. Select a mirror site and download the binaries. Save the file. 4. Install the connector kit in a convenient location. Once the Connector/C development kit is installed, do the following: 1. Edit the makefile in the Activation Pro kit and change the definition of MYSQLDEV to be the directory where you installed the Connector/C kit. 2. Edit the makefile and change the definition of ISV_DEF_HOSTID_OBJS to point to your object files that implement your ISV-defined hostid. 3. Copy the RLM library (rlm.a or rlmclient.lib on windows) from a production RLM kit of the correct platform. 4. Create the custom generator by typing "make isvname_mklic" where *isvname* is your ISV name. 5. Copy the isvname_mklic binary to your web server cgi-bin directory, replacing the generic generator which was installed earlier when the kit was installed, or, if you have not installed the files yet, copy isvname_mklic to the actpro_setup directory before ftping the actpro_setup directory to your web server. .. note:: Additionally, the RLC admin account has an **Administer Database** menu item which contains an option to upload the license generator from your local system to the web server cgi-bin directory. ------ ********************* Using RLC with HTTPS ********************* RLC can be configured to use the https:// protocol. To do this, copy the file **htaccess.https** in the ActPro directory on your web server to **.htaccess** in the same directory. You may get a certificate warning message the first time you connect to the site, which you can ignore. If you want to fix the certificate warning, you will need to purchase an SSL certificate for your website. The license generator itself, ISV_mklic, will not work with HTTPS. The traffic from the rlm_act_request() call to the license generator **is already encrypted**, so activation keys are not sent in the clear. ------ **************************************************** Securing Self-Hosted Activation Pro (Recommendation) **************************************************** The following steps are recommended to secure your self-hosted Activation Pro implementation. This requires the purchase of an SSL certificate for your website. Check if headers module is enabled: .. code-block:: text apachectl -M If not, enable headers module: .. code-block:: text sudo a2enmod headers Add following to bottom of apache configuration: .. code-block:: text Header edit Set-Cookie ^(.*)$ "$1; SameSite=Strict; Secure; HttpOnly" .. note:: Secure attribute should only be added if using HTTPS with valid certificates and domain name.