nginx源码安装记事

nginx也安装更新了几次了,在此闲啰嗦几句,首先我不是什么linux教主,因为我觉得比方说ubuntu的图形化界面做的挺好的了,能用鼠标的地方我从来不敲键盘。现在看来明明这就是自己水平太凹给自己找借口,一登陆远程服务器由于命令记得不熟效率马上就下来了。

1. 打算源码安装1.6。没有先看看服务器之前已经安装了哪些库,就直接配置了。
./configure肯定报错,看看报什么错,说是缺少pcre库.

错误如下
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre= option.
仔细阅读其实可以不用安装,--with-pcre= option, 这option改为源码的地址即可


2.make 时有出错了,说缺少c++支持,于是运行命令 sudo apt-get install build-essential(现在现在不晓得是不是这个地方不合适)


3. 这下问题大了,一make就出下面错误,
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/user/Downloads/pcre-8.36/missing aclocal-1.14 -I m4
/home/user/Downloads/pcre-8.36/missing: line 81: aclocal-1.14: command not found
WARNING: 'aclocal-1.14' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [aclocal.m4] Error 127


4. 纠结了好久,求leo大神帮助,于是切个频道,换方法安装,还是apt-get比较靠谱。但考虑到要装新版本,先更新源。
add-apt-repository ppa:nginx/stable

apt-get update

5. 安装时推荐aptitude替代apt-get,还可以install前先aptitude show nginx 查看版本

猜你喜欢

转载自blog.csdn.net/cscj2010/article/details/40976767