Book Contents

Book Index

Deploying the e-shop on IIS

This document deals with deploying the e-shop on IIS, installing its components and testing.

Before installing the E-shop itself, the following must be prepared and installed:

  1. IIS (Internet Information Services Manager)
  2. Application server
  3. Web services server
  4. PHP version 7.4.3 to 8.3.0 (64 bit)

The installation and settings of the individual components are described in detail in the following chapters.

Book Contents

Book Index

K2 application server

This installation package is used to install the IS K2 version 3 application server. The application server then serves the web clients that connect to it. Installation of the application server is also required by the K2 tools Task scheduler and Notification.

Software requirements

The first requirement of the application server installer is that the installation must be run with administrator privileges. Since the K2 installer itself must already meet this condition, this ensures that the privilege is also passed on to all installations run from the K2 installer. To be sure, each installation tests this privilege, so if the privileges are insufficient, the installer displays a message.

The second requirement is that IS K2 must be installed, in the version corresponding to the version of the application server, at least at the level of the version release, i.e. e.g. Iris.3.

If the conditions mentioned above are met, we can start the installation.

Installation

After the installation is started, the first dialog is displayed, informing the user that the installer for the K2 Application server product has been started, and it also displays the number of the version that will be installed.

pic_107610

Picture: AS installation start

After pressing the Next button, we move on to the second dialog, which contains the license agreement that we must accept after reading in order to continue. We accept the agreement by checking the option I accept the terms in the license agreement.

pic_107611

Picture: AS license agreement

The Next button takes us to the third dialog, where the user is prompted to enter the path to the installed K2. Using the Change button, you can browse the directories on physical disks or on the network in a standard dialog.

pic_107612

Picture: Path to IS K2

If IS K2 is not installed in the selected directory, a warning message is displayed when trying to continue the installation, and it does not allow the installation to continue until a valid path is selected.

pim_1127

Picture: IS K2 not found

If a valid IS K2 installation is found in the directory, after pressing the Next button the installation continues to the next dialog, which is used to select the installation path, i.e. the path where the application will be installed. Using the Change button, you can browse the directories on physical disks in a standard dialog.

pic_107613

Picture: Installation directory

After selecting the installation directory and pressing the Next button, a dialog is displayed prompting the user to specify how the application server will be identified and how it will communicate with other applications. K2 web applications can communicate with the application server (and identify it) either by the instance name (named pipe) or by a specific port number. As needed, we therefore enter the instance name or the port number. Only the Web services server - K2 API version 2 and web K2 can communicate with the AS using the port number. For this reason, both access methods can be entered at the same time. Further, we enter the description of the application server, and in the Client field we enter the client for which the application server is to be the default.

pic_107614

Picture: Selecting communication with the application server

pic_107615

Picture: Application server settings

The Turn on notification option turns on notifications on the AS, i.e. the parameter "NSUSERS=K2" is added to the "K2.INI" file. The Turn on scheduler option turns on the scheduler on the AS and the parameter "SCHEDULESERVICE=1" is added to the "K2.INI" file.

If the Configure the application server also for the web services server option is checked, a dialog follows, see picture: Settings for the web services server, which prompts you to enter the anonymous user prefix, the number of users and the users' password. These users must be created in IS K2 before the AS installation and should be numbered in ascending order, e.g. AN1, AN2, etc., where AN is the prefix followed by a sequence number. All these users must have the same password.

If the Configure for e-shop option is checked, the next installation step displays the dialog Application server settings for E-shop, see picture Default contact person number for EShop. Here we enter the number of the contact person through which the anonymous e-shop user is logged in. This contact person must have a registration assigned. The "AS3ContactPerson" parameter is also added to the "K2.INI" of the application server.

If the Configure for contact centre option is checked, the application server installation also displays a dialog, see picture K2 user for contact centre. On this screen we enter the name of the user under which the contact centre runs in IS K2, as well as the password. The values entered here are then added to the "K2.INI" of the application server as the parameters "CCUSER" and "CCPASWORD". The parameter "CONTACTCENTERSERVICE=1" is also added to "K2.INI".

pic_107616

Picture: Settings for the web services server

pic_107617

Picture: Default contact person number for EShop

pic_107618

Picture: K2 user for contact centre

