VPS侦探论坛

 找回密码
 注册
查看: 3708|回复: 4

lnmp vhost add 一个 二级 域名 为什么访问还是IP

[复制链接]
发表于 2018-6-28 22:28:45 | 显示全部楼层 |阅读模式

lnmp vhost add 一个 二级域名

回车 输入 bbs.sxxxxxx.cc
之后 输入 /home/wwwroot/default/bbs
回车到最后 也好像建立成功了
目录下也有bbs这个目录了
但是用域名访问 还是首页的IP 不会访问到BBS 这个目录是什么原因啊军哥
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2018-6-29 09:30:34 | 显示全部楼层


添加的虚拟主机域名显示默认页面一般就这几种情况:
改域名添加了多次
配置文件出错
域名指向默认虚拟主机目录
改域名指定的目录下面的index文件是默认的index文件
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2018-6-29 09:42:56 | 显示全部楼层

index 是我自己修改的 里面的内容是 asdfsdafsdafdsfsdfa

域名指向应该是新建立的 bbs 目录 因为 在虚拟机添加成功的界面 域名部分是 bbs.sadfsda.cc
文件加 文件地址也是 bbs  

至于配置文件出错  军哥 配置文件在哪里 我怎么找到并修改下 谢谢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2018-6-29 13:05:33 | 显示全部楼层



server
    {
        listen 80;
        #listen [::]:80;
        server_name bbs.sadfdsfadfs.com ;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/default/bbs;

        include rewrite/other.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;
    }
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2018-6-29 20:19:37 | 显示全部楼层

回复 4# 的帖子


单纯只看这个配置文件没有问题,反馈必读有测试配置文件的命令

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-23 23:34 , Processed in 0.026673 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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