Web application doesn't run on port 80, but runs on 4200 - angularjs

I have an angular web app which I'm trying to deploy. When I run it on port 4200, and access the website using the external IP, I can see the web page.
However, when I run the same application on port 80, it runs but the website isn't reachable anymore. (Connection refused)
I can see the process listening on port 80. Here's the output of netstat.
user#localhost:/etc$ sudo netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 aaa.bbb.ccc.ddd:80 0.0.0.0:* LISTEN
tcp 0 0 aaa.bbb.ccc.ddd:22 aaa.bbb.ccc.eee:51422 ESTABLISHED
tcp 0 320 aaa.bbb.ccc.ddd:22 aaa.bbb.ccc.eee:51421 ESTABLISHED
tcp6 0 0 :::21 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
I have opened port 80, but it's still the same. I'm running Ubuntu 16.04.

try different port.. 80 may be disable or blocked from your side. Use port no. 90.

Related

Windows 10 Host cannot access SQL Server on Oracle Virtual Box

I have created a VM with virtual box that runs windows 10, and installed SQL Server.
Using Consume Adapter Service in Visual Studio for BizTalk 2020
Configured: SQLBinding AS: mssql://DESKTOP-T2G7B3A/MSSQL15.MSSQLSERVER/AFBizTalkTest?InboundId=ID
Click Connect:
Failure 26 - Error Locating Server/Instance Specified
Items tried or checked:
Ran PortQry on Virtual Box:
Starting portqry.exe -n 10.0.2.15 -e 1433 -p TCP ...
Querying target system called:
10.0.2.15
Attempting to resolve IP address to a name...
IP address resolved to DESKTOP-T2G7B3A
querying...
TCP port 1433 (ms-sql-s service): LISTENING
portqry.exe -n 10.0.2.15 -e 1433 -p TCP exits with return code 0x00000000.
1A. Ran PortQry On Host
Starting portqry.exe -n 10.0.2.15 -e 1433 -p TCP ...
Querying target system called:
10.0.2.15
Attempting to resolve IP address to a name...
Failed to resolve IP address to name
querying...
TCP port 1433 (ms-sql-s service): FILTERED
portqry.exe -n 10.0.2.15 -e 1433 -p TCP exits with return code 0x00000002.
1B. Verified the IP address on Virtual Box is 10.0.2.15. Failed to ping on Host, Successful ping on Virtual Box.
TCP/IP Enabled in SQL Server instance.
Changed Server name to ip address - Error Locating Server/Instance Specified
Verified SQL Server Browser is running.
Verified Server Name from Error Log.

can't connect to mongodb remotely after opening ubuntu firewall and mongod.conf

Can't connect to mongodb remotely on fresh installation of mongodb on ubuntu 20.10 server on Linode.
root#localhost:~# sudo ufw status
Status: active
To Action From
-- ------ ----
22 ALLOW Anywhere
27017 ALLOW 0.0.0.0
22 (v6) ALLOW Anywhere (v6)
/etc/mongod.conf
net:
port: 27017
bindIp: 0.0.0.0
mongo server is up and running
root#localhost:~# sudo service mongod status
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-04-04 18:34:05 UTC; 19min ago
Docs: https://docs.mongodb.org/manual
Main PID: 1332 (mongod)
Memory: 161.0M
CGroup: /system.slice/mongod.service
└─1332 /usr/bin/mongod --config /etc/mongod.conf
Apr 04 18:34:05 localhost systemd[1]: Started MongoDB Database Server.
netstat on host running mongo server
root#localhost:~# sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 1332/mongod
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 640/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 817/sshd: /usr/sbin
tcp6 0 0 :::22 :::* LISTEN 817/sshd: /usr/sbin
udp 0 0 127.0.0.53:53 0.0.0.0:* 640/systemd-resolve
nc -zv IP_ADDRESS 27017 times out, so mongo -u $DB_USERNAME -p $DB_PASSWORD IP_ADDRESS/admin will just time out as well
nc -zv IP_ADDRESS 22 works as expected
solved by doing sudo ufw allow 27017 instead of sudo ufw allow from 0.0.0.0 to any port 27017
root#localhost:~# sudo ufw status
Status: active
To Action From
-- ------ ----
22 ALLOW Anywhere
27017 ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
27017 (v6) ALLOW Anywhere (v6)

Can't connect to SQL Server database inside docker in travis

I have trouble connecting to a SQL Server database inside a docker container in travis.
Everything is working fine on my machine the error only occurs inside travis, can't figure out why.
Dockerfile:
from microsoft/mssql-server-linux:2017-latest
ENV ACCEPT_EULA=Y
ENV MSSQL_SA_PASSWORD=Passw0rd
COPY hermes.bak /var/opt/mssql/backup/hermes.bak
CMD ["/opt/mssql/bin/sqlservr"]
.travis.yml:
dist: trusty
services:
- docker
before_install:
- docker build -t hermes-db .
- docker run -d -p 127.0.0.1:1430:1433 --name hermes-db hermes-db
- docker exec hermes-db /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'Passw0rd' -Q "RESTORE DATABASE [lbc_refs] FROM DISK = N'/var/opt/mssql/backup/hermes.bak' WITH MOVE 'lbc_refs' TO '/var/opt/mssql/data/lbc_refs_data.mdf', MOVE 'lbc_refs_log' TO '/var/opt/mssql/data/lbc_refs_log.ldf'"
script:
- docker ps | grep -q hermes-db
Ending up with:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
When I run netstat -tulpn :
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:1430 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
udp 0 0 0.0.0.0:11211 0.0.0.0:* -
udp 0 0 172.18.0.1:123 0.0.0.0:* -
udp 0 0 172.17.0.5:123 0.0.0.0:* -
udp 0 0 127.0.0.1:123 0.0.0.0:* -
udp 0 0 0.0.0.0:123 0.0.0.0:* -
udp6 0 0 :::123 :::* -
I encountered same problem on multi tenants application using SQL Server on Travis CI.
Here is the final build: https://travis-ci.org/github/ron190/jsql-injection/builds/663658271
After a lot of try and errors I managed to stabilize connection on port 1433 following these rules:
Use image 2019-GDR1-ubuntu-16.04 instead of 2017-latest
EXPOSE 1434 1433 in Dockerfile, 1434 for sqlcmd, 1433 for Hibernate on C3P0
Add sleep 10s before testing first connection with sqlcmd
Use password that complies with sql server password policy
Some details about my debugging on travis-ci.community.

