【问题标题】:Ubuntu server (apache) won't respond to external requestsUbuntu 服务器 (apache) 不会响应外部请求
【发布时间】:2015-03-31 23:45:47
【问题描述】:

我对此很陌生,所以我可能会遗漏一些非常明显的东西,但我无法使用我的外部 IP 连接到我的服务器。在内部,一切都像梦一样工作(10.0.0.28/redmine),但是当我尝试使用外部 IP 连接时,请求超时。我转发了我的 ssh 端口和端口 80,如下所示,但这并没有解决问题。 我的端口现在显示为通过 www.portchecktool.com 打开。

SSH 在内部工作正常,但是当我发出此处显示的命令时,它显示连接已被远程主机关闭。

ssh {my external ip} -pxxxx -i /home/millerir/.ssh/id_rsa -l imiller

同样,当我导航到 {my ip}/redmine 或 {my ip} 或 {my_ip}:80 或我的 ddns 服务地址时,我在尝试从浏览器连接错误时重置连接。

我确实检查了服务器正在侦听端口 80 和我的 ssh 端口,如下所示。

me@ubuntu-server:/etc/apache2/sites-available$ sudo netstat -tulpn | grep LISTEN
tcp        0      0 0.0.0.0:xxxx            0.0.0.0:*               LISTEN      779/sshd
tcp        0      0 127.0.0.1:57384         0.0.0.0:*               LISTEN      1192/redmine
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      862/mysqld
tcp6       0      0 :::xxxx                 :::*                    LISTEN      779/sshd
tcp6       0      0 :::80                   :::*                    LISTEN      923/apache2

如果有人可以帮助我,将不胜感激。我被卡住了,有点不知所措。

redmine.conf

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # 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

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

        DocumentRoot /var/www
        <Directory /var/www/redmine>
                RailsBaseURI /redmine
                PassengerResolveSymLinksInDocumentRoot on
        </Directory> 
 </VirtualHost>

http.conf

<Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

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

【问题讨论】:

  • 显然我还没有足够的声誉来发布图片:(但我已尽力包含文本或我的端口转发设置。服务名称类型开始端口结束端口服务器 IPv4 服务器 IPv6 活动 Web 服务器TCP/UDP 80 80 10.0.0.28 服务器SSH TCP/UDP xx xx 10.0.0.28

标签: apache ubuntu ssh server


【解决方案1】:

所以我在四处挖掘后发现有些路由器不喜欢你“进出”。我尝试使用手机上的数据连接到我的服务器,现在它可以正常工作了。

【讨论】:

  • 这就是所谓的地址重新绑定保护。
猜你喜欢
  • 2015-10-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-16
  • 1970-01-01
  • 2017-03-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多