关于nginx:Linux系统下安装Nginx

用超级治理身份操作

# 下载安装包
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.gz
cd nginx-1.12.2/
# 执行配置
./configure
# 编译装置(默认装置在/usr/local/nginx)
make
make 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地址,呈现以下页面示意拜访胜利。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理