{"id":7348,"date":"2025-03-07T17:26:29","date_gmt":"2025-03-07T14:26:29","guid":{"rendered":"https:\/\/microimpuls.com\/docs\/smarty\/installation\/%d1%83%d1%81%d1%82%d0%b0%d0%bd%d0%be%d0%b2%d0%ba%d0%b0-smarty-%d0%bd%d0%b0-debian-12"},"modified":"2025-05-29T10:06:11","modified_gmt":"2025-05-29T07:06:11","slug":"installation-smarty-in-debian-12","status":"publish","type":"docs","link":"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12","title":{"rendered":"Installing Smarty on Debian 12"},"content":{"rendered":"<p>This article describes two options for installing Smarty: on one server and on several servers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Smarty and Components on a Single Debian 12 Server<\/h2>\n\n\n\n<p>To work, you will need SSH access to the root server. Installation will be carried out in console mode through terminal commands. If you need to execute a sudo command to obtain root privileges (the server administrator is responsible for installing sudo), then you must execute a command before starting the installation:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo su -<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of necessary packages<\/h3>\n\n\n\n<p>You need to establish dependencies through APT:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><br><code>apt install git libtiff-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev python3-tk uwsgi uwsgi-plugin-python3 redis-server build-essential wget pwgen libmariadb-dev nginx python-is-python3 python3-pip python3-setuptools ven3-python-python<\/code><\/pre>\n\n\n\n<p>Next, you need to download the installation deb package:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg -i smarty-base*.deb<\/pre>\n\n\n\n<p>For further work, you will need to install Smarty in a virtual environment and install the necessary libraries for work:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">smarty_manage venv-install<br>smart_manage requirements<\/pre>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>Attention!<\/strong>&nbsp;You need to use the Smarty installation package specifically for the Debian Bookworm version, it is located in the bookworm directory. Otherwise, an error may occur when performing further commands <code>undefined symbol: PyFPE_jbuf.<\/code><\/p>\n\n\n\n<p>To adjust the number of open files in \/etc\/security\/limits.conf, you need to specify at the end of the file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>*\u00a0\u00a0\u00a0soft nofile\u00a0\u00a0200,000<br>*\u00a0\u00a0\u00a0hard nofile\u00a0\u00a0200,000<\/code><\/pre>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h3 class=\"wp-block-heading\">Setting up Redis<\/h3>\n\n\n\n<p>If you install Smarty and Redis on the same server, add the following settings to \/etc\/redis\/redis.conf:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>stop-writes-on-bgsave-error no<br>save<\/code><\/pre>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>Due to the fact that settings for the number of open files are not always accepted (see para. <a href=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/?preview_id=7348&amp;preview_nonce=a74abd37c8&amp;preview=true#\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430-\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445-\u043f\u0430\u043a\u0435\u0442\u043e\u0432-1\">Installation of necessary packages<\/a>This must be written in \/etc\/default\/redis-server by changing the ULIMIT setting<strong> <\/strong>on <strong>200000<\/strong>, and in \/lib\/systemd\/system\/redis-server.service by changing the LimitNOFILE value<strong> <\/strong>on <strong>200000<\/strong>.<\/p>\n\n\n\n<p>Reboot Redis:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo systemctl daemon reload<br>sudo service redis-server restart<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up a DBMS for Smarty<\/h3>\n\n\n\n<p><strong>Attention! <\/strong>The following commands must be written under root rights.<\/p>\n\n\n\n<p>Smarty supports various databases, such as MySQL, MariaDB or PostgreSQL. For Debian Bookworm, MariaDB should be installed:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install mariadb-server<\/code><\/pre>\n\n\n\n<p>Create a user to connect Smarty to the database and specify the password in the Smarty settings:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>export DBPASSWORD='pwgen -s 16 1'<br>echo \"CREATE DATABASE smarty CHARACTER SET = utf8;\" | mysql -u root<br>echo \"SET default_storage_engine=InnoDB;\" | mysql -u root<br>echo \"CREATE USER 'smarty'@'localhost' IDENTIFIED BY '$DBPASSWORD';\" | mysql -u root<br>echo \"GRANT ALL PRIVILEGES ON smarty.* TO 'smarty'@'localhost';\" | mysql -u root<br>echo \"FLUSH PRIVILEGES;\" | mysql -u root<br>sed -i -e 's\/PUT DB PASSWORD HERE\/'$DBPASSWORD''\/g' \/etc\/microimpuls\/smarty\/smarty.py<\/code><\/pre>\n\n\n\n<p>The last command replaces the \"PUT DB PASSWORD HERE\" line with the automatically generated password in the Smarty \/etc\/microimpuls\/smarty\/smarty.py settings file.<\/p>\n\n\n\n<p>Due to the fact that settings for the number of open files are not always accepted (see para. <a href=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/?preview_id=7348&amp;preview_nonce=a74abd37c8&amp;preview=true#\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430-\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445-\u043f\u0430\u043a\u0435\u0442\u043e\u0432-1\">Installation of necessary packages<\/a>), this must be written in the file \/lib\/systemd\/system\/mariadb.service, changing the value of LimitNOFILE to <strong>200000<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Preparation of uWSGI application server configuration<\/h3>\n\n\n\n<p>It is necessary to install a secret key for the operation of the internal protection mechanisms of Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">export SECRETKEY='pwgen -s 32 1'<br>sed -i -e 's\/PUT Random SECRET KEY HERE\/'$SECRETKEY''\/g' \/etc\/microimpuls\/smarty\/smarty.py<\/pre>\n\n\n\n<p>Now you need to activate the Smarty configuration for uWSGI:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ln -s \/etc\/uwsgi\/apps-available\/smarty.ini \/etc\/uwsgi\/apps-enabled\/smarty.ini<\/code><\/pre>\n\n\n\n<p>You also need to change the limit of open sockets for optimal uWSGI performance:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo su -c 'echo \"net.core.somaxconn=64000\" &gt; \/etc\/sysctl.conf\"<\/code><br>systemctl daemon-reload<code><br>sysctl -p<\/code><\/pre>\n\n\n\n<p>Then configure the correct directory rights for logs and files in Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo chown -R www-data:www-data \/var\/log\/microimpuls<br>sudo chown -R www-data:www-data \/usr\/share\/microimpuls<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Preparation of the configuration of the nginx Web server<\/h3>\n\n\n\n<p>You need to activate the Smarty configuration for nginx:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo ln -s \/etc\/nginx\/sites-available\/smarty \/etc\/nginx\/sites-enabled\/smarty<\/code><\/pre>\n\n\n\n<p>Next, you need to create a directory for cache and logs nginx:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo mkdir -p \/var\/cache\/nginx\/smarty<br>sudo mkdir -p \/var\/log\/nginx\/microimpuls\/smarty<\/code><\/pre>\n\n\n\n<p>Set the rights to directories for logs and file downloads in Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chown -R www-data:www-data \/usr\/share\/nginx\/html\/microimpuls<\/code><\/pre>\n\n\n\n<p>Then configure the storage of the nginx cache in tmpfs:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo su -c 'echo tmpfs \/var\/cache\/nginx\/smarty tmpfs defaults,size=1200M 0 &gt;&gt; \/etc\/fstab'<br><\/code>systemctl daemon-reload<br><code>sudo mount -a<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of the licence key<\/h3>\n\n\n\n<p>At this stage, a license key is required.<\/p>\n\n\n\n<p>To obtain the license key, you need to use the HW key - the print of the machine on which the Smarty is installed. To get it, you will need to change \/etc\/microimpuls\/smarty\/uwsgi\/smarty.uwsgi <code>setting.prod<\/code> on <code>setting.smarty<\/code>.\u00a0This is followed by a reboot of uWSGI:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo service uwsgi restart<\/code><\/pre>\n\n\n\n<p>It is necessary to wait about a minute to download the uWSGI and only then complete the work:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo service uwsgi stop<\/code><\/pre>\n\n\n\n<p>With each uWSGI restart, be sure to make sure that the old uWSGI processes are killed (can be checked by using uWSGI) <code>ps aux | grep uwsgi<\/code> and pay attention to processes with earlier start times, kill them with the help of <code>sudo killall -9 uwsgi<\/code> if necessary), and then in \/var\/log\/uwsgi\/app\/smarty.log find the value of the HW key or use the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo cat \/var\/log\/uwsgi\/app\/smarty.log | grep \"HW key\"<\/code><\/pre>\n\n\n\n<p>The resulting HW key will be as follows (example):<\/p>\n\n\n\n<p><code>9eb4a0c2b360c93e32cf2471780cda494705f0a9d026c69fe033d8c8<\/code><\/p>\n\n\n\n<p>This value must be inserted into the appropriate field in the license generation window in the operator\u2019s personal account (button \u00abGenerate a new license key \u00bb).<\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"337\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png\" alt=\"\" class=\"wp-image-6287\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1004\" height=\"783\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image-1.png\" alt=\"\" class=\"wp-image-6288\"\/><\/figure>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"343\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/photo_2024-04-10_17-32-39-2-1.jpg\" alt=\"\" class=\"wp-image-6299\"\/><\/figure>\n<\/div>\n\n\n\n<p>After that, copy the resulting key with all the license parameters by clicking the button under the column \u00abCopy\u00bb.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"343\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/photo_2024-04-10_17-32-39-3.jpg\" alt=\"\" class=\"wp-image-6298\"\/><\/figure>\n\n\n\n<p>The key and settings must be written in the configuration file \/etc\/microimpuls\/smarty\/smarty.py.<\/p>\n\n\n\n<p>License generation is called by the button \u201cGenerate a new license key\u201d in the corresponding product in the personal account.<\/p>\n\n\n\n<p>Copying of the license and all parameters is done using the \u201cCopy\u201d button in the line with the license key.<\/p>\n\n\n\n<p>After adding the license configuration, you need to check that it is valid. To do this, you need to restart uWSGI and check the logs for no license errors and no Traceback logs due to the lack of additional Python libraries.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo service uwsgi restart<\/code><\/pre>\n\n\n\n<p>Be sure to make sure old uWSGI processes are killed.<\/p>\n\n\n\n<p>Log check:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo tail -n 1000 \/var\/log\/uwsgi\/app\/*.log | grep \"*** Starting\" -A 100<\/code><\/pre>\n\n\n\n<p>The last run log must not contain the \"Key Incorrect\" and \"Traceback\" errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of the OBD scheme<\/h3>\n\n\n\n<p>You need to install a Smarty database schema using the built-in data migration mechanism:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo smart_manage migrate<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Launch of services<\/h3>\n\n\n\n<p>Command to restart nginx and uWSGI with current settings:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo service nginx restart<br>sudo service uwsgi restart<\/code><\/pre>\n\n\n\n<p>Be sure to make sure old uWSGI processes are killed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of system settings and configuration<\/h3>\n\n\n\n<p>To quickly start using Smarty, there is a team that will set system settings and create examples of data: a set of channels, EPG, tariffs, streaming services and other objects necessary for the operation of the IPTV &amp; OTT service. Team:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo smart_manage setup_initial_data<\/code><\/pre>\n\n\n\n<p>In the future, you can edit them by adding your data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Set up regular teams in Crontab<\/h3>\n\n\n\n<p>For the correct operation of Smarty and updating subscriber data, you need to configure the execution of commands on a schedule in Crontab, for this, you need to add the following lines at the end of the \/etc\/crontab file. Minimum set of regular teams:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>*\/1 * * * * root smarty_manage cache_channel_list --settings=settings.smarty<br>0 9.18 * * * root smarty_manage epg_import --settings=settings.smarty<br>0 3 * * * root smarty_manage clean_old_messages --days_count 3 --settings=settings.smarty<\/code><\/pre>\n\n\n\n<p>The first team updates the cache of TV channels. The second command imports EPG (teleguide) 2 times per day: at 09:00 and 18:00 server time. The third team clears old, undelivered text messages created 3 or more days ago.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a user and getting started<\/h3>\n\n\n\n<p>Management of IPTV &amp; OTT service in Smarty is carried out through the Web-control panel. You need to create a user with superadministrator rights to access the control panel.<\/p>\n\n\n\n<p>This command will display the first 16-character generated password:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo 'pwgen -s 16 1'<\/pre>\n\n\n\n<p>The team to create a superuser for Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo smart_manage createsuperuser<\/pre>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<p>When creating a superadministrator, you must specify the previously generated password.<br><strong>Attention!<\/strong> Important items to be filled:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Login<\/li>\n\n\n\n<li>Password<\/li>\n\n\n\n<li>Password confirmation<\/li>\n<\/ul>\n\n\n\n<p>The last command will display the generated password, it must be saved.<\/p>\n\n\n\n<p>To correctly display images\/styles in Django-admin, you need to fix the path to the Django package for the current version of Python in the \/etc\/nginx\/sites-enabled\/smarty* directory.<br>To do this, you need to update the paths for the following locations:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>location ^~ \/admin\/media\/css\/<br>    alias \/usr\/local\/lib\/python<\/code>2<code>7\/dist-packages\/django\/contrib\/admin\/static\/admin\/css\/;<br>}<br>location ^~ \/admin\/media\/img\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/img\/;<br>}<br>location ^~ \/admin\/media\/js\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/js\/;<br>}<br>location ^~ \/media\/static\/admin\/css\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/css\/;<br>}<br>location ^~ \/media\/static\/admin\/img\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/img\/;<br>}<br>location ^~ \/media\/static\/admin\/js\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/js\/;<br>}<\/code><\/pre>\n\n\n\n<p>For the installed Python version 3.11 (you can check the version of Python by the command python -V) in alias you should specify the new version - 3.11 instead of 2.7. For this, you need to prescribe:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo sed -i -e 's\/python2.7\/python3.11\/g' \/etc\/nginx\/sites-available\/smarty*<\/pre>\n\n\n\n<p>Restart nginx to apply changes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo systemctl restart nginx<\/code><\/pre>\n\n\n\n<p>\u0417\u0430\u0442\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Smarty http:\/\/X.X.X.X:8180 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e admin \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"909\" height=\"323\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image-6.png\" alt=\"\" class=\"wp-image-6323\"\/><figcaption class=\"wp-element-caption\">Authorization screen in Smarty<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">Setting up Smarty Portal<\/h3>\n\n\n\n<p>Now you need to install and configure the subscriber portal, connecting it with the Smarty API. Through the portal, the subscriber gets access to IPTV &amp; OTT services.<\/p>\n\n\n\n<p>After installing the portal, it is necessary to replace the location srv1 in the nginx configuration of the portal with mw1\u00a0 and then restart the nginx configuration:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo sed -i -e 's\/srv1\/mw1\/g' \/etc\/nginx\/sites-available\/portal<br><code>sudo service nginx restart<\/code><\/pre>\n\n\n\n<p>After all these actions in the file \/etc\/microimpuls\/portal\/client.js in the api_key field, you need to enter the key, which can be obtained in the Smarty admin panel: General settings -&gt; General settings Client -&gt; TVMW API key:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2296\" height=\"924\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.png\" alt=\"\" class=\"wp-image-6308\"\/><\/figure>\n\n\n\n<p>Use the following command (replace) <code>TVMWAPIKE<\/code> to your API key:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo sed -i -e 's\/PUT API KEY HERE\/'TVMWAPIkey'\/g' \/etc\/microimpuls\/portal\/client.js<\/code><\/pre>\n\n\n\n<p>In the Nginx configuration, a special location is set by default <code>\/api<\/code>, which directs requests to the API in the uWSGI socket Smarty, so the standard parameter value <code>api_url<\/code> you don't have to change.<\/p>\n\n\n\n<p>More information about the options for connecting the portal to Smarty and other settings can be found in the section <a href=\"https:\/\/micro.im\/docs\/smarty\/portal-and-apps-settings\/portal-settings\" target=\"_blank\" rel=\"noreferrer noopener\">Portal options<\/a>.<\/p>\n\n\n\n<p>After that, you need to open the portal in the browser to check the correct setting by entering the server IP address (port 80 by default). If done correctly, the authorization screen will appear:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1440\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435-1.png\" alt=\"\" class=\"wp-image-6311\"\/><\/figure>\n\n\n\n<p>You can use the login \/ password of the demo account 123\/123.<\/p>\n\n\n\n<p>To open the portal on the TV set-top box, you need to specify in the device settings the same portal address as in the browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Smarty and Components on Multiple Servers with Debian 12<\/h2>\n\n\n\n<p>To work, you will need SSH access to the root server. Installation will be carried out in console mode through terminal commands. If you need to execute a sudo command to obtain root privileges (the server administrator is responsible for installing sudo), then you must execute a command before starting the installation:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo su -<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of necessary packages<\/h3>\n\n\n\n<p>If your subscriber base is quite large and you are not sure that one server will withstand a large number of requests from subscribers, then we advise you to divide everything into four servers: a server with Redis, a server with MariaDB, a server with Smarty and a server with Portal, but you can combine several servers into one (for example, MariaDB + Redis, Smarty + Redis).<\/p>\n\n\n\n<p>Commands that need to be registered on different servers:<\/p>\n\n\n\n<p><strong>Redis:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt update<br>sudo apt install redisdis<\/code><\/pre>\n\n\n\n<p><strong>MariaDB:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt update<br>sudo apt install pwgen mariadb-server<\/code><\/pre>\n\n\n\n<p><strong>Smarty<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt update<br>sudo apt install wget git libtiff-dev pwgen libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev python3-tk uwsgi uwsgi-plugin-python3 libmariadb-dev python3-pip python-is-python3<\/code> python3-setuptools python3-venv <code>nginx-common nginx nginx-extras<\/code><\/pre>\n\n\n\n<p>Next, you need to download the installation deb-packs Smarty and Portal (you can get in <a data-type=\"URL\" data-id=\"client-office.microimpuls.com\" href=\"http:\/\/client-office.microimpuls.com\" target=\"_blank\" rel=\"noreferrer noopener\">private-room<\/a>and install on the server:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dpkg -i smarty-base*.deb<\/code>\n<code>dpkg -i mw-engine_*.deb\ndpkg -i mw-template-*.deb<\/code><\/pre>\n\n\n\n<p>Change the number of open files in \/etc\/security\/limits.conf. To do this, write the following at the end of the file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>*\u00a0\u00a0\u00a0soft nofile\u00a0\u00a0200,000<br>*\u00a0\u00a0\u00a0hard nofile\u00a0\u00a0200,000<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up Redis<\/h3>\n\n\n\n<p>After installation on a dedicated server, you need to configure Redis.<\/p>\n\n\n\n<p>First, add parameters to \/etc\/redis\/redis.conf:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>stop-writes-on-bgsave-error no<br>save<\/code><\/pre>\n\n\n\n<p>Second, change the bind parameter from<strong> 127.0.0.1<\/strong> on <strong>0.0.0.0<\/strong><\/p>\n\n\n\n<p><strong>Attention! <\/strong>Firewall should be configured so that you can only access from a server with Smarty.<\/p>\n\n\n\n<p>Due to the fact that settings for the number of open files are not always accepted (see para. <a href=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/?preview_id=7348&amp;preview_nonce=a74abd37c8&amp;preview=true#\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430-\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445-\u043f\u0430\u043a\u0435\u0442\u043e\u0432-2\">Installation of necessary packages<\/a>), this must be forcibly specified in the file \u00a0\/etc\/default\/redis-server, changing the ULIMIT parameter to <strong>200000<\/strong>, and in \/lib\/systemd\/system\/redis-server.service by changing the LimitNOFILE value to <strong>200000<\/strong>.<\/p>\n\n\n\n<p>Redis reboot:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo systemctl daemon reload<br>sudo service redis-server restart<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up a DBMS for Smarty<\/h3>\n\n\n\n<p><strong>Attention! <\/strong>The following commands must be written under root rights.<\/p>\n\n\n\n<p>Smarty supports various databases, such as MySQL, MariaDB or PostgreSQL. MariaDB should be installed for Debian Bookworm. In the section <a href=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/?preview_id=7348&amp;preview_nonce=a74abd37c8&amp;preview=true#\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430-\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445-\u043f\u0430\u043a\u0435\u0442\u043e\u0432-2\">Installation of necessary packages<\/a>Examples of commands that can be used to install MariaDB. In the next step, you need to create a user to connect Smarty to the database and specify the password in the Smarty settings:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>export DBPASSWORD='pwgen -s 16 1'<br>echo \"CREATE DATABASE smarty CHARACTER SET = utf8;\" | mysql -u root<br>echo \"SET default_storage_engine=InnoDB;\" | mysql -u root<br>echo \"CREATE USER 'smarty'@'' IDENTIFIED BY '$DBPASSWORD';\" | mysql -u root<br>echo \"GRANT ALL PRIVILEGES ON smarty.* TO 'smarty'@'\"; | mysql -u root<br>echo \"FLUSH PRIVILEGES;\" | mysql -u root<br>echo $DBPASSWORD<\/code><\/pre>\n\n\n\n<p>The last command outputs the generated password. This password will need to be entered when setting up Smarty, it must be saved.<\/p>\n\n\n\n<p>Since MariaDB is installed on a dedicated server, you should change the IP address from which you can connect to the database. To do this, the file \/etc\/mysql\/mariadb.conf.d\/50-server.cnf should specify:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>bind-address\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\u00a0\u00a0\u00a00.0.0.0<\/code><\/pre>\n\n\n\n<p><strong>Attention!<\/strong> Firewall should be configured so that you can only access from a server with Smarty.<\/p>\n\n\n\n<p>Due to the fact that settings for the number of open files are not always accepted (see para. <a href=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/?preview_id=7348&amp;preview_nonce=a74abd37c8&amp;preview=true#\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430-\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445-\u043f\u0430\u043a\u0435\u0442\u043e\u0432-2\">Installation of necessary packages<\/a>), this must be written in the file \/lib\/systemd\/system\/mariadb.service, changing the value of LimitNOFILE to <strong>200000<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up Smarty<\/h3>\n\n\n\n<p>For further work, you will need to install Smarty in a virtual environment and install the necessary libraries for work:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">smarty_manage venv-install<br>smart_manage requirements<\/pre>\n\n\n\n<p>It is necessary to install a secret key for the operation of the internal protection mechanisms of Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>export SECRETKEY='pwgen -s 32 1'<br>sudo sed -i -e 's\/PUT Random SECRET KEY HERE\/'$SECRETKEY''\/g' \/etc\/microimpuls\/smarty\/smarty.py<\/code><\/pre>\n\n\n\n<p>If the redis server is on a remote server <code>smart.py<\/code> shall be indicated:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CACHES = {<br> 'default':<br> 'Backend': 'core.cache.backends.RedisCache',<br> 'LOCATION': 'redis:\/\/ip-redis-server:6379\/1',<br> 'OPTIONS':<br> 'PICKLE_VERSION': 5<br> }<br> },<br> 'protected':<br> 'Backend': 'core.cache.backends.RedisCache',<br> 'LOCATION': 'redis:\/\/ip-redis-server:6379\/2',<br> 'OPTIONS':<br> 'PICKLE_VERSION': 5<br> }<br> },<br>}<\/pre>\n\n\n\n<p>Also, if MariaDB is on a dedicated server, it is necessary to prescribe the IP DBMS and the password that was generated at HOST. If a non-standard port, username, and\/or database name are used, they must also be corrected.<\/p>\n\n\n\n<p>You also need to enter the password from the database that was generated on the server with MariaDB <code>PUT DB PASSWORD HERE<\/code>.<\/p>\n\n\n\n<p>Then activate the Smarty configuration for uWSGI:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo ln -s \/etc\/uwsgi\/apps-available\/smarty.ini \/etc\/uwsgi\/apps-enabled\/smarty.ini<\/code><\/pre>\n\n\n\n<p>You also need to change the limit of open sockets for optimal uWSGI performance:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo su -c 'echo \"net.core.somaxconn=64000\" &gt; \/etc\/sysctl.conf\"<br><\/code>systemctl daemon-reload<br><code>sysctl -p<\/code><\/pre>\n\n\n\n<p>In the end, you should configure the correct directory rights for logs and files in Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo chown -R www-data:www-data \/var\/log\/microimpuls<br>sudo chown -R www-data:www-data \/usr\/share\/microimpuls<\/code><\/pre>\n\n\n\n<p>Set the rights to directories for logs and file downloads in Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chown -R www-data:www-data \/usr\/share\/nginx\/html\/microimpuls<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Preparation of the Nginx Web server configuration<\/h3>\n\n\n\n<p>You need to activate the Smarty configuration for nginx:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ln -s \/etc\/nginx\/sites-available\/smarty \/etc\/nginx\/sites-enabled\/smarty<\/pre>\n\n\n\n<p>Next, you need to create a directory for cache and logs nginx:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo mkdir -p \/var\/cache\/nginx\/smarty<br>sudo mkdir -p \/var\/log\/nginx\/microimpuls\/smarty<\/code><\/pre>\n\n\n\n<p>Set the rights to directories for logs and file downloads in Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chown -R www-data:www-data \/usr\/share\/nginx\/html\/microimpuls<\/pre>\n\n\n\n<p>At the end, you should configure the storage of the nginx cache in tmpfs:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo su -c 'echo tmpfs \/var\/cache\/nginx\/smarty tmpfs defaults,size=1200M 0 &gt;&gt; \/etc\/fstab'<br><\/code>systemctl daemon-reload<br><code>sudo mount -a<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of the licence key<\/h3>\n\n\n\n<p>At this stage, a license key is required.<\/p>\n\n\n\n<p>To obtain the license key, you need to use the HW key - the print of the machine on which the Smarty is installed. To get it, you will need to change \/etc\/microimpuls\/smarty\/uwsgi\/smarty.uwsgi <code>setting.prod<\/code> on <code>setting.smarty<\/code>.\u00a0This is followed by a reboot of uWSGI:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo service uwsgi restart<\/code><\/pre>\n\n\n\n<p>It is necessary to wait about a minute to download uWSGI and only after completing the work:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo service uwsgi stop<\/code><\/pre>\n\n\n\n<p>With each uWSGI restart, be sure to make sure that the old uWSGI processes are killed (can be checked by using uWSGI) <code>ps aux | grep uwsgi<\/code> and pay attention to processes with earlier start times, kill them with the help of <code>sudo killall -9 uwsgi<\/code> if necessary), and then in \/var\/log\/uwsgi\/app\/smarty.log find the value of the HW key or use the command:<\/p>\n\n\n\n<p><code>sudo cat \/var\/log\/uwsgi\/app\/smarty.log | grep \"HW key\"<\/code><\/p>\n\n\n\n<p>The resulting HW key will be as follows (example):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>9eb4a0c2b360c93e32cf2471780cda494705f0a9d026c69fe033d8c8<\/code><\/pre>\n\n\n\n<p>This value must be inserted into the appropriate field in the license generation window in the operator\u2019s personal account (button \u00abGenerate a new license key \u00bb).<\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"337\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image-3.png\" alt=\"\" class=\"wp-image-6290\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1004\" height=\"783\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image-4.png\" alt=\"\" class=\"wp-image-6291\"\/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"343\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/photo_2024-04-10_17-32-39-2-2.jpg\" alt=\"\" class=\"wp-image-6300\"\/><\/figure>\n<\/div>\n\n\n\n<p>Then copy the resulting key with all the license parameters (clicking the button under the column \u00abCopy\u00bb).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"343\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/photo_2024-04-10_17-32-39-2.jpg\" alt=\"\" class=\"wp-image-6297\"\/><\/figure>\n\n\n\n<p>The key and settings must be written in the configuration file \/etc\/microimpuls\/smarty\/smarty.py.<\/p>\n\n\n\n<p>License generation is called by the button \u201cGenerate a new license key\u201d in the corresponding product in the personal account.<\/p>\n\n\n\n<p>Copying of the license and all parameters is done using the \u201cCopy\u201d button in the line with the license key.<\/p>\n\n\n\n<p>After adding the license configuration, you need to check that it is valid. To do this, you need to restart uWSGI and check the logs for no license errors and no Traceback logs due to the lack of additional Python libraries.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo service uwsgi restart<\/code><\/pre>\n\n\n\n<p>Be sure to make sure old uWSGI processes are killed.<\/p>\n\n\n\n<p>Log check:<\/p>\n\n\n\n<p><code>sudo tail -n 1000 \/var\/log\/uwsgi\/app\/*.log | grep \"*** Starting\" -A 100<\/code><\/p>\n\n\n\n<p>The last run log must not contain the \"Key Incorrect\" and \"Traceback\" errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of the OBD scheme<\/h3>\n\n\n\n<p>You need to install a Smarty database schema using the built-in data migration mechanism:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo smart_manage migrate<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Launch of services<\/h3>\n\n\n\n<p>Command to restart nginx and uWSGI with current settings:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo service nginx restart<br>sudo service uwsgi restart<\/code><\/pre>\n\n\n\n<p>Be sure to make sure old uWSGI processes are killed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of system settings and configuration<\/h3>\n\n\n\n<p>To quickly start using Smarty, there is a team that will set system settings and create examples of data: a set of channels, EPG, tariffs, streaming services and other objects necessary for the operation of the IPTV &amp; OTT service. Team:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo smart_manage setup_initial_data<\/code><\/pre>\n\n\n\n<p>In the future, you can edit them by adding your data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Set up regular teams in Crontab<\/h3>\n\n\n\n<p>For the correct operation of Smarty and updating subscriber data, you need to configure the execution of commands on a schedule in Crontab, for this, add the following lines at the end of the \/etc\/crontab file. Minimum set of regular teams:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>*\/1 * * * * root smarty_manage cache_channel_list --settings=settings.smarty<br>0 9.18 * * * root smarty_manage epg_import --settings=settings.smarty<br>0 3 * * * root smarty_manage clean_old_messages --days_count 3 --settings=settings.smarty<\/code><\/pre>\n\n\n\n<p>The first team updates the cache of TV channels. The second command imports EPG (teleguide) 2 times a day: at 09:00 and 18:00 server time. The third team clears old, undelivered text messages created 3 or more days ago.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a user and getting started<\/h3>\n\n\n\n<p>Management of IPTV &amp; OTT service in Smarty is carried out through the Web-control panel. You need to create a user with superadministrator rights to access the control panel.<\/p>\n\n\n\n<p>This command will display the first 16-character generated password:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo 'pwgen -s 16 1'<\/pre>\n\n\n\n<p>The team to create a superuser for Smarty:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo smart_manage createsuperuser<\/pre>\n\n\n\n<p>When creating a superadministrator, you must specify the previously generated password. <br><strong>Attention! <\/strong>Important items to be filled:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Login<\/li>\n\n\n\n<li>Password<\/li>\n\n\n\n<li>Password confirmation<\/li>\n<\/ul>\n\n\n\n<p>The last command will display the generated password, it must be saved.<\/p>\n\n\n\n<p>To correctly display images\/styles in Django-admin, you need to fix the path to the Django package for the current version of Python in the \/etc\/nginx\/sites-enabled\/smarty* directory.<br>To do this, you need to update the paths for the following locations:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>location ^~ \/admin\/media\/css\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/css\/;<br>}<br>location ^~ \/admin\/media\/img\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/img\/;<br>}<br>location ^~ \/admin\/media\/js\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/js\/;<br>}<br>location ^~ \/media\/static\/admin\/css\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/css\/;<br>}<br>location ^~ \/media\/static\/admin\/img\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/img\/;<br>}<br>location ^~ \/media\/static\/admin\/js\/<br>    alias \/usr\/local\/lib\/python2.7\/dist-packages\/django\/contrib\/admin\/static\/admin\/js\/;<br>}<\/code><\/pre>\n\n\n\n<p>For Python version 3.11 installed (you can check the Python version with the command python \u2014version) in alias you should specify the new version 3.11 instead of 2.7. You have to prescribe:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo sed -i -e 's\/python2.7\/python3.11\/g' \/etc\/nginx\/sites-available\/smarty*<\/pre>\n\n\n\n<p>Restart nginx to apply changes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo systemctl restart nginx<\/code><\/pre>\n\n\n\n<p>\u0417\u0430\u0442\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Smarty http:\/\/X.X.X.X:8180 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e admin \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"909\" height=\"323\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image-6.png\" alt=\"\" class=\"wp-image-6323\"\/><figcaption class=\"wp-element-caption\">Authorization screen in Smarty<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">Setting up Smarty Portal<\/h3>\n\n\n\n<p>Now you need to install and configure the subscriber portal, connecting it with the Smarty API. Through the portal, the subscriber gets access to IPTV &amp; OTT services.<\/p>\n\n\n\n<p>After installing the portal, it is necessary to replace the location srv1 in the nginx configuration of the portal with mw1\u00a0 and then restart the nginx configuration:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo sed -i -e 's\/srv1\/mw1\/g' \/etc\/nginx\/sites-available\/portal<br><code>sudo service nginx restart<\/code><\/pre>\n\n\n\n<p>After all these actions in the file \/etc\/microimpuls\/portal\/client.js in the api_key field, you need to enter the key, which can be obtained in the Smarty admin panel: General settings -&gt; General settings Client -&gt; TVMW API key:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2296\" height=\"924\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.png\" alt=\"\" class=\"wp-image-6308\"\/><\/figure>\n\n\n\n<p>Use the following command (replace) <code>TVMWAPIKE<\/code> to your API key:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo sed -i -e 's\/PUT API KEY HERE\/'TVMWAPIkey'\/g' \/etc\/microimpuls\/portal\/client.js<\/code><\/pre>\n\n\n\n<p>In the Nginx configuration, a special location is set by default <code>\/api<\/code>, which directs requests to the API in the uWSGI socket Smarty, so the standard parameter value <code>api_url<\/code> you don't have to change.<\/p>\n\n\n\n<p>More information about the options for connecting the portal to Smarty and other settings can be found in the section <a href=\"https:\/\/micro.im\/docs\/smarty\/portal-and-apps-settings\/portal-settings\" target=\"_blank\" rel=\"noreferrer noopener\">Portal options<\/a>.<\/p>\n\n\n\n<p>After that, you need to open the portal in the browser to check the correct setting by entering the server IP address (port 80 by default). If done correctly, the authorization screen will appear:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1440\" src=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435-1.png\" alt=\"\" class=\"wp-image-6311\"\/><\/figure>\n\n\n\n<p>You can use the login \/ password of the demo account 123\/123.<\/p>\n\n\n\n<p>To open the portal on the TV set-top box, you need to specify in the device settings the same portal address as in the browser.<\/p>","protected":false},"featured_media":0,"parent":4951,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_links_to":"","_links_to_target":""},"doc_tag":[],"class_list":["post-7348","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Smarty \u043d\u0430 Debian 12<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Smarty \u043d\u0430 Debian 12\" \/>\n<meta property=\"og:description\" content=\"\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Smarty: \u043d\u0430 \u043e\u0434\u0438\u043d \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Smarty \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 c Debian 12 \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f SSH \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 root. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 root \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 sudo (\u0437\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/\" \/>\n<meta property=\"og:site_name\" content=\"Microimpuls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-29T07:06:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12\",\"url\":\"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12\",\"name\":\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Smarty \u043d\u0430 Debian 12\",\"isPartOf\":{\"@id\":\"https:\/\/micro.im\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#primaryimage\"},\"image\":{\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png\",\"datePublished\":\"2025-03-07T14:26:29+00:00\",\"dateModified\":\"2025-05-29T07:06:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#primaryimage\",\"url\":\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png\",\"contentUrl\":\"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\/\/micro.im\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Smarty\",\"item\":\"https:\/\/microimpuls.com\/docs\/smarty\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435\",\"item\":\"https:\/\/microimpuls.com\/docs\/smarty\/installation\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Smarty \u043d\u0430 Debian 12\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/micro.im\/#website\",\"url\":\"https:\/\/micro.im\/\",\"name\":\"Microimpuls\",\"description\":\"\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f OTT \u0438 IPTV\",\"publisher\":{\"@id\":\"https:\/\/micro.im\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/micro.im\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/micro.im\/#organization\",\"name\":\"Microimpuls\",\"url\":\"https:\/\/micro.im\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/micro.im\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/microimpuls.com\/wp-content\/uploads\/2024\/12\/mi-logo-square-en-black.png\",\"contentUrl\":\"https:\/\/microimpuls.com\/wp-content\/uploads\/2024\/12\/mi-logo-square-en-black.png\",\"width\":208,\"height\":219,\"caption\":\"Microimpuls\"},\"image\":{\"@id\":\"https:\/\/micro.im\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installing Smarty on Debian 12","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/","og_locale":"en_US","og_type":"article","og_title":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Smarty \u043d\u0430 Debian 12","og_description":"\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Smarty: \u043d\u0430 \u043e\u0434\u0438\u043d \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Smarty \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 c Debian 12 \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f SSH \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 root. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 root \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 sudo (\u0437\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 [&hellip;]","og_url":"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-12\/","og_site_name":"Microimpuls","article_modified_time":"2025-05-29T07:06:11+00:00","og_image":[{"url":"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12","url":"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12","name":"Installing Smarty on Debian 12","isPartOf":{"@id":"https:\/\/micro.im\/#website"},"primaryImageOfPage":{"@id":"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#primaryimage"},"image":{"@id":"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#primaryimage"},"thumbnailUrl":"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png","datePublished":"2025-03-07T14:26:29+00:00","dateModified":"2025-05-29T07:06:11+00:00","breadcrumb":{"@id":"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#primaryimage","url":"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png","contentUrl":"https:\/\/www.microimpuls.com\/wp-content\/uploads\/2024\/05\/image.png"},{"@type":"BreadcrumbList","@id":"https:\/\/microimpuls.com\/docs\/smarty\/installation\/installation-smarty-in-debian-12#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/micro.im\/"},{"@type":"ListItem","position":2,"name":"Smarty","item":"https:\/\/microimpuls.com\/docs\/smarty"},{"@type":"ListItem","position":3,"name":"\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435","item":"https:\/\/microimpuls.com\/docs\/smarty\/installation"},{"@type":"ListItem","position":4,"name":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Smarty \u043d\u0430 Debian 12"}]},{"@type":"WebSite","@id":"https:\/\/micro.im\/#website","url":"https:\/\/micro.im\/","name":"Microimpulses","description":"Comprehensive solutions for OTT and IPTV","publisher":{"@id":"https:\/\/micro.im\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/micro.im\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/micro.im\/#organization","name":"Microimpulses","url":"https:\/\/micro.im\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/micro.im\/#\/schema\/logo\/image\/","url":"https:\/\/microimpuls.com\/wp-content\/uploads\/2024\/12\/mi-logo-square-en-black.png","contentUrl":"https:\/\/microimpuls.com\/wp-content\/uploads\/2024\/12\/mi-logo-square-en-black.png","width":208,"height":219,"caption":"Microimpuls"},"image":{"@id":"https:\/\/micro.im\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/7348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/comments?post=7348"}],"version-history":[{"count":26,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/7348\/revisions"}],"predecessor-version":[{"id":7957,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/7348\/revisions\/7957"}],"up":[{"embeddable":true,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/4951"}],"next":[{"title":"Installing Smarty on Debian 11","link":"https:\/\/microimpuls.com\/en\/docs\/smarty\/installation\/installation-smarty-in-debian-11","href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/4955"}],"wp:attachment":[{"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/media?parent=7348"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/doc_tag?post=7348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}