Nginx问题总结
1、./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
64位 linux pcre链接问题
解决方法:ln -s /usr/local/lib/libpcre.so.1 /lib64/
2、本地主机无法访问linux 开启的Nginx
解决方法:vim /etc/sysconfig/iptables 添加一行代码-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
service iptables restart
3、如何部署Nginx上面静态图片服务器
解决办法:vim /usr/local/nginx/conf/nginx.conf
(1)添加如下配置
location ~ .*\.(gif|jpg|jpeg|png)$ {
root /home/ftpuser/;
access_log /home/ftpuser/images/images.log;
}
(2) 修改该路径下用户的权限
chmod 777 /home/ftpuser
(3)重启Nginx
./nginx -s reload