你好,我无法使用 IP 地址查看我的网站

你好,我无法使用 IP 地址查看我的网站

我拥有一台用于测试的 VPS,并安装了 apache2,但当我尝试在浏览器中访问我的网站时我收到这个错误

我访问了几个链接,因此我验证了我的 apache2 是否正在运行:sudo systemctl status apache2并且我收到了以下消息:

apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Wed 2020-01-08 09:41:18 -03; 11min ago
  Process: 1599 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS
  Process: 1642 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCE
 Main PID: 1652 (apache2)
    Tasks: 55 (limit: 4606)
   CGroup: /system.slice/apache2.service
           ├─1652 /usr/sbin/apache2 -k start
           ├─1654 /usr/sbin/apache2 -k start
           └─1656 /usr/sbin/apache2 -k start

Jan 08 09:41:18 cercal.vhn.cl systemd[1]: Starting The Apache HTTP Server...
Jan 08 09:41:18 cercal.vhn.cl systemd[1]: Started The Apache HTTP Server.

我还检查了我的 UFW 状态并且:

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere
20/tcp                     ALLOW       Anywhere
21/tcp                     ALLOW       Anywhere
990/tcp                    ALLOW       Anywhere
40000:50000/tcp            ALLOW       Anywhere
Apache Full                ALLOW       Anywhere
56556                      ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
443/tcp                    ALLOW       Anywhere
80/tcp (v6)                ALLOW       Anywhere (v6)
443/tcp (v6)               ALLOW       Anywhere (v6)

我也检查了我的 ports.conf:

sudo nano /etc/apache2/ports.conf

并得到这个:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

另外检查我的 000-default 我得到了这个:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port t$
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html


所以,显然一切都还好,我不知道我缺少什么才能让这个东西工作,有什么建议或帮助吗?

答案1

我发现了我的问题,我试图访问https://my.example.ip.thing代替http://my.example.ip.thing

相关内容