在redhat7上安裝openresty時,出現不少奇奇怪怪的問題,步驟是按照官網的來的,但幾乎每一步都有或多或少的問題,我尋思着,我以前在本身服務器上安裝時也沒見這麼難受,怎麼換了服務器就如此天壤之別了呢?html
簡單記錄一下本身的問題。python
這裏有篇博客總結得還挺全的,有須要的能夠參考sql
https://blog.csdn.net/fouy_yun/article/details/78314486服務器
恰好本身遇到一個問題就是:./configure: error: ngx_postgres addon was unable to detect version of the libpq library.post
找到的資料提示是須要ui
yum install postgresql-devel
執行後發現,一直提示error nothing to do 阿里雲
一看執行yum install有提示:spa
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register..net
我就覺得是這個問題,準備一頓操做換一下yum 源,可是發現早就有人換了163的,難不成還要要換成其餘的?因而我把yum源換成了阿里雲的,最後仍是不行,思來想去,不就是要安裝一個postgresql-9.2.24-1.el7_5 嗎,勞資wget下來再弄不行嗎?rest
好不容易wget了postgresql-9.2.24-1.el7_5.src.rpm下來,接下來就是安裝的問題了,https://blog.csdn.net/weixin_33724570/article/details/92154288,參考了這裏的操做,還有這篇:http://www.javashuo.com/article/p-ggazphyt-nt.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 這個文件是否是已經存在了(按理來講應該是沒有的),推測應該是和它有關,很迷,若是你看到了這,且知道緣由,但願能夠不吝賜教,爲小弟指點迷津。