Updating to PCRE 8.33 or Higher

The process below describes how to update to PCRE 8.33 on an Ubuntu virtual server (instance) running on an Amazon AWS.

As of this date, the Ubuntu server will install PCRE 8.31. To update to 8.33 you will need to install a number of library packages necessary to compile new code. You will also need to know how to login as the root user.

Log In to Your Server
You will, of course, need to follow the Amazon AWS instructions for connecting with the server. One option is to download and install Git Bash and log-in to the server using your key.

If your Key.pem is in KeyDirectory those commands may look something like:

cd KeyDirectory

chmod 400 Key.pem

ssh -i "Key.pem" ubuntu@ec2-52-223-93-123.compute-1.amazonaws.com

If you successfully login, the prompt will show your path followed by $

Install Packages Needed to Compile PCRE 8.33
Cut and paste the following lines. They will all run in sequence. If there are any errors, you may need to run each install separately, as is done with the first three:

sudo apt-get install build-essential

sudo apt-get install checkinstall

sudo apt-get install automake

sudo apt-get install libbz2-1.0 libbz2-dev libbz2-ocaml libbz2-ocaml-dev

sudo apt-get install libreadline-dev

Download PCRE 8.33 or Higher
You can search for the latest package address, which may be higher than 8.33. The steps below include the address for the package as of this date, Make any required changes for a different version or package

sudo wget http://downloads.sourceforge.net/pcre/pcre-8.33.tar.gz

sudo tar -xvzf pcre-8.33.tar.gz

If the package extracts properly, you will see all the new contents in the directory pcre-8.33. To see directories, type in the command line: ls

Login as Root User
To recompile the package, you will first need to log in as the root user. These are the steps.


 * Enter the command: sudo passwd root.
 * This will prompt you to create a password for your root account. Make sure you don't forget it.
 * Enter the command sudo -i. You will be asked for your root password.
 * Your prompt will change from $ to #, indicating you have root access.
 * Enter the command cd .. to move to the root directory
 * Enter the command ls this should show you the directories and files in the root directory, including the new directory pcre-8.33

NOTE: To disable root access, enter the command  sudo passwd -dl root

Now Compile and Check the Code for PCRE 8.33
Run the following commands:

cd pcre-8.33 sudo ./configure --prefix=/usr \ --docdir=/usr/share/doc/pcre-8.33 \ --enable-utf \ --enable-unicode-properties \ --enable-pcre16 \ --enable-pcre32 \ --enable-pcregrep-libz \ --enable-pcregrep-libbz2 \ --enable-pcretest-libreadline \ --disable-static && make

Then test the make, with the command: make check

Next command:

make install &&  mv -v /usr/lib/libpcre.so.* /lib && ln -sfv ../../lib/$(readlink /usr/lib/libpcre.so) /usr/lib/libpcre.so

Then restart the server: sudo service apache2 restart

Remember to log out as root: sudo passwd -dl root