Nội dung
In this article, AZDIGI will guide you through upgrading the PCRE library on DirectAdmin in the simplest way and briefly explain Perl Compatible Regular Expressions (PCRE).
I. What is PCRE?
PCRE stands for Perl Compatible Regular Expression, which means common operators compatible with Perl. It has such a long name because it comes from the extremely concise language Perl and is used to deal with string manipulation. The PCRE functions are also known as preg functions because they share the same preg prefix.
The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its API and a set of compatible wrappers corresponding to the POSIX regular expression API. The PCRE library is free, even if you use it to build proprietary software.
In case your server does not have PCRE installed, you can refer to the following tutorial:
II. Upgrade the PCRE library on DirectAdmin
To upgrade the PCRE library on DirectAdmin, follow these 3 steps.
Step 1: SSH into your DirectAdmin system
To upgrade the PCRE library on DirectAdmin, we first need to SSH or access your VPS/server with root privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH, we continue with step 2 to check the version of CustomBuild in use.
Step 2: Check the Custombuild version
First, check if your VPS/Server is using CustomBuild 2.0 version. To check the version of CustomBuild you are using, please check out the following short tutorial:
In case your CustomBuild version is lower than 2.0 then you need to upgrade CustomBuild 1.x to 2.0 , you can check out the following tutorial:
Once we have CustomBuild 2.0, we continue to step 3 to check the version of PCRE installed on your server and the latest release on DirectAdmin you can upgrade.
Step 3: Check the PCRE version on the DirectAdmin server
To check the PCRE version being used on the DirectAdmin server, you use the following command:
# sh /usr/local/directadmin/custombuild/build versions | grep PCRE Hoặc # cd /usr/local/directadmin/custombuild/ # ./build versions | grep PCRE
Here are the results on my server. Below are the results on my server; the version PCRE uses is 8.20
and the newer version that can be updated is 8.44
.
After knowing that the version we are using is the old version, we continue to step 4 to upgrade the PCRE library on DirectAdmin.
If you are interested in looking through the changes of each PCRE version, you can check it out at the following link:
Step 4: Commands to upgrade the PCRE library on DirectAdmin
To upgrade the PCRE library on DirectAdmin, run the following 3 commands:
cd /usr/local/directadmin/custombuild/ ./build update ./build pcre
Explanation of the above commands:
- Command 1: Move to the
custombuild
folder. - Command 2: Update
custombuild script
. - Command 3: Upgrade
PCRE
to the latest version.
Below is the image after I finished running the last command:
Now you can recheck the PCRE version as in step 3 and you will see that the PCRE version has been upgraded.
III. Summary
If you are administering a server with a dev team that regularly uses the Perl programming language, upgrading the PCRE library on DirectAdmin is extremely necessary.
Hope this article will be of help to you. Wishing you success!
See more useful articles about DirectAdmin at the following link:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com .
- Website AZDIGI: https://azdigi.com/