nginx安装踩坑记录

nginx官网下载
解压
tar -zxvf nginx-1.6.2.tar.gz
cd到解压目录下运行./configure进行初始化配置
nginx安装踩坑记录安装出现提示,说明该机器没有安装PCRE,而Nginx需要依赖PCRE,需要手动安装PCRE
使用tar -zxvf pcre-8.36.tar.gz进行解压。
切换到/pcre-8.36目录下,运行 ./configure 进行pcre初始化配置,会在控制台打印出一大堆的输出信息。
执行make操作,进行编译。
make install,进行安装,至此PCRE安装完成。
非root用户安装可能会出现某些文件夹权限不足,使用以下命令对文件夹进行授权
chown -R 用户名:用户名 文件夹路径
chmod -R u+x 文件夹路径
出现以下字符说明还缺少zlib
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib= option.
zlib贴个连接
解压tar -xzvf zlib-1.2.11.tar.gz
安装
./configure
make
make install
再去./configure进行初始化
nginx安装踩坑记录
箭头所指的方向是启动nginx路径
执行make
运行 make install 进行编译
切换到箭头所指nginx运行目录下,运行./nginx,启动Nginx。
参考文章1
参考文章2