mysql 升級 openssl_【1分鐘教程】LNMP架構應用實戰 Openssl升級操作

由于實際生產環境需求,需要將LNMP環境中的openssl版本升級至目前最新版本openssl-1.1.0c,這玩意升級還真的不是一般的麻煩,由于它與系統各種服務都有相關的聯系,比如ssh服務等,因此,升級非常的繁瑣,所以今天將實際生產環境中升級的過程寫出來,供大家參考(100%生產環境)

1、整體環境

系統環境

[root@webserver ~]# **cat /etc/redhat-release**

CentOS release 6.5 (Final)

[root@webserver ~]# **uname -r**

2.6.32-431.el6.x86_64

LNMP版本

[root@webserver ~]# /application/nginx/sbin/nginx -v

nginx version: nginx/1.10.1

[root@webserver ~]# /application/mysql/bin/mysql -V

/application/mysql/bin/mysql ?Ver 14.14 Distrib 5.5.54, for Linux (x86_64) using ?EditLine wrapper

使用PHP 5.x 版本一直沒有升級成功,后面會介紹更高版本

2、LNMP環境編譯過程

nginx、mysql全部手工編譯安裝的,下面給出相關參數

nginx編譯過程:

[root@centos6 nginx-1.10.1]# ./configure --user=nginx \

--group=nginx --prefix=/application/nginx-1.10.1 \

--with-http_stub_status_module --with-http_ssl_module \

--with-pcre=/download/pcre-8.38

[root@centos6 nginx-1.10.1]# make && make install

[root@centos6 nginx-1.10.1]# ln -s /application/nginx-1.10.1 /application/nginx

[root@centos6 nginx-1.10.1]# /application/nginx/sbin/nginx

[root@centos6 nginx-1.10.1]# lsof -i :80

COMMAND ? PID ?USER ? FD ? TYPE DEVICE SIZE/OFF NODE NAME

nginx ? 16237 ?root ? ?6u ?IPv4 ?31404 ? ? ?0t0 ?TCP *:http (LISTEN)

nginx ? 16238 nginx ? ?6u ?IPv4 ?31404 ? ? ?0t0 ?TCP *:http (LISTEN)

[root@centos6 nginx-1.10.1]# cd ../

mysql編譯過程:

[root@centos6 download]# tar zxf cmake-2.8.8.tar.gz

[root@centos6 download]# cd cmake-2.8.8

[root@centos6 cmake-2.8.8]# useradd -s /sbin/nologin -M mysql

[root@centos6 cmake-2.8.8]# ./configure

CMake has bootstrapped. ?Now run gmake.

[root@centos6 cmake-2.8.8]# gmake

[root@centos6 cmake-2.8.8]# gmake install

[root@centos6 cmake-2.8.8]# cd ../

[root@centos6 download]# tar zxf mysql-5.5.54.tar.gz

[root@centos6 download]# cd mysql-5.5.54

[root@centos6 mysql-5.5.54]# cmake \

-DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.54 \

-DNYSQL_DATADIR=/application/mysql-5.5.54/data \

-DNYSQL_UNIX_ADDR=/application/mysql-5.5.54/tmp/mysql.sock \

-DDEFAULT_CHARSET=gbk \

-DDEFAULT_COLLATION=gbk_chinese_ci \

-DENABLED_LOCAL_INFILE=ON \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_FEDERATED_STORAGE_ENGINE=1

[root@centos6 mysql-5.5.54]# make

[root@centos6 mysql-5.5.54]# make install

[root@centos6 mysql-5.5.54]# ln -s /application/mysql-5.5.54 /application/mysql

[root@centos6 mysql-5.5.54]# cp support-files/my-small.cnf /etc/my.cnf

