我已经启动了一个容器,打开了一些端口,并试图通过浏览器访问Tomcat的web接口,但它不起作用。
1)docker run -ti --rm --name server -p 3456:5678 tomcat:8.0 // not working with localhost:3456
2)docker run -ti --rm --name server -expose 8080 tomcat:8.0 //not working localhost:8080
3)docker inspect server // to see the ip:port and tried to access
我的容器有以下Dockerfile:
FROM centos:centos7
# Install software
RUN yum -y update && yum clean all
RUN yum install -y tar gzip wget && yum clean all
# Install io.js
RUN mkdir /root/iojs
RUN wget https://iojs.org/dist/v1.1.0/iojs-v1.1.0-linux-x64.tar
我正在CentOS7中测试最大tcp连接。我将打开的文件限制更改为1000000(ulimit -n 1000000)并编辑了sysctl.conf,如下所示。然后,我使用node.js进行如下代码的测试(单个服务器):
var net = require('net');
var count = 0
//server
let server = net.createServer(function(conn){
conn.on("close", function(code, reason){
console.log("close
当我试图在端口8080上运行一个服务(RavenDB)时,它会停止,而Windows日志显示了以下错误:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: Failed to listen on prefix 'http://+:8080/' because it conflicts with an existing registration
我正在尝试侦听端口8080的socket.io,但是我得到了错误:
http://localhost:8080/socket.io/?EIO=3&transport=polling&t=Lai1FQh net::ERR_CONNECTION_REFUSED
我正在使用来自数字海洋的ubuntu虚拟机,当我第一次登录ssh时,我收到消息:
The "ufw" firewall is enabled. All ports except for 22, 80, and 443 are BLOCKED。
我是这方面的初学者,但这并不意味着端口8080被阻塞。
我如何解决
我想在一个特定的端口上运行一个测试监听器,以检查该端口是否打开,但是每当我使用netcat启动一个监听器时,它都与0.0.0.0:8080 Ip地址绑定。我想启动一个通配符服务,比如:::8080 using netcat -l -p 8080或任何已知的方式。 我用来检查可用性的脚本 with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
if sock.connect_ex((ip,port)) == 0:
print "Port is open";
else:
我有一个安装了Postgres的服务器,我想允许来自外部IP的连接。Postgres非常适合本地连接,然后在文件/var/lib/pgsql/data/postgressql.conf的末尾添加:
listen_addresses = '*'
在/var/pgsql/data/pg_hba.conf的末尾,我补充道:
host all all 0.0.0.0/0 md5
host all all ::/0
我在GCP中创建了计算引擎实例,以将我的web app.It部署在实例中(localhost:8080)。但是,使用外部Ip地址,即使我允许防火墙规则为所有实例提供0.0.0.0/0,我也无法访问它。我添加了端口tcp:8080和tcp :8444,但它甚至不允许连接“Telnet”。
Connecting To 35.185.98.244...Could not open connection to the host, on port 8444: Connect failed
Connecting To 35.185.98.244...Could not open connection t
Dockerfile Docker运行命令:docker run -itd -p 8080:80 prod FROM node:16-alpine as builder
WORKDIR /app
COPY package.json ./
COPY package-lock.json ./
COPY . /app/
RUN npm install --silent
RUN npm install react-scripts@4.0.3 -g --silent
RUN npm run build
# production environment
FROM nginx:1.21.1-alpine
checkServer(){
response=$(curl --connect-timeout 10 --write-out %{http_code} --silent --output /dev/null localhost:8080/patuna/servicecheck)
if [ "$response" = "200" ];
then echo "`date --rfc-3339=seconds` - Server is healthy, up and running"
return