Install OpenSSL in Ubuntu

1. Preparation

1.1 Download compressed package

Before installing openssl, we need to download the corresponding compressed package
https://www.openssl.org/source/openssl-3.0.1.tar.gz

This compressed package can be downloaded from Windows, decompressed, and copied to the local virtual machine, or you can download it directly using the wget command in the local virtual machine. Of course, when using the wget command, we need to install wget first.

You can download the compressed package of openssl in Linux through the following command

wget https://www.openssl.org/source/openssl-3.0.1.tar.gz

After downloading, you need to unzip it and finally get the folder named openssl-3.0.1

1.2 Installation of gcc, make, etc.

Since compilation requires the use of gcc and make commands, gcc and make need to be installed first.

sudo apt-get install g++
sudo apt-get install make

2. Installation and configuration

After decompressing the compressed package and installing gcc and make, you need to enter the folder corresponding to openssl before proceeding.

cd openssl-3.0.1

Execute the following commands in the corresponding folder

./config

After the execution is completed, you will get the following information

Insert image description here
make -j32Then continue to execute and commands in the current directory make installto get the following results. The -j32 here refers to compilation with 32 threads, which is faster than traditional make.

Insert image description here

After the above two commands, the openssl command line file will be installed in /usr/local/binthe directory, the configuration file will be installed in /usr/local/sslthe directory, the header file will be installed in /usr/local/include/opensslthe directory, and the so library file will be in the /usr/local/libor /usr/local/lib64directory. See the figure below for specific results

so library file

Insert image description here

head File

Insert image description here

Guess you like

Origin blog.csdn.net/weixin_46841376/article/details/132348613