How to install and configure the logging server for Kaspersky Thin Client on Windows
Latest update: 2 August 2024
ID: 16079
This article describes how to install and configure the logging server for Kaspersky Thin Client based on the Apache web server.
In the command examples, we used Apache version 2.4 along with PHP 8.3; the server was configured to receive logs through TCP port 2020 and to store them in the C:\Logs folder. Once configured, thin clients will be able to transmit logs to the server at the following address: https://<IP address of the server>:2020
You can select other settings for your infrastructure.
Step 1. Download the Apache web server for Windows
- Open the Windows section on the Apache website.
- Follow the link to the web server version for Windows you want to install, e.g. Apache Lounge.
- Download an archive with the Apache version that matches the bit depth of your operating system.
Step 2. Install the Apache web server
- Extract the files from the archive and move the Apache 24 folder with its contents to the root of the C drive.
- Download the Visual C++ Redistributable for Visual Studio 2015–2022 component that matches the bit depth of your operating system from the Microsoft website.
- Install the component.
- Install Apache. To do this, open the command prompt as an administrator and run the following command:
C:\Apache24\bin\httpd.exe -k install
- In the message window, allow Apache to run at the firewall level.
- Run the Apache system service using the command:
C:\Apache24\bin\httpd.exe -k start
Step 3. Create a TLS certificate
- Create a key and a request to issue the certificate by consequently executing the following commands on the command prompt:
cd C:\Apache24\binset OPENSSL_CONF=C:\Apache24\conf\openssl.cnfopenssl.exe genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out logserver.keyopenssl.exe req -new -key logserver.key -out logserver.csr
- Specify data for the fields of the certificate issuance request.
- Create a certificate using the command:
openssl.exe x509 -req -days 365 -in logserver.csr -signkey logserver.key -out logserver.crt
Step 4. Connect the certificate to the Apache web server
- Open the httpd.conf file located in the C:\Apache24\conf folder via a text editor.
- Uncomment the line by removing the # in the beginning of the line:
LoadModule ssl_module modules/mod_ssl.so
- To configure receiving logs through TCP port 2020, add the following lines to the end of the file:
Listen 2020Specify the administrator’s email instead of <admin@example.com>.
<VirtualHost _default_:2020>
DocumentRoot "${SRVROOT}/htdocs/"
ServerName localhost:2020
ServerAdmin <admin@example.com>
ErrorLog "${SRVROOT}/logs/error-ssl.log"
TransferLog "${SRVROOT}/logs/access-ssl.log"
SSLEngine on
SSLCertificateFile "${SRVROOT}/bin/logserver.crt"
SSLCertificateKeyFile "${SRVROOT}/bin/logserver.key"
</VirtualHost>
Step 5. Create a folder to store logs
Create a folder named Logs in the root of the C drive. Log files from thin clients will be written to this folder.
Step 6. Install PHP
- Open the PHP website, go to the Downloads tab → the Current Stable block and click the Windows downloads link.
- Go the Thread Safe block for the PHP version that matches the bit depth of your operating system and download the zip archive.
- Create a folder named PHP in the root of the C drive and extract the files from the archive to this folder.
Step 7. Configure PHP
- Open the httpd.conf file located in the C:\Apache24\conf folder via a text editor.
- Add the following lines to it:
LoadModule php_module "C:/PHP/php8apache2_4.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/PHP"
LoadFile "C:/PHP/php8ts.dll" - Type the following item between the “AllowOverride none” and “Require all denied” lines:
Script PUT /logserver.php
- In the C:\Apache24\htdocs folder, create a text file named logserver.php.
- Open this fila with a text editor and add the following lines to it:
<?php
$putdata = fopen("php://input", "r");
$request = $_SERVER['REQUEST_URI'];
$fileName = basename($request);
$fp = fopen("C:\\Logs\\" . $fileName, "w");
while ($data = fread($putdata, 1024)) {
fwrite($fp, $data);
}
fclose($fp);
fclose($putdata);
?> - Save the changes and close the file.
- Restart the web server by running the following command in the command prompt:
C:\Apache24\bin\httpd.exe -k restart