VPS侦探论坛

 找回密码
 注册
查看: 4046|回复: 13

浏览器输入域名怎么显示Server not found

[复制链接]
发表于 2017-2-22 10:39:08 | 显示全部楼层 |阅读模式

根据教程新建了个域名www.yl,net域名的目录在/home/wwwroot/下
然后我在/home/wwwroot/www.yl.net里新建了一个yl.html的文件
然后我在浏览器输入http://www.yl.net/yl
浏览器显示Server not found、
请问这是什么原因?通过教程新建的域名访问不了
按照以下方法也不行啊
13、安装好后,端口正常,Ping正常,但是无法通过IP或域名访问网站
解决方法:一般都是因为iptables引起的,可以通过yum或apt-get删除iptables,或/etc/init.d/iptables stop 停止iptables。如果想保留iptables可以按这里
清除原有iptables记录。
我的/etc/init.d下边没有iptables
我这个是在/usr/local/nginx/vhost/下的www.yl.net.conf
server
    {
        listen 80;
        #listen [::]:80;
        server_name www.yl.net;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/www.yl.net;

        include other.conf;
        #error_page   404   /404.html;
        include enable-php.conf;

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

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

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/www.yl.net.log;
    }

[ 本帖最后由 mgmg8787 于 2017-2-22 11:31 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-2-22 11:03:37 | 显示全部楼层


你应该把 /usr/local/apache/conf/www.yl.net.conf   或者  /usr/local/nginx/www.yl.net.conf  相关配置贴出来
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-2-22 11:19:20 | 显示全部楼层

回复 2# 的帖子


我这个是在/usr/local/nginx/vhost/下的www.yl.net.conf
server
    {
        listen 80;
        #listen [::]:80;
        server_name www.yl.net;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/www.yl.net;

        include other.conf;
        #error_page   404   /404.html;
        include enable-php.conf;

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

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

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/www.yl.net.log;
    }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-2-22 11:19:21 | 显示全部楼层



配置貌似没啥问题

[ 本帖最后由 hutaoseven 于 2017-2-22 11:22 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-2-22 11:27:05 | 显示全部楼层

回复 4# 的帖子


那是怎么回事啊?就是访问不了啊

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

发表于 2017-2-22 11:31:30 | 显示全部楼层

1.你可以参考一下iptables的相关设置:https://www.vpser.net/security/linux-iptables.html   2. 键入命令:lnmp status 看看服务器什么的运行是否正常   3.键入命令:php -v  检查PHP是否正常安装

[ 本帖最后由 hutaoseven 于 2017-2-22 11:34 编辑 ]
 楼主| 发表于 2017-2-22 11:33:03 | 显示全部楼层

回复 6# 的帖子


我按照他说的 那个目录里边没有iptables
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-2-22 11:47:24 | 显示全部楼层

回复 6# 的帖子


php-fpm is runing!
● mysql.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
   Active: active (running) since Wed 2017-02-22 09:52:43 CST; 1h 53min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 30311 ExecReload=/etc/init.d/mysql reload (code=exited, status=0/SUCCESS)
  Process: 1253 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mysql.service
           ├─1290 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/loc...
           └─1775 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --da...

Feb 22 09:52:42 ubuntu systemd[1]: Starting LSB: start and stop MySQL...
Feb 22 09:52:43 ubuntu mysql[1253]: Starting MySQL
Feb 22 09:52:43 ubuntu mysql[1253]: ..... *
Feb 22 09:52:43 ubuntu systemd[1]: Started LSB: start and stop MySQL.
Feb 22 10:13:29 ubuntu systemd[1]: Reloading LSB: start and stop MySQL.
Feb 22 10:13:29 ubuntu mysql[30311]:  * Reloading service MySQL
Feb 22 10:13:29 ubuntu systemd[1]: Reloaded LSB: start and stop MySQL.
你帮我看看呢
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-2-22 13:33:44 | 显示全部楼层


贴的配置文件没有问题
不同浏览器的报错信息可能不一样,介意直接复制或截图

如果是国内的VPS或服务器国内一般都有白名单可能无法用ip或未在白名单的域名访问

ps aux 看一下你系统进程
netstat -ntl 看一下

mysql报错需要按置顶帖反馈必读提供相关日志
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-2-22 13:47:32 | 显示全部楼层

回复 9# 的帖子




我就是在虚拟机vmware装了个ubuntu,在ubuntu里按照教程装了lnmp
然后按照教程新建了个虚拟主机和域名
访问Localhost 没有问题
但是自己新建的域名www.yangli.org访问不了
ping www.yangli.org 显示 ping: unknown host www.yangli.org

[ 本帖最后由 mgmg8787 于 2017-2-22 15:03 编辑 ]
 楼主| 发表于 2017-2-22 14:24:02 | 显示全部楼层

回复 9# 的帖子


3312 ?        Sl     0:00 /usr/lib/x86_64-linux-gnu/unity-lens-files/unity-fil
  3480 ?        S      0:00 sudo su
  3481 ?        S      0:00 su
  3482 ?        S      0:00 bash
  3492 ?        S      0:00 ping www.yangli.org
  3517 ?        S      0:00 [kworker/0:1]
  3556 ?        S      0:00 [kworker/0:0]
  3669 ?        S      0:00 [kworker/u256:0]
  4098 ?        S      0:00 [kworker/0:2]
  4107 ?        Sl     0:00 /usr/lib/gnome-terminal/gnome-terminal-server
  4113 pts/7    Ss     0:00 bash
  4125 pts/7    S      0:00 sudo su
  4126 pts/7    S      0:00 su
  4127 pts/7    S      0:00 bash
  4137 pts/7    R+     0:00 ps anx
root@ubuntu:/# netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN     
tcp6       0      0 :::21                   :::*                    LISTEN     
root@ubuntu:/#
发表于 2017-2-22 20:31:07 | 显示全部楼层

unknown host说明你域名没解析,没注册域名,测试用有种东西叫hosts
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-2-23 09:48:45 | 显示全部楼层

回复 12# 的帖子

是/etc/hosts吗? 那应该怎么改呢?
127.0.0.1        localhost
127.0.1.1        ubuntu

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


以上是hosts里的内容,能告诉我怎么改一下吗?

[ 本帖最后由 mgmg8787 于 2017-2-23 12:52 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-2-23 13:53:03 | 显示全部楼层
上面文件里都有给出的例子: IP 域名
在那台机器访问就在那台机器上设置hosts

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

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

本版积分规则

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

GMT+8, 2024-9-27 19:17 , Processed in 0.030988 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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