1.安装C++编译器
sudo apt-get install build-essential
安装libtool
sudo apt-get intall libtool
安装openssl
sudo apt-get install openssl libssl-dev libperl-del
2.安装pcre [nginx不支持pcre2]
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
OR
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
# tar zxvf pcre-8.37.tar.gz
# cd pcre-8.01
# ./configure
# make
# sudo make install
{
安装前置工具完成后,需重新执行:
./configure
make
sudo make install
}
3.启动nginx时报错:
error while loading shared libraries: libpcre.so.1: cannot open shared object file:No such file or directory
解决:
sudo chmod a+rwx -R logs
sudo chmod a+rwx -R /usr/local/nginx
5.1024以下端口启动需要管理员权限报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
解决:
sudo apt-get install build-essential
安装libtool
sudo apt-get intall libtool
安装openssl
sudo apt-get install openssl libssl-dev libperl-del
2.安装pcre [nginx不支持pcre2]
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
OR
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
# tar zxvf pcre-8.37.tar.gz
# cd pcre-8.01
# ./configure
# make
# sudo make install
{
安装前置工具完成后,需重新执行:
./configure
make
sudo make install
}
3.启动nginx时报错:
error while loading shared libraries: libpcre.so.1: cannot open shared object file:No such file or directory
解决:
ln -s /usr/local/lib/libpcre.so.1 /lib64
OR
ln -s /usr/local/lib/libpcre.so.1 /lib
sudo chmod a+rwx -R logs
sudo chmod a+rwx -R /usr/local/nginx
5.1024以下端口启动需要管理员权限报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
解决:
sudo nginx
顺利完成!