标签:not tab inf input alt mit filter recommend top
[root@centos ~]# yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
PCRE 作用是让 Nginx 支持 Rewrite 功能。
下载、解压、编译安装、查看版本
[root@centos ~]# cd /usr/local/src/ [root@centos src]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.44/pcre-8.44.tar.gz [root@centos src]# tar -zxvf pcre-8.44.tar.gz [root@centos src]# cd pcre-8.44 [root@centos pcre-8.44]# ./configure [root@centos pcre-8.44]# make && make install [root@centos pcre-8.44]# pcre-config --version 8.44
下载、解压、编译安装、查看版本、启动、访问
[root@centos src]# cd /usr/local/src/ [root@centos src]# wget http://nginx.org/download/nginx-1.14.2.tar.gz [root@centos src]# tar -zxvf nginx-1.14.2.tar.gz [root@centos src]# cd nginx-1.14.2 [root@centos nginx-1.14.2]# ./configure --with-pcre=/usr/local/src/pcre-8.44 [root@centos nginx-1.14.2]# make && make install [root@centos nginx-1.14.2]# cd /usr/local/nginx [root@centos nginx]# ./sbin/nginx -v nginx version: nginx/1.14.2 [root@centos nginx]# ./sbin/nginx [root@centos nginx]# ps -ef|grep nginx root 2291 1 0 17:04 ? 00:00:00 nginx: master process ./sbin/nginx nobody 2292 2291 0 17:04 ? 00:00:00 nginx: worker process root 2294 2266 0 17:04 pts/0 00:00:00 grep nginx
此时,输入ip:端口可以访问,访问之前要配置防火墙,开发80端口
[root@centos nginx]# vim /etc/sysconfig/iptables # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT [root@centos sbin]# service iptables restart
参考文档:https://www.runoob.com/linux/nginx-install-setup.html
标签:not tab inf input alt mit filter recommend top
原文地址:https://www.cnblogs.com/ddstudy/p/12547056.html