cp: overwrite `/etc/my.cnf'? y

[root@centos6 mysql-5.5.54]# echo 'export PATH=/application/mysql/bin:$PATH'>>/etc/profile

[root@centos6 mysql-5.5.54]# source /etc/profile

[root@centos6 mysql-5.5.54]# tail -1 /etc/profile

export PATH=/application/mysql/bin:$PATH

[root@centos6 mysql-5.5.54]# which mysql

/application/mysql/bin/mysql

[root@centos6 mysql-5.5.54]# mkdir -p /application/mysql/data

[root@centos6 mysql-5.5.54]# chown -R mysql.mysql /application/mysql/data

[root@centos6 mysql-5.5.54]# chmod -R 1777 /tmp

[root@centos6 mysql-5.5.54]# /application/mysql/scripts/mysql_install_db

--basedir=/application/mysql

--datadir=/application/mysql/data --user=mysql

[root@centos6 mysql-5.5.54]# cp support-files/mysql.server /etc/init.d/mysqld

[root@centos6 mysql-5.5.54]# chmod 700 /etc/init.d/mysqld

[root@centos6 mysql-5.5.54]# /etc/init.d/mysqld start

Starting MySQL.Logging to '/application/mysql-5.5.54/data/centos6.5.err'.

. SUCCESS!

[root@centos6 mysql-5.5.54]# lsof -i :3306

COMMAND ? PID ?USER ? FD ? TYPE DEVICE SIZE/OFF NODE NAME

mysqld ?61589 mysql ? 10u ?IPv4 114206 ? ? ?0t0 ?TCP *:mysql (LISTEN)

[root@centos6 mysql-5.5.54]# mysql

Welcome to the MySQL monitor. ?Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.5.54 Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit

Bye

[root@centos6 mysql-5.5.54]# chkconfig mysqld

[root@centos6 mysql-5.5.54]# cd ../

3、升級OPENSSL

[root@centos6 download]# tar zxf openssl-1.1.0c.tar.gz

[root@centos6 download]# cd openssl-1.1.0c

[root@centos6 openssl-1.1.0c]# ./config --prefix=/usr/local/openssl shared zlib-dynamic

[root@centos6 openssl-1.1.0c]# make

[root@centos6 openssl-1.1.0c]# make install

[root@centos6 openssl-1.1.0c]# cd ../

4、安裝PHP所需庫文件

[root@centos6 download]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.7.tar.gz

[root@centos6 download]# tar zxf libiconv-1.7.tar.gz

[root@centos6 download]# cd libiconv-1.7

[root@centos6 libiconv-1.7]# ./configure --prefix=/usr/local/libiconv

[root@centos6 libiconv-1.7]# make && make install

[root@centos6 libiconv-1.7]# cd ../

[root@centos6 download]# wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz

[root@centos6 download]# tar zxf libmcrypt-2.5.7.tar.gz

[root@centos6 download]# cd libmcrypt-2.5.7

[root@centos6 libmcrypt-2.5.7]# ./configure

[root@centos6 libmcrypt-2.5.7]# make && make install

[root@centos6 libmcrypt-2.5.7]# /sbin/ldconfig

[root@centos6 libmcrypt-2.5.7]# cd ?libltdl/

[root@centos6 libltdl]# ./configure --enable-ltdl-install

[root@centos6 libltdl]# make

[root@centos6 libltdl]# make install

[root@centos6 libltdl]# cd ../../

[root@centos6 download]# wget http://download.csdn.net/tag/mhash-0.9.9.9.tar.gz

[root@centos6 download]# tar zxf mhash-0.9.9.9.tar.gz

[root@centos6 download]# cd mhash-0.9.9.9

[root@centos6 mhash-0.9.9.9]# ./configure

[root@centos6 mhash-0.9.9.9]# make

[root@centos6 mhash-0.9.9.9]# make install

[root@centos6 mhash-0.9.9.9]# cd ../

[root@centos6 download]# rm -f /usr/lib/libmcrypt.\*

[root@centos6 download]# rm -f /usr/lib/libmhash\*

[root@centos6 download]# ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la

[root@centos6 download]# ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so

[root@centos6 download]# ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4

[root@centos6 download]# ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8

[root@centos6 download]# ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a

[root@centos6 download]# ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la

[root@centos6 download]# ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so

[root@centos6 download]# ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2

[root@centos6 download]# ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

[root@centos6 download]# ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

[root@centos6 download]# rm -f /usr/lib64/libmcrypt.\*

[root@centos6 download]# rm -f /usr/lib64/libmhash\*

[root@centos6 download]# ln -s /usr/local/lib64/libmcrypt.so /usr/lib64/libmcrypt.so

[root@centos6 download]# ln -s /usr/local/lib64/libmcrypt.la /usr/lib64/libmcrypt.la

[root@centos6 download]# ln -s /usr/local/lib64/libmcrypt.so.4 /usr/lib64/libmcrypt.so.4

[root@centos6 download]# ln -s /usr/local/lib64/libmcrypt.so.4.4.8 /usr/lib64/libmcrypt.so.4.4.8

[root@centos6 download]# ln -s /usr/local/lib64/libmhash.a /usr/lib64/libmhash.a

[root@centos6 download]# ln -s /usr/local/lib64/libmhash.la /usr/lib64/libmhash.la

[root@centos6 download]# ln -s /usr/local/lib64/libmhash.so /usr/lib64/libmhash.so

[root@centos6 download]# ln -s /usr/local/lib64/libmhash.so.2 /usr/lib64/libmhash.so.2

[root@centos6 download]# ln -s /usr/local/lib64/libmhash.so.2.0.1 /usr/lib64/libmhash.so.2.0.1

[root@centos6 download]# ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

[root@centos6 download]# wget http://download.csdn.net/tag/mcrypt-2.6.8.tar.gz

[root@centos6 download]# tar zxf mcrypt-2.6.8.tar.gz

[root@centos6 download]# cd mcrypt-2.6.8

[root@centos6 mcrypt-2.6.8]# /sbin/ldconfig

[root@centos6 mcrypt-2.6.8]# ./configure

[root@centos6 mcrypt-2.6.8]# make

[root@centos6 mcrypt-2.6.8]# make install

[root@centos6 mcrypt-2.6.8]# cd ../

5、編譯PHP

[root@centos6 download]# wget http://mirrors.sohu.com/php/php-7.1.0.tar.gz

[root@centos6 download]# tar zxf php-7.1.0.tar.gz

[root@centos6 php-7.1.0]#?./configure ?--prefix=/application/php-7.1.0

--with-config-file-path=/application/php-7.1.0/etc

--enable-fpm --enable-mbstring --enable-zip

--enable-bcmath --enable-pcntl --enable-ftp

--enable-intl --enable-exif --enable-calendar

--enable-sysvmsg --enable-sysvsem

--enable-sysvshm --enable-wddx --with-curl

--with-mcrypt --with-iconv --with-gd

--with-jpeg-dir=/usr --with-png-dir=/usr

--with-zlib-dir=/usr --with-xpm-dir=/usr

--with-freetype-dir=/usr --enable-gd-native-ttf

--enable-gd-jis-conv --with-gettext=/usr

--with-zlib=/usr --with-bz2=/usr

--with-recode=/usr --with-mysql

--with-mysqli --with-pdo-mysql**

--enable-sockets --disable-ipv6**

--with-fpm-user=nginx ?--with-fpm-group=nginx

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

[root@centos6 php-7.1.0]# make

[root@centos6 php-7.1.0]# make install

[root@centos6 php-7.1.0]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

[root@centos6 php-7.1.0]# chmod 700 /etc/init.d/php-fpm

[root@centos6 php-7.1.0]# cp /application/php-7.1.0/etc/php-fpm.conf.default /application/php-7.1.0/etc/php-fpm.conf

[root@centos6 php-7.1.0]# cp /application/php-7.1.0/etc/php-fpm.d/www.conf.default /application/php-7.1.0/etc/php-fpm.d/www.conf.defau

[root@centos6 php-7.1.0]# cp /application/php-7.1.0/etc/php-fpm.d/www.conf.default /application/php-7.1.0/etc/php-fpm.d/www.conf.defa

[root@centos6 php-7.1.0]# cp /application/php-7.1.0/etc/php-fpm.d/www.conf.default /application/php-7.1.0/etc/php-fpm.d/www.conf

[root@centos6 php-7.1.0]# /etc/init.d/php-fpm start

[root@centos6 php-7.1.0]# ps -ef|grep php

root ? ? ?98304 ? ? ?1 ?0 00:04 ? ? ?00:00:00 php-fpm: master process (/application/php-7.1.0/etc/php-fpm.conf)

nginx ? ? 98305 ?98304 ?0 00:04 ? ? ? ? ?00:00:00 php-fpm: pool www

nginx ? ? 98306 ?98304 ?0 00:04 ? ? ? ? ?00:00:00 php-fpm: pool www

root ? ? ?98308 ? 1265 ?0 00:04 pts/0 ? ?00:00:00 grep php

6、查看phpinfo信息

沒升級這前openssl 的版本是

openssl-1.0.1e-48.el6_8.3.x86_64

升級之后查看下phpinfo的信息

dd4907ac1b90d77ed82f0ab1fb5dffc0.png

目前官網最新版本,升級成功

之前一直升級不成功就是因為php無法識別這個最新版本,phpinfo信息里仍然是舊版本,后面采用升級PHP 版本,才升級成功.

文章雖然是一篇舊文,現在的版本肯定用的比這個新了,但是,只是給大家提供一個思路,這里還建議大家慎重升級openssl版本,除非有必要,我們當時升級是因為與某廠有個視頻類的合作,必須升級它,否則無法對接API。

歡迎大家點贊、轉發分享支持

更多技術干貨文章、技術資源分享,職場面試等,請關注民工哥技術之路微信公眾號

abb2cd39c89211ffe3f9ca4bd5bfdc73.png

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/532063.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/532063.shtml
英文地址,請注明出處:http://en.pswp.cn/news/532063.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

miui秒解bl鎖_MIUI12解鎖bl篇(原諒我的過失,接上篇文章)

求原諒真心求原諒由于我的疏忽,上期教程不完整,對大家造成不便在這里給大家真誠道歉!對不起!請收下我的膝蓋!!!我的上個教程小米手機MIUI系統降級任意版本通用教程,MIUI12→MIUI9因為…

腐蝕rust服務器命令_【使用 Rust 寫 Parser】2. 解析Redis協議

系列所有文章https://zhuanlan.zhihu.com/p/115017849?zhuanlan.zhihu.comhttps://zhuanlan.zhihu.com/p/139387293?zhuanlan.zhihu.comhttps://zhuanlan.zhihu.com/p/146455601?zhuanlan.zhihu.comhttps://zhuanlan.zhihu.com/p/186217695?zhuanlan.zhihu.com在基本熟悉 n…

python中dic_python之dic {字典}(重要指數*****)

1. 什么是字典{name: 汪峰, age: 18} 鍵:值 別的語言鍵值對數據鍵: 必須是可哈希(不可變的數據類型),并且是唯一的值: 任意可以保存任意類型的數據字典是無序的python3.6版本以上,默認定義了順序,python3.5以下是隨機顯示不能進?切片?作. 它只能通過key來獲取dict中的數據字典…

python裝飾器帶參數函數二階導數公式_一文搞定Python裝飾器,看完面試不再慌

本文始發于個人公眾號:TechFlow,原創不易,求個關注今天是Python專題的第12篇文章,我們來看看Python裝飾器。一段囧事差不多五年前面試的時候,我就領教過它的重要性。那時候我Python剛剛初學乍練,看完了廖雪…

centos7源碼安裝mysql報錯_CentOS7 下源碼安裝MySQL數據庫 8.0.11

本文主要向大家介紹了CentOS7 下源碼安裝MySQL數據庫 8.0.11,通過具體的內容向大家展現,希望對大家學習MySQL數據庫有所幫助。CentOS7 下源碼安裝MySQL 8.0.11系統環境:CentOS7, 內核:Linux 3.10.0-862.el7.x86_64如果…

python全排列問題_Python基于回溯法子集樹模板解決全排列問題示例

本文實例講述了Python基于回溯法子集樹模板解決全排列問題。分享給大家供大家參考,具體如下:問題實現 a, b, c, d 四個元素的全排列。分析這個問題可以直接套用排列樹模板。不過本文使用子集樹模板。分析如下:一個解x就是n個元素的一種排列&a…

file js new 傳到后臺_js 圖片上傳傳給后臺的3種格式

$("#imgfile").change(function () {var formData new FormData();$.each($(#imgfile)[0].files, function (i, file) {formData.set(idcard, file); //idcard 字段 根據自己后端接口定});//processData: false, contentType: false,多用來處理異步上傳二進制文件。…

usbserialcontroller驅動安裝不了_win10-有NVIDIA獨顯提示未安裝控制面板的離線安裝方式...

最近越來越多的用戶反映NVIDIA顯卡驅動設置不了啦,找不到NVIDIA顯卡的控制面板。 也不知道NVIDIA在什么版本開始驅動安裝包就不自帶NVIDIA顯卡控制面板了。 全新安裝的顯卡驅動就沒有控制面板;或者Windows 10自帶更新了顯卡新版驅動后導致沒有。 每次帶N…

mysql 多實例 獨立配置文件_三、安裝配置多實例MYSQL5.6-多獨立配置文件方法

三、安裝配置多實例MYSQL5.6-多獨立配置文件方法1、準備工作檢查操作系統版本、內核版本、selinux是否關閉、防火墻策略、IP地址、主機名配置、host表配置、yum配置上傳cmake、mysql5.6軟件包具體步驟參考源碼安裝mysql-單實例配置文檔2、安裝cmake軟件2.1 安裝編譯軟件環境[[e…

python做什么模型_主題模型初學者指南[Python]

引言近年來涌現出越來越多的非結構化數據,我們很難直接利用傳統的分析方法從這些數據中獲得信息。但是新技術的出現使得我們可以從這些輕易地解析非結構化數據,并提取出重要信息。主題模型是處理非結構化數據的一種常用方法,從名字中就可以看…

python實現隊列_Python學習教程:用隊列實現棧

接著上一期跟大家說的用棧實現隊列,這期的Python學習教程跟大家講用隊列實現棧題目:使用隊列實現棧的下列操作:push(x) – 元素 x 入棧pop() – 移除棧頂元素top() – 獲取棧頂元素empty() – 返回棧是否為空Implement the following operati…

vue 點擊li 中的img 怎么不冒泡_Vue全解

一.Vue實例內存圖:1.把Vue的實例命名為vm,vm對象封裝了對視圖的所有操作包括數據讀寫、事件綁定、DOM更新2.vm的構造函數是Vue,按照ES6的說法vm所屬的類是Vue3.options是new Vue的參數一般稱為選項或構造選項1.options里面有什么英文文檔搜op…

python布局管理_Python基礎=== Tkinter Grid布局管理器詳解

本文轉自:https://www.cnblogs.com/ruo-li-suo-yi/p/7425307.html 箬笠蓑衣Grid(網格)布局管理器會將控件放置到一個二維的表格里。主控件被分割成一系列的行和列,表格中的每個單元(cell)都可以放置一個控件。注意:不要試圖在一個主…

python面向對象類_python面向對象-類和對象

一. 類的定義class類名():代碼#定義類classWasher():defwash(self):print("洗衣服")注意:類名要滿足標識符命名規則,同時遵循大駝峰命名習慣。二. 創建對象對象名 類名()#創建對象w Washer()#調用方法w.wash() #洗衣服三. selfself指的是調用…

vant部署_vant ui rem配置流程

參考地址 https://www.cnblogs.com/WQLong/p/7798822.html1.下載lib-flexible使用的是vue-cliwebpack,通過npm來安裝的npm i lib-flexible --save2.引入lib-flexible在main.js中引入lib-flexibleimport ‘lib-flexible/flexible‘3.設置meta標簽通過meta標簽&#…

terminal services 找不到_電腦局域網中查看不到其他計算機或無法連接的解決辦法...

在辦公環境中,電腦經常需要打開網絡,進行一些文件共享的操作,但是有時會出現很多無法共享的情況,之前有一篇文章講過解決辦法,今天再來將一下具體無法共享的錯誤提示和相對應的處理方法,主要有以下幾種情況…

如何避免mysql回表查詢_mysql如何避免回表查詢

《迅猛定位低效SQL?》留了一個尾巴:select id,name where name‘shenjian‘select id,name,sexwhere name‘shenjian‘多查詢了一個屬性,為何檢索過程完全不同?什么是回表查詢?什么是索引覆蓋?如何實現索引…

python爬蟲開發數據庫設計入門經典_Python3實現的爬蟲爬取數據并存入mysql數據庫操作示例...

本文實例講述了Python3實現的爬蟲爬取數據并存入mysql數據庫操作。分享給大家供大家參考,具體如下:爬一個電腦客戶端的訂單。羅總推薦,抓包工具用的是HttpAnalyzerStdV7,與chrome自帶的F12類似。客戶端有接單大廳,羅列…

python中multiply函數_python中numpy庫內multiply()、dot()和 * 三種乘法運算的區別小計...

首先,導入函數包:import numpy as np1.np.multiply()函數:數組:(點對點)對應位置元素相乘矩陣:對應位置元素相乘示例:A np.array([[1,2],[3,4]])B np.array([[1,3],[2,4]])A_mat np.mat(A)B_mat np.mat(B)A_B_mult…

安裝python3.6.1_如何安裝python3.6.1/

如何在win7下安裝Python及配置1、首先,從搜索python官載適合自己電腦python版本。2標右擊桌面“計算機”擇打開菜單欄中的性”。3、WindowsXP時,在新彈出的屬性窗口,選擇“高級”->“環境變量”。Windows7是,在新彈出的屬性窗口…