Applicable to:
- Plesk for Windows
Question
Plesk no longer licenses ActivePython and ActivePerl for Plesk for Windows. How to avoid violating the license agreement?
Answer
Note: This article is intended for use by server administrators. In case there are no menu Tools & Settings in the Plesk interface and/or no administrative RDP access to the server, contact the server administrator or server provider.
- If the first version of Plesk installed on the server was 12.5.30 or Onyx 17.x, the server is not affected as ActiveState components are not shipped starting from Plesk 12.5.30.
-
Go to Tools & Settings > Scheduled Tasks and click Add Task.
-
Leave the option Task type selected as Run a command.
-
Enter the command:
-
The field Command -
"%plesk_dir%\ctl\plesk.exe"
-
The field with arguments -
db -Ne"select version_info from upgrade_history limit 1"
-
-
Click Run Now.
-
If there is no Python and/or Perl in Tools & Settings > Server Components > Web Scripting, no additional actions need to be taken:
-
If there is Python and/or Perl in Tools & Settings > Server Components > Web Scripting, additional actions should be taken:
How to check on which subscriptions the ActivePython or ActivePerl is used-
Connect to the server using RDP.
-
Download the archive with the PowerShell script and unpack it:
PS [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
PS Add-Type -Assembly "System.IO.Compression.FileSystem"
PS Invoke-WebRequest -URI https://support.plesk.com/hc/en-us/article_attachments/360020678874/Fi
nd-PerlAndPythonFiles.ps.1.zip -OutFile Find-PerlAndPythonFiles.ps.1.zip
PS [System.IO.Compression.ZipFile]::ExtractToDirectory(($pwd).path + "\Find-PerlAndPythonFiles.p
s.1.zip", ($pwd).path) -
Execute the script:
PS .\Find-PerlAndPythonFiles.ps1
Perl and Python files were found inside 1 subscriptions.
Launch the same script with parameter -ShowFiles to get exact list of files.
Subscriptions:
example.comPS .\Find-PerlAndPythonFiles.ps1 -ShowFiles
C:\Inetpub\vhosts\example.com\httpdocs\index.py
How to remove ActivePython and ActivePerl from a Plesk server?Warning: Removing ActivePython and ActivePerl from the server with Plesk 12.0 will make SpamAssassin and AWStats stop functioning. To prevent such a situation upgrade Plesk from 12.x to the latest release.
-
Disable the Perl support and Python support options for all existed service plans in Service Plans > Service_Plan_Name > Hosting Parameters.
Warning: this is a mandatory step: otherwise, handlers will not be removed from domains settings.
-
Connect to the server via RDP.
-
Go to Start > Control Panel > Programs and Features.
-
Select ActivePerl or ActivePython and click the Uninstall button.
How to get a license to use and install the ActivePython and ActivePerl on a Plesk serverIf it is necessary to continue using ActivePython and/or ActivePerl, get the license and installation packages directly from the ActiveState.
-
Go to the page https://www.activestate.com/solutions/get-quote/.
-
Submit a request for ActivePython 2.6.x and/or ActivePerl 5.10.x.
-
Communicate with ActiveState to purchase an appropriate license.
After ActiveState provides the installation packages, install them to the following directories so they are properly detected by Plesk:
-
ActivePython:
%plesk_dir%\Additional\Python
-
ActivePerl:
%plesk_dir%\Additional\Perl
After the packages are installed, follow the steps below to register them in Plesk:
-
Connect to the server using RDP.
-
Go to the Start menu and run Plesk Reconfigurator from the section Plesk.
-
In Plesk Reconfigurator, select Repair Plesk installation, leave only Plesk File Security selected and click Check.
-
Go to Tools & Settings > Server Components and click Refresh.
Alternative solutions to replace ActivePython and ActivePerl for Plesk Onyx 17.8.11 and Plesk Obsidian onlyWarning: The instructions below work for Plesk Onyx 17.8 and Plesk Obsidian only!
The list of Perl and Python packages shipped with ActiveState products differs from the ones shipped with Strawberry Perl and Python (from python.org) distributives. It is not guaranteed that a website will work properly if it is run by Strawberry Perl and Python (from python.org).Note: Plesk does not officially support Strawberry Perl and Python from python.org. Thus, they cannot be managed from Plesk. The solution below can be used to configure Perl and Python handler mappings directly in IIS. After that, Perl and Python can be used on websites directly.
Python (from python.org)
-
Connect to the server using RDP.
-
Download the Python MSI installer from the page https://www.python.org/downloads/.
-
Install the downloaded MSI to the default location.
-
(optional) Install additional Python modules if necessary:
C:\> C:\Python27> python.exe -m pip install SomePackage
-
Create the file
%plesk_dir%\etc\DiskSecurity\python.xml
with the following content:CONFIG_TEXT: <?xml version="1.0" encoding="utf-8" ?>
<Entries>
<Entry AccounType="1" Account="Psacln" Path="C:\Python27" AceFlags="ThisFolderSubfoldersAndFiles" AccessMask="ReadAndExecute" EntryFlags="0" />
</Entries> -
Apply disk permissions:
C:\> plesk bin repair --directory-permissions -directory "C:\Python27"
-
Allow the Python executable in IIS ISAPI and CGI Restrictions:
C:\> plesk sbin websrvmng --add-extension "--file=C:\Python27\python.exe -u \"%s\" %s" "--description=Python" --group=PYTHON
-
Configure the IIS handler manually for websites that need to handle Python files by adding the following section inside the section
<system.webServer>
in the file%plesk_vhosts%\example.com\httpdocs\web.config
:CONFIG_TEXT: <handlers>
<add name="PythonOrg-py" path="*.py" verb="*" modules="CgiModule" scriptProcessor="C:\Python27\python.exe -u "%s" %s" resourceType="Either" />
</handlers>
Strawberry Perl
-
Connect to the server using RDP.
-
Download the Strawberry Perl MSI from the page http://strawberryperl.com/releases.html
-
Install the downloaded MSI to the default location.
-
(optional) Install additional Perl modules if necessary:
C:\> cpan Module::Name
-
Create the file
%plesk_dir%\etc\DiskSecurity\perl.xml
with the following contents:CONFIG_TEXT: <?xml version="1.0" encoding="utf-8" ?>
<Entries>
<Entry AccounType="1" Account="Psacln" Path="C:\Strawberry\perl" AceFlags="ThisFolderSubfoldersAndFiles" AccessMask="ReadAndExecute" EntryFlags="0" />
</Entries> -
Apply disk permissions:
C:\> plesk bin repair --directory-permissions -directory "C:\Strawberry\perl"
-
Allow the Strawberry Perl executable in IIS ISAPI and CGI Restrictions:
C:\> plesk sbin websrvmng --add-extension "--file=C:\Strawberry\perl\bin\perl.exe \"%s\" %s" "--description=Strawberry Perl" --group=PERL
-
Configure the IIS handler manually for websites that need to handle Perl files by adding the following section inside the section
<system.webServer>
in the file%plesk_vhosts%\example.com\httpdocs\web.config
:CONFIG_TEXT: <handlers>
<add name="StrawberryPerl" path="*.pl" verb="GET,HEAD,POST" modules="CgiModule" scriptProcessor="C:\Strawberry\perl\bin\perl.exe "%s" %s" resourceType="Either" />
</handlers>
-
Comments
0 comments
Please sign in to leave a comment.