Ubuntu服务器(apache)不会响应外部请求

时间:2015-03-31 23:45:48

标签: apache ubuntu ssh server

我对此很新,所以我可能会遗漏一些非常明显的东西,但我无法使用外部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>

1 个答案:

答案 0 :(得分:0)

所以我在挖掘之后发现,有些路由器不喜欢你出去&#34; out and back 34 in。我尝试使用手机上的数据连接到我的服务器,现在可以使用了。