在redhat7上安裝openresty時,出現很多奇奇怪怪的問題,步驟是按照官網的來的,但幾乎每一步都有或多或少的問題,我尋思着,我之前在自己服務器上安裝時也沒見這么難受,怎么換了服務器就如此天壤之別了呢?
簡單記錄一下自己的問題。
這里有篇博客總結得還挺全的,有需要的可以參考
https://blog.csdn.net/fouy_yun/article/details/78314486
剛好自己遇到一個問題就是:./configure: error: ngx_postgres addon was unable to detect version of the libpq library.
找到的資料提示是需要
yum install postgresql-devel
執行后發現,一直提示error nothing to do
一看執行yum install有提示:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
我就以為是這個問題,准備一頓操作換一下yum 源,但是發現早就有人換了163的,難不成還要要換成其他的?於是我把yum源換成了阿里雲的,最后還是不行,思來想去,不就是要安裝一個postgresql-9.2.24-1.el7_5 嗎,勞資wget下來再弄不行嗎?
好不容易wget了postgresql-9.2.24-1.el7_5.src.rpm下來,接下來就是安裝的問題了,https://blog.csdn.net/weixin_33724570/article/details/92154288,參考了這里的操作,還有這篇:https://www.cnblogs.com/saolv/p/9751126.html
我以為即將守得雲開見月明了,誰知,一頓操作猛如虎,一看戰績0-5,還缺依賴,而且還特么的不少
perl(ExtUtils::MakeMaker) is needed by postgresql-9.2.24-1.el7.x86_64 help2man is needed by postgresql-9.2.24-1.el7.x86_64 perl(ExtUtils::Embed) is needed by postgresql-9.2.24-1.el7.x86_64 perl-devel is needed by postgresql-9.2.24-1.el7.x86_64 readline-devel is needed by postgresql-9.2.24-1.el7.x86_64 python-devel is needed by postgresql-9.2.24-1.el7.x86_64 tcl-devel is needed by postgresql-9.2.24-1.el7.x86_64 openldap-devel is needed by postgresql-9.2.24-1.el7.x86_64 uuid-devel is needed by postgresql-9.2.24-1.el7.x86_64 libxml2-devel is needed by postgresql-9.2.24-1.el7.x86_64 libxslt-devel is needed by postgresql-9.2.24-1.el7.x86_64 pam-devel is needed by postgresql-9.2.24-1.el7.x86_64 systemtap-sdt-devel is needed by postgresql-9.2.24-1.el7.x86_64
用 yum install還是特么的 error:nothing to do,惡狠狠地說了一聲:“shift!”
准備放棄了,放棄之前想着,怎么的也應該把yum 源給人家恢復到原來的先吧,於是百度:如何將yum 源該為163的。
又是一頓操作,突然發現/etc/yum.repos.d 目錄下多了一個openresty.repo 文件,接着就是yum clean all ,yum makecache之類的操作,其實內心很慌,弄壞了別人的配置怎么辦。
操作完后,我發現,之前
yum install postgresql-devel
一直報錯,現在居然可以用了?what the heal?
不能確定原因是什么,難道是那個 openresty.repo?
我忘了沒有弄openresty前,openresty.repo 這個文件是不是已經存在了(按理來說應該是沒有的),推測應該是和它有關,很迷,如果你看到了這,且知道原因,希望可以不吝賜教,為小弟指點迷津。