eu posso acessar o servidor local via ip externo, mas não via ip interno

0

Eu instalei o apache2 no meu Raspberry Pi rodando raspbian. Então configurei meu roteador para mapear as portas 80 e 443 para as mesmas portas no meu Pi (192.168.2.108).

Do meu Pi eu posso acessar a página de teste do apache digitando localhost ou 127.0.0.1 ou seu ip local (192.168.2.108) ou o ip externo do meu roteador.

Do meu laptop, posso acessar a página digitando apenas o endereço IP externo do meu roteador, mas não , digitando o ip interno do meu Pi (192.168.2.108).

Alguma ideia do porquê? Veja algumas informações que podem ser importantes:

$ apache2 -v
Server version: Apache/2.4.10 (Raspbian)
Server built:   Jul 20 2016 10:31:40

$ sudo /etc/init.d/apache2 status
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
   Active: active (exited) since Sa 2016-09-10 12:35:22 UTC; 21min ago
  Process: 1128 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 1140 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Sep 10 12:35:22 raspberrypi apache2[1140]: Starting web server: apache2AH005...e
Sep 10 12:35:22 raspberrypi apache2[1140]: (99)Cannot assign requested addre...0
Sep 10 12:35:22 raspberrypi apache2[1140]: no listening sockets available, s...n
Sep 10 12:35:22 raspberrypi apache2[1140]: AH00015: Unable to open logs
Sep 10 12:35:22 raspberrypi apache2[1140]: Action 'start' failed.
Sep 10 12:35:22 raspberrypi apache2[1140]: The Apache error log may have mor....
Sep 10 12:35:22 raspberrypi apache2[1140]: .
Sep 10 12:35:22 raspberrypi systemd[1]: Started LSB: Apache2 web server.
Hint: Some lines were ellipsized, use -l to show in full.

$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

$ sudo netstat -ntlp
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      457/sshd        
tcp6       0      0 :::80                   :::*                    LISTEN      1422/apache2    
tcp6       0      0 :::22                   :::*                    LISTEN      457/sshd    

$ cat /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
#Listen 192.168.2.107:80
#Listen 8000

<IfModule ssl_module>
    Listen 443
</IfModule>

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

/etc/apache2/apache.conf (removeu alguns comentários):

#ServerRoot "/etc/apache2"

Mutex file:${APACHE_LOCK_DIR} default

PidFile ${APACHE_PID_FILE}

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

AccessFileName .htaccess

<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

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

EDITAR :

Novas informações interessantes: posso acessar a página de teste usando 192.168.2.108 do meu smartphone! Ele também funciona com meu laptop se eu usar o Chromium em vez do Firefox.

    
por MaxGyver 10.09.2016 / 15:23

1 resposta

0

Obrigado pela sua dica, sinclair! Não era sobre o proxy. Mas quando pesquisei as configurações de proxy, encontrei esta ajuda do Firefox página e tentei todas as etapas. O último resolveu meu problema:

Eu tive que limpar cookies e cache.

    
por 11.09.2016 / 13:21