账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    关于外网访问阿里云Tomcat、Nginx失败,已配置阿里云规则和关闭防火墙的问题
    1
    0
    阿里云服务器,ubuntu启动了Tomcat、Nginx,外网访问不到(120.27.xxx.xxx的响应时间过长),在自己笔记本电脑上telnet端口8080、80也不通,大佬们能不能帮忙看看,谢谢!看Tomcat日志是正常启动了,端口是808080、8080端口有监听阿里云服务器防火墙加了80和8080规则,后来将出入口全部端口开放了都不行;curl localhost:80 能通,但curl公网IP失败: curl 120.27.xxx.xxx:80 失败,超时,8080端口同理,curl localhost:8080 返回了一个html页面启动了Redis和MySql,都能连接,本机也能telnet通端口3306和6379ubuntu没开防火墙IP地址没搞错,登陆阿里云控制台和通过curl ipinfo.io 都能看到公网IP地址端口监听:# netstat -anp | grep 80tcp 0 0 0.0.0.0:6380 0.0.0.0:* LISTEN 105220/redis-server tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 211452/nginx: maste tcp 0 0 172.16.208.151:33622 100.100.30.26:80 ESTABLISHED 154443/AliYunDun tcp 0 0 172.16.208.151:52778 100.100.45.186:80 TIME_WAIT - tcp6 0 0 127.0.0.1:8005 :::* LISTEN 215803/java tcp6 0 0 :::6380 :::* LISTEN 105220/redis-server tcp6 0 0 :::8080 :::* LISTEN 215803/java tcp6 0 0 :::80 :::* LISTEN 211452/nginx: maste unix 2 [ ] STREAM CONNECTED 3057620 215803/java unix 2 [ ] STREAM CONNECTED 3057630 215803/java unix 3 [ ] STREAM CONNECTED 154480 1/systemd /run/systemd/journal/stdoutunix 3 [ ] STREAM CONNECTED 18001 1/systemd /run/systemd/journal/stdoutcurl本地8080端口能通,返回一个html页面,# curl 127.0.0.1:8080<!DOCTYPE html><html lang="en"> <head>.....省略......关于防火墙:# sudo ufw statusStatus: inactive# firewalldCommand 'firewalld' not found, but can be installed with: apt install firewalld虽然没使用iptables,但是还是尝试加了配置,依然访问失败# iptables -A INPUT -p tcp -i eth0 --dport 80 -j ACCEPT# iptables -A INPUT -p tcp -i eth0 --dport 8080 -j ACCEPT其他版本信息:服务器版本信息:# lsb_release -aLSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarchDistributor ID: UbuntuDescription: Ubuntu 20.04.3 LTSRelease: 20.04Codename: focal# java -versionopenjdk version "1.8.0_292"OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~20.04-b10)OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)$ telnet 120.27.XXX.XXX 6379Connecting to 120.27.XXX.XXX:6379...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.$ telnet 120.27.XXX.XXX 80Connecting to 120.27.XXX.XXX:80...Could not connect to '120.27.XXX.XXX' (port 80): Connection failed.apache-tomcat-8.5.71安装: Ubuntu 16.04下安装Tomcat 8.5.9_服务器应用_Linux公社-Linux系统门户网站nginx version: nginx/1.18.0 (Ubuntu) 通过apt-get install安装,service nginx start启动
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答