admin管理员组文章数量:1608635
> 因为是问题、花时间、所以进行记录一番
(一)安装环境:虚拟机centos7系统
对于nginx在linux下的安装卸载是装了又卸,卸了又装。远程访问就是访问不了,周五的时候能访问,到后面又不能访问了。其实这里可以有些方法的。
(二)验证nginx是否安装成功
首先根据这篇文章进行安装,使用源的方式安装:
centos7安装nginx
(三)本地机器测试nginx是否能正常启动
所谓的本地机器,就是你安装了nginx软件的那一台机器,输入命令:
curl http://192.168.241.129/
这里的ip地址为你本机的ip地址
然后会有结果:
[root@localhost nginx-1.12.1]# curl http://192.168.241.129/
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx/">nginx</a>.<br/>
Commercial support is available at
<a href="http://nginx/">nginx</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
[root@localhost nginx-1.12.1]#
以上验证了本地是已经安装成功的了,
但是我们远程访问的时候就是访问不了,一直说拒绝访问,那就是可能真的跟端口,防火墙有关了。
(四)防火墙、端口开启设置
打开80端口:
版权声明:本文标题:linux下nginx首次安装远程无法访问 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1728550660a1163390.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论