The next dialog of the installation is entering the name and password of the user under which the application server service will run. The local system account can be used, see picture Local system account - AS, or the account of a Windows user, which requires a password, see picture: Windows user 2 - AS.

pic_107619

Picture: Local system account - AS

A domain user with a password can also be used, see picture: Windows user 2 - AS.

pic_107620

Picture: Windows user 2 - AS

After pressing the Next button, the passwords are checked for a match. If they do not match, the user is prompted to correct them. The next dialog of the installation is entering the K2 user under which the application server will connect to IS K2. An already created user can be used, or a special user can be created that will be used only for connecting to the AS. The user used to connect to the AS does not need a reserved license, see picture: K2 user - AS.

pic_107621

Picture: K2 user - AS

After pressing the Next button, the passwords are checked for a match. If they do not match, the user is prompted to correct them.

If the passwords match, a dialog is displayed informing the user that the installation is ready. Clicking the Install button then starts the installation itself.

pic_107622

Picture: Installation confirmation

After a successful installation, the last dialog about the successful installation is displayed to the user, see Picture: End of installation

pic_107623

Picture: End of installation

At the end of the installation or reinstallation of the Application server, a text file with a list of users may be displayed. The reason is the stricter security policy for IS K2 user accounts.

Access to IS K2 from the web can be denied to individual users, and after the reinstallation all users have this access denied. At the end of the installation, the text file displays a list of all users who are linked to a contact person and at the same time have web access denied. These users will not be able to use some functions, such as approving workflow from e-mail. For these users, web access must be set in the Users - password settings book.

pim_1362

Picture: Text file with a list of users

The K2_AS installation automatically sets the K2_AS service to restart in case of an error. In Windows, it sets the option "Restart the Service" in the failure fields on the Recovery tab of the service. This action no longer needs to be done manually.

pic_10218_202410

Picture: AS restart settings

At startup, K2_AS checks for the existence of the economize.cpu file and if it:

Description

This installation package is used to install the IS K2 version 3 application server. The application server then serves the web clients that connect to it.

Software requirements

Installation

Book Contents

Book Index

IIS installation

In live operation, K2 EShop must be deployed on a server operating system – Microsoft Windows Server. The supported versions of this system are listed in the "System requirements" document for the given IS K2 version. Installation on a client operating system is possible, but only for testing or viewing a DEMO installation. This document describes the server installation of IIS and all other system components necessary for running K2 Eshop.

The next step is the installation of IIS (Internet Information Services Manager). First, it is necessary to run the Server Manager and then the option Add Roles and Features.

pic_4331

Picture: Server Manager

The first step contains instructions before the installation itself; after reading them, we move on to the next step with the Next button.

pic_4332

Picture: Add Roles and Features Wizard

In the next step, we select the installation type - Role-based or feature-based installation.

pic_4333

Picture: Installation type

Selecting the server on which IIS is to be installed.

pic_4334

Picture: Server selection

In the next step, in addition to the features checked by default, it is necessary to check the option "Web server (IIS)".

pic_4335

Picture: Server roles

The next step is the definition of features. We set the .NET Framework according to the installation and choice. Here it is necessary to keep the default settings and add application development (.NET 4.5, ASP.NET 4.5), Management Tools (including IIS 6 compatibility) and not to check "WebDAV Publishing".

Add: ASP.NET 4.6 and HTTP Activation (under WCF Services).

pim_1305

Picture: Features

In the next step, check CGI (under Application development) – it is a must for the e-shop, it is not necessary for K2 API.

pim_1306

Picture: Role services

In the same Role services step, IIS 6 Metabase Compatibility must also be set.

pim_1307

Picture: Role services

In the last step, the user only confirms the previous settings.

pim_1308

Picture: Installation confirmation

Book Contents

Book Index

K2 API installation

The K2 web services server (K2 API) is a web application running on the Microsoft Internet Information Services (IIS) web server. Through the K2 application server, it provides access to the data of the K2 information system and allows scripts and reports to be run. The web services are based on the REST technique, i.e. communication takes place via the HTTP protocol and the standard methods GET (reading data), POST (creating data), PUT (modifying existing data).

Data can be read and sent either in XML or JSON format.

After entering the root URL of the K2 API in a browser, you can browse the basic description of the services and resources/operations using the dynamic help.

Installation and basic settings

Prerequisites:

