VPS侦探论坛

 找回密码
 注册
查看: 2866|回复: 3

按照教程配置虚拟机后无法访问

[复制链接]
发表于 2018-9-7 17:14:13 | 显示全部楼层 |阅读模式

军哥啊, 我在vmware虚拟机上 安装了lnmp1.4 在配置虚拟主机时候 用 lnmp vhost add 一步一步按照教程做的, 配置完后在浏览器上还是无法访问啊, 直接显示无法访问此网站, 默认的那个虚拟主机可以访问, 自己添加的就不可以呢, 是不是少了那个步骤了?
这是vhost里的配置
server    {
        listen 80;
        #listen [::]:80;
        server_name xds.demo.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/demo;

        include rewrite.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log off;
    }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2018-9-7 17:49:31 | 显示全部楼层

IP可以访问就是换成域名不能访问



用IP可以访问, 为啥换成域名就不能访问了呢.
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2018-9-8 09:56:28 | 显示全部楼层

内网的话你得改hosts将域名指向你虚拟机的ip
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2018-9-10 10:14:17 | 显示全部楼层

回复 3# 的帖子




OK! 问题已解决. 谢谢军哥
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-23 17:24 , Processed in 0.025677 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表