SqlServer on Linux

I get a problem today with my sql-server on linux, my dotnet app stop work cause cant connect to sql-server on localhost, but work OK on my production database on azure.
Using sqlcmd -S localhost,1433 -U SA -p or to connect with user on a database I get
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2746.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.
if I use sqlcmd to connect on my production database on azure work OK
if I use sqlectron to connection on my localhost database work OK
after I get error to connect
$ ss -atunp | grep 1433
tcp LISTEN 0 128 *:1433 *:*
tcp TIME-WAIT 0 0 127.0.1.1:1433 127.0.0.1:42839
tcp LISTEN 0 128 :::1433 :::*
after I connect with sqlectron
$ sudo ss -atunp | grep 1433
tcp LISTEN 0 128 *:1433 *:* users:(("sqlservr",pid=4312,fd=134))
tcp ESTAB 0 0 127.0.0.1:51466 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=94))
tcp ESTAB 0 0 127.0.0.1:51468 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=96))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51464 users:(("sqlservr",pid=4312,fd=142))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51468 users:(("sqlservr",pid=4312,fd=148))
tcp ESTAB 0 0 127.0.0.1:51470 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=97))
tcp ESTAB 0 0 127.0.0.1:51472 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=98))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51462 users:(("sqlservr",pid=4312,fd=85))
tcp ESTAB 0 0 127.0.0.1:51462 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=87))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51466 users:(("sqlservr",pid=4312,fd=147))
tcp TIME-WAIT 0 0 127.0.0.1:1433 127.0.0.1:53693
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51470 users:(("sqlservr",pid=4312,fd=149))
tcp ES -atunp | grep 1433
tcp LISTEN 0 128 *:1433 *:* users:(("sqlservr",pid=4312,fd=134))
tcp ESTAB 0 0 127.0.0.1:51466 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=94))
tcp ESTAB 0 0 127.0.0.1:51468 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=96))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51464 users:(("sqlservr",pid=4312,fd=142))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51468 users:(("sqlservr",pid=4312,fd=148))
tcp ESTAB 0 0 127.0.0.1:51470 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=97))
tcp ESTAB 0 0 127.0.0.1:51472 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=98))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51462 users:(("sqlservr",pid=4312,fd=85))
tcp ESTAB 0 0 127.0.0.1:51462 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=87))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51466 users:(("sqlservr",pid=4312,fd=147))
tcp TIME-WAIT 0 0 127.0.0.1:1433 127.0.0.1:53693
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51470 users:(("sqlservr",pid=4312,fd=149))
tcp ESTAB 0 0 127.0.0.1:1433 127.0.0.1:51472 users:(("sqlservr",pid=4312,fd=150))
tcp ESTAB 0 0 127.0.0.1:51464 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=91))
tcp LISTEN 0 128 :::1433 :::* users:(("sqlservr",pid=4312,fd=128))
TAB 0 0 127.0.0.1:1433 127.0.0.1:51472 users:(("sqlservr",pid=4312,fd=150))
tcp ESTAB 0 0 127.0.0.1:51464 127.0.0.1:1433 users:(("sqlectron",pid=4689,fd=91))
tcp LISTEN 0 128 :::1433 :::* users:(("sqlservr",pid=4312,fd=128))
I try complete uninstall and install, but not success.
Server are running,
$ service mssql-server status
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2018-04-09 18:34:06 -03; 37min ago
Docs: https://learn.microsoft.com/en-us/sql/linux
Main PID: 683 (sqlservr)
Tasks: 168
Memory: 1.5G
CPU: 56.406s
CGroup: /system.slice/mssql-server.service
├─683 /opt/mssql/bin/sqlservr
└─843 /opt/mssql/bin/sqlservr
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
I can connect with SqlElectron, but with sqlcmd or dotnet program no.
My problem is not with SqlServer, is with libssl on linux, if i try connect with SqlElectron with SSL connection fail.

GAE creating multiple process id of GAE while starting the server

when i start the server GAE always create the new prcoess,
ant runserver
the build.xml
<target name="runserver" depends="datanucleusenhance"
description="Starts the development server.">
<dev_appserver war="war" />
</target>
C:\>netstat -a -n -o | grep 8080
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 6496
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 2288
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 2572
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 7240
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 1672
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 7492
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 5660
How can i stop the GAE instance using my build.xml scripts, or which command to be used to stop the GAE instanse.
Normally when you invoke "ant runserver" in a Console window, the resulting Java process runs in the foreground as the active job. So in order to stop it you merely have to type Control-C (or Control-BREAK on Windows).
(This page in the App Engine documentation mentions Control-C. See here regarding Control-BREAK on Windows.)

Resources