编译安装nginx需要pcre包,未安装会有如下提示:
<span class="pun">./<span class="pln">configure<span class="pun">:<span class="pln"> error<span class="pun">:<span class="pln"> the HTTP rewrite <span class="kwd">module<span class="pln"> requires the PCRE library<span class="pun">.<span class="pln"> <span class="typ">You<span class="pln"> can either disable the <span class="kwd">module<span class="pln"> <span class="kwd">by<span class="pln"> <span class="kwd">using<span class="pln"> <span class="pun">--<span class="pln">without<span class="pun">-<span class="pln">http_rewrite_module option<span class="pun">,<span class="pln"> <span class="kwd">or<span class="pln"> install the PCRE library <span class="kwd">into<span class="pln"> the system<span class="pun">,<span class="pln"> <span class="kwd">or<span class="pln"> build the PCRE library statically <span class="kwd">from<span class="pln"> the source <span class="kwd">with<span class="pln"> nginx <span class="kwd">by<span class="pln"> <span class="kwd">using<span class="pln"> <span class="pun">--<span class="kwd">with<span class="pun">-<span class="pln">pcre<span class="pun">=<<span class="pln">path<span class="pun">><span class="pln"> option<span class="pun">.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
需要安装pcre的devel包,pcre-devel。使用yum安装即可:(以下命令还带有ssl、zlib等依赖的安装)
<span class="pln">yum <span class="pun">-<span class="pln">y install zlib zlib<span class="pun">-<span class="pln">devel openssl openssl<span class="pun">--<span class="pln">devel pcre pcre<span class="pun">-<span class="pln">devel<br></span></span></span></span></span></span></span></span></span>