Method of installing OpenSSL with source code on Linux system

Time:2021-11-22

Download OpenSSL version 1.0.1g first. The command is as follows:

   

Copy code

The code is as follows:

#wget -c https://www.openssl.org/source/openssl-1.0.1g.tar.gz

Download the MD5 verification package of this version:

   

Copy code

The code is as follows:

#wget -c https://www.openssl.org/source/openssl-1.0.1g.tar.gz.md5

Then verify whether the OpenSSL package under has been maliciously modified:

   

Copy code

The code is as follows:

#md5sum openssl-1.0.1g.tar.gz | awk ‘{print $1;}’ | cmp – openssl-1.0.1g.tar.gz.md5

If the verification is OK, then unzip the package. The command is:

   

Copy code

The code is as follows:

#Tar -zvxf openssl-1.0.1g.tar.gz / / unzip openssl-1.0.1g.tar.gz

Enter the extracted Directory:

   

Copy code

The code is as follows:

#cd openssl-1.0.1g

Enter the following command to compile and install. I directly set some important parameters, because other parameters are useless to me. If you need parameters, you can add them yourself. Input:

   

Copy code

The code is as follows:

#./config shared zlib && make && make install

Or you don’t add any parameters and use the default:

   

Copy code

The code is as follows:

#./config && make && make install

It will be compiled and installed in about five or six minutes. If there is no problem, continue to enter the following command to manually soft link the new OpenSSL binary file:

   

Copy code

The code is as follows:

ln –s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln –s /usr/local/ssl/include/openssl /usr/include/openssl

Configuration library file search path:

   

Copy code

The code is as follows:

#echo “/usr/local/ssl/lib” >> /etc/ld.so.conf</p>
<p> #ldconfig -v

Finally, restart the server (the restart process is troublesome), enter:

   

Copy code

The code is as follows:

#reboot

After restarting, enter the following command to check the version of OpenSSL:

   

Copy code

The code is as follows:

#openssl version

Display:

   

Copy code

The code is as follows:

OpenSSL 1.0.1g 7 Apr 2014

  And whether the OpenSSL directory is specified when PHP is compiled. Let’s look directly at the PHP probe, which is <? php phpinfo(); ?> Save it to a.php and put it in the root directory of your website. Open the a.php file. Look at the columns displaying OpenSSL, as follows:

Copy code

The code is as follows:

openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL 1.0.1g 7 Apr 2014
OpenSSL Header Version OpenSSL 1.0.1g 7 Apr 2014

If it is not version 1.0.1g, recompile PHP. Specify the directory of OpenSSL.

You can use the following command to view the PHP version and compilation parameters:

Copy code

The code is as follows:

#PHP – V # view PHP version

Copy code

The code is as follows:

#/ usr / local / PHP / bin / PHP – I | grep configure # view the parameters used for PHP compilation

The compilation results displayed with this command are enclosed in single quotes and need to be deleted. At the same time, the — with OpenSSL   Replace with:

Copy code

The code is as follows:

–with-openssl=/usr/local/ssl/

Then recompile, but the compilation parameters change without changing the PHP version.

Because I use the military brother LNMP, I’m too lazy to download it myself. Upgrade directly with his PHP upgrade script_ php.sh   To recompile and install PHP. However, this upgrade script cannot be upgraded to the same version. When in use, it will display:

Copy code

The code is as follows:

#echo “Error: The upgrade PHP Version is the same as the old Version!!”

As long as

Copy code

The code is as follows:

if [ “$php_version” == “$old_php_version” ]; then
echo “Error: The upgrade PHP Version is the same as the old Version!!”
exit 1
fi
cho “==================================================”
echo “You want to upgrade php version to $php_version”
echo “==================================================”

Just # comment out these lines. Then enter the LNMP pressurized directory and execute:

Copy code

The code is as follows:

#sh upgrade_php.sh

Select the PHP version you want to upgrade.

Recommended Today

Apache sqoop

Source: dark horse big data 1.png From the standpoint of Apache, data flow can be divided into data import and export: Import: data import. RDBMS—–>Hadoop Export: data export. Hadoop—->RDBMS 1.2 sqoop installation The prerequisite for installing sqoop is that you already have a Java and Hadoop environment. Latest stable version: 1.4.6 Download the sqoop installation […]