Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install OpenSSL with source code on Linux system

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to install OpenSSL with source code on the Linux system". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install OpenSSL with source code on the Linux system".

Download openssl version 1.0.1g first with the following command:

The code is as follows:

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

Then download this version of the md5 check package:

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 has been maliciously modified:

The code is as follows:

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

If there is no problem with the verification, then decompress the package and command:

The code is as follows:

# tar-zvxf openssl-1.0.1g.tar.gz / / decompress openssl-1.0.1g.tar.gz

Enter the unzipped directory:

The code is as follows:

# cd openssl-1.0.1g

Type the following command to compile and install, and I directly set some important parameters, because the other parameters are of no use to me at all. If you need parameters, just add them yourself. Enter:

The code is as follows:

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

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

The code is as follows:

#. / config & & make & & make install

Then it will be compiled and installed in about five or six minutes. If there is no problem, continue to enter the following command and manually softlink the new openssl binaries:

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

Configure the library file search path:

The code is as follows:

# echo "/ usr/local/ssl/lib" > > / etc/ld.so.conf

# ldconfig-v

Finally, restart the server (for troublesome restart processes), enter:

The code is as follows:

# reboot

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

The code is as follows:

# openssl version

Display:

The code is as follows:

OpenSSL 1.0.1g 7 Apr 2014

And whether the openssl directory is established when php compiles. Let's look at the php probe directly, save it to a.php, and then put it in the root directory of your website. Opening this a.php file. Look at the columns that show openssl, as follows:

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's not the 1.0.1g version, recompile php. Specifies the directory of the openssl.

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

The code is as follows:

# php-v # View php version

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 quotation marks and should be deleted. At the same time, change the-- with-openssl to:

The code is as follows:

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

Then recompile, except that the compilation parameters have changed, but the version of php has not been changed.

Because I used brother Jun lnmp, I didn't bother to download it myself. Directly use his php upgrade script upgrade_php.sh to recompile and install php. However, this upgrade script is not allowed to upgrade to the same version. When in use, it will be displayed:

The code is as follows:

# echo "Error: The upgrade PHP Version is the same as the old versionmakers!"

As long as the

The code is as follows:

If ["$php_version" = = "$old_php_version"]; then

Echo "Error: The upgrade PHP Version is the same as the old versionmakers!"

Exit 1

Fi

Cho "="

Echo "You want to upgrade php version to $php_version"

Echo "="

These lines can be commented out with #. Then go to the directory where lnmp is pressurized and execute:

The code is as follows:

# sh upgrade_php.sh

Choose the php version you want and you can upgrade it.

Thank you for reading, the above is the content of "how to install OpenSSL with source code on the Linux system". After the study of this article, I believe you have a deeper understanding of the problem of how to install OpenSSL with source code on the Linux system. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report