用超级治理身份操作
# 下载安装包wget http://nginx.org/download/nginx-1.12.2.tar.gz# 装置依赖yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel# 解压缩tar -zxvf nginx-1.12.2.tar.gzcd nginx-1.12.2/# 执行配置./configure# 编译装置(默认装置在/usr/local/nginx)makemake install
nginx主配置文件:/usr/local/nginx/conf/nginx.conf
nginx日志文件:/usr/local/nginx/logs/access.log
启动Nginx:/usr/local/nginx/sbin/nginx
如果是VMware虚拟机Linux下装置Nginx,如何在本地window上拜访?
1、查看虚拟机的IP地址
[root@nginx nginx-1.18.0]# ifconfig
2、敞开防火墙
[root@localhost /]# cd ~[root@localhost ~]# service iptables stop[root@localhost ~]# chkconfig iptables off
3、Windows下关上浏览器,拜访刚刚查看的虚拟机的IP地址,呈现以下页面示意拜访胜利。