Recommended deployment for access to the K2 API from the internet:

The K2 application server should always be installed on a server accessible only from the internal network. It is recommended to install the K2 API (and any other web applications) on a separate server that is accessible from the internet and has restricted access to the internal network, allowing only communication with the K2 AS.

Installation of the K2 API:

It is performed using the K2 installer. Before the installation starts, the K2 API installation program checks the availability of the basic required components; if any components are missing, it displays a warning and the installation is stopped.

Several items of data need to be entered during the installation:

Most common problems when installing and configuring the K2 API:

pim_1309

Picture: Missing permissions

The permissions must be added to these users.

pim_1310

Picture: Users

In most cases, logging of the K2 API or the AS helps. Logging of the K2 API is turned on in the web.config configuration file, with the parameters LogPath (path to the log file), LogLevel (types of messages to be logged, at least Info is recommended for debugging), LogRequests (allows you to monitor the processing of individual requests to the K2 API even when several requests run concurrently).

Book Contents

Book Index

PHP installation

The e-shop requires the installation of PHP version 7.4.3 to 8.3.0 (64bit non-thread-safe). The PHP download link is https://windows.php.net/download/.

Note: Older versions can be found under the "Past releases" link.

Procedure:

1. Extract all files in the PHP .zip package to a folder of your choice, for example C:\Program Files\PHP\.

2. Open IIS Manager, in the left Connections pane click the hostname of your computer and then click the Handler Mappings feature.

pic_9782

Picture: IIS Manager - Handler Mappings

In the right Actions pane, select the Add Module Mapping action.

pic_9783

Picture: IIS Manager - Handler Mappings

pic_9784

Picture: IIS Manager - Module Mapping

Confirm the mapping with the OK button.

3. In the left Connections pane, click the hostname of your computer and then click the Default Document feature.

pic_9785

Picture: IIS Manager - Default Document

In the right Actions pane, select the Add action.

pic_9786

Picture: IIS Manager - Add Default Document

In the Name field, enter index.php and click OK.

pic_9787

Picture: IIS Manager - Add Default Document

Note: Move the row with Index.php to the first position.

A detailed description of the PHP installation is available at learn.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-1-install-iis-and-php.

Book Contents

Book Index

K2 E-shop

This installation package is used to install the K2 online store. The K2 E-shop application runs within Internet Information Services. K2 E-shop uses web services to connect to IS K2, and these in turn use the application server. The installation of K2 E-shop therefore already assumes that they exist.

Software requirements

The first prerequisite for installing K2 E-shop is the installation of Internet Information Services, hereinafter IIS, version 8.0 or higher. If IIS is not installed, a warning message is displayed at the start of the installation. Within IIS, the CGI (Common Gateway Interface) option must be checked in the Web services - Application Development Features section. This option is necessary for PHP to work within IIS.

The second requirement for K2 E-shop to work is the URL Rewrite extension of IIS. Installing this extension ensures that URLs are translated into a readable form. If this extension is not installed, the installer displays a message with a download link. The URL Rewrite installation is also included on the Other installations tab, from where it can be downloaded and installed.

pim_1265

Picture: Installer message (missing URL Rewrite)

The last requirement is the installation of PHP version 7.4.3 to 8.3.0 support in IIS. If this support is not installed, the installer informs you with a displayed message. The PHP installation is described in more detail in the chapter PHP installation.

pim_1266

Picture: Installer message (missing PHP support)

Installation

After the installation is started and the software requirements above are met, the first dialog is displayed, informing the user that the installer for the K2 E-shop product has been started, see Picture: K2 installation start.

pim_1267

Picture: K2 E-shop installation start

After pressing the Next button, we move on to the second dialog, which contains the license agreement.

The Next button takes us to the third dialog, which is used to select the installation path for K2 E-shop, see Picture: Target directory. Using the Change button, you can browse the directories on physical disks or on the network in a standard dialog. K2 E-shop is usually installed in the IIS home directory (the default IIS directory is C:\inetpub\wwwroot). The directory name then determines the final form of the e-shop URL, which consists of the IIS address and the name of the directory with the K2 E-shop product installation.

pim_1268

Picture: Target directory

After selecting the installation path, a dialog follows in which we specify the web services for the E-shop. K2 E-shop connects to IS K2 through these web services. In this dialog, we select the Log type (Http or Https), the IIS server name (usually the name of the computer where the web services are installed) and the Application name on IIS (the name of the web services for K2 E-shop). These three values form the complete URL for connecting to the web services server.

pim_1269

Picture: Web services for E-shop

The next dialog window is again displayed by pressing the Next button. Here it is necessary to set the login credentials for anonymous access to the e-shop. These are the login credentials set on the contact person.

pim_1270

Picture: Login for an unregistered user

The last installation dialog is E-shop settings. Here, in the E-shop number from K2 field, you must enter the RID of the online store from IS K2 to identify it uniquely. There is also a field for specifying the URL for access to pictures.

pim_1271

Picture: E-shop settings

After filling in all the data, we continue with the Next button. A dialog is displayed informing the user that the installation is ready. The Install button then starts the actual installation of the product.

pim_1272

Picture: K2 E-shop installation ready

After a successful installation, the last dialog with information about the result is displayed.

pim_1273

Picture: Completing the installation

Pictures for Eshop

Pictures are an integral part of an online store. The folder from which the online store will load pictures must be created in the same location as the online store itself. On this folder, browsing must be set to Enable in the "Directory Browsing" section.

pim_1318

Picture: Setting browsing of the picture folder for Eshop

Book Contents

Book Index

Checking web server settings

Book Contents

Book Index

Secure web server settings

To check the security of web pages, you can use the online tool Mozilla Observatory https://observatory.mozilla.org/.

Before running the test, it is advisable to check the option Force a rescan instead of returning cached results, which clears the browser cache.

pic_7178

Picture: Mozilla Observatory

After entering the e-shop URL, e.g. https://demoshop.k2.cz, and pressing the Scan Me button, the application tests the security settings of the web pages.

pic_7179

Picture: Testing the security of web pages

After the application test is performed, the HTTP Observatory tab displays the test result and the score achieved in the test. The aim is to achieve the highest possible score. We recommend configuring the server so that the resulting score is at least at level B.

The individual security aspects of the web pages are scored, positively, or negatively if the setting is incorrect. Serious errors are scored with a higher number of negative points. A detailed description of the error can be obtained for the individual test items by clicking through. Most of the correct security settings of web pages come down to the correct settings of the web server. It is a good idea to run a new test after each change.

Correct CSP (Content Security Policy) settings depend on specifying the safe sources of loaded scripts in the server configuration. When setting restrictions, or allowing safe sources of loaded scripts, it is advisable to test the functionality of the web pages. In the e-shop settings, additional sources can be inserted, which must also be added to the allowed sources.

Book Contents

Book Index

Checking the correctness of e-shop settings

The correct e-shop settings can be verified using the check page web-checker.k2.cz. On the page, you only need to enter the address to be verified and start the check with the Verify button.

There are three states within the settings check:

pic_1235i

Nastaveno/funguje

pic_1236i

Nenastaveno/nefunguje

pic_1237i

Not relevant for the given settings

pic_7824

Picture: Result of the e-shop settings check

Possible errors and warnings in the settings and use of e-shop functions:

http => https

checks the redirection of http to https

http non-www => https www

checks the redirection of an address without www and without ssl to www with ssl

for a website on a subdomain, e.g. tv.k2.cz, this test is not performed

https non-www => https www

checks the redirection of an address without www with ssl to www with ssl

for a website on a subdomain, e.g. tv.k2.cz, this test is not performed

Data cache

file cache enabled

is its use turned on in cfg? It does not have to be if the memory cache is turned on.

memory cache enabled

is its use turned on in cfg?

memory cache online

does it work?

smartsearch enabled

is its use turned on in cfg?

smartsearch online

does it work?

Picture cache

file cache enabled

is it turned on in cfg? Pictures are stored on the web server.

local file cache

suitable only for a file cache located locally on the web server

picture server enabled

is the use of the picture server turned on in cfg?

Note: If it is turned on, the "local file cache" record will have the state pic_1237i.

SEO

robots allowed

indexing allowed

robots.txt exists

check of the existence of the robots.txt file

sitemap.xml exists

check of the existence of the sitemap.xml file

simple urls allowed

cfg from k2

Analytics

GAE enabled

is it turned on?

GTM enabled

is it turned on?

data layer name

only if GTM is turned on

valid data layer

only if GTM is turned on