Server blocks ports after reboot - php

I have a system in JSP and DB PostgreSQL running on a CentOS 7 server however the error happened in a test VM running Lubuntu
I made an API in PHP with Laravel that sends and receives requests from an APP mobile
Until then everything was working correctly, but if I restart this server I lose the connection with the DB, it will return me this error:
SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
If I try to access the DB through pgAdmin, this returns Connecting to database ... Failed.
The VM accesses correctly through the XenCenter console, however the SSH connection that previously connected correctly is presented Network error: Conection refused
It is as if after restarting blocking all the ports, but until the firewall is disabled
[EDIT]
After some tests I discovered that the problem happens only after enabling mod_rewrite

Related

ORA-12546: TNS:permission denied error connection to remote oracle server

I have two web application and Oracle servers.
Web application server has the following details:
Linux server (LAMP)
oci8
PHP 7.4
Oracle Database server has the following details:
Oracle 19C
I am trying to connect Web Application Server to Oracle Database Remote Server. When I try to connect with remote Oracle server as a result following error shows:
ERROR is ORA-12546: TNS:permission denied.
*Note: While this remote Oracle Database server is connecting successfully from Windows server (WAMP).
Is this the first running of the web application? Can you connect to the database from the system running your web application using sqlplus?
In my case was the firewall. I enabled one rule that forbade the connection with the server. I just disabled the rule and the error was gone.
Had a similar issue. Though i wasn't using LAMP. I had a manually configured apache-php setup. I had to run the command in the Linux server to allow apache to make network connections - apparently, SELinux prevents this by default.
setsebool -P httpd_can_network_connect on
after seeing this: https://stackoverflow.com/a/26349596/9914081 which can be of help too.

Mysql error 'No connection could be made because the target machine actively refused it.'

So: I just bought an VPS and installed Ubuntu on it. After I installed Ubuntu I installed MySQL and created a database.
Now: I want to connect XenForo to the mysql database but I'm getting the error 'No connection could be made because the target machine actively refused it.'
Could anyone please help me with this.
Actively refused means, the host actually received your connection request, but denied it.
Things to check/verify:
Does the Service listen to TCP (not UDP) on the port used, usually 3306?
Is a firewall or proxy between your script and the database?
Is your MySQL server accepting connections from "localhost" or "127.0.0.1" (compare with connection parameters in your script)
Hope that helps :)

Two servers can't communicate via MySQL Error Code(110)

I have a web server that I can manage via cPanel and I'm trying to connect to a MySql database on a dedicated server (running Ubuntu Server) that I manage. I have two tester connections that give the same error code (from web server to dedicated server).
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'IP_ADDRESS' (110)
Can't connect to MySQL server on 'IP_ADDRESS' (110)
I also tried on my computer to connect to the dedicated server and I can do it. I'm using HeidiSQL as a GUI client to try connecting and I can connect to it with the same credentials.
What I have tried:
(I'm using Webmin to manage my mysql server)
Set user host to Any
Checked my.cnf for a bind address and it is bound to 0.0.0.0(all ips)
Checked host permissions for specific databases and set the database to my test user and Any for hosts
The Iptable should just allow all because after installing Ubuntu Server I have not changed anything.
I have no idea what else to try.

Failed to connect mongoDB remotely from localhost using PHP

I need one help.I am unable to connect access mongodb remotely from localhost of my system using PHP. I am running mongoDB in ubuntu server using this 10.10.5.80 and i am trying to connect from my system localhost for that i used the following code.
$con=new MongoClient("mongodb://10.10.5.80:27017");
But unable to connect.I have already checked the whether that post is listening or not and its running in my ubuntu server.When i am pushing all my code to that particular ip(10.10.5.80) its working fine.Here i need to connect that remote mongoDB server from localhost.Please help me to resolve this issue.
Please check following things in order to diagnose the issue:
Try connecting remote mongodb server from mongo shell from your local machine:
mongo --host 10.10.5.80 --port 27017
If step 1 fails, try to check if the remote port 27017 is accessible from you local machine
telnet 10.10.5.80 27017
If both 1 and 2 fail, it confirms that the remote mongo server is not accessible from you server.
Make sure your remote mongodb server is not bind to only 127.0.0.1(default), if that's the case you need to comment out the line in mongod.conf and restart the service.
If your mongodb on hosted on cloud, then make sure there is a security group rule that allows your local machine to access the remote host.
You can check mongodb logs/ mogostats if your requests from local machine adding up connections

apache/php/mysqli connection to remote db fails but IIS and MySQL workbench connects

I am developing locally and connecting to a remote mysql server. I had been using IIS on my local machine (WinXP) but am now using Apache instead. Most of my PHP site is working correctly after the move to Apache.
But - when mysqli tries to connect to the remote db I get:
(HY000/2003): Can't connect to MySQL server on '...:**' (10060)
I know that the server is accepting connections from my IP because I am able to connect to the same server from my local machine using MySQL Workbench.
I also know that the db connection details I'm using with mysqli are correct because I was using the same details when running on IIS without problem, the only change that happened is that I moved from IIS to Apache.
This problem still exists when my local firewall is disabled.
I have very little experience with Apache, is there perhaps a config setting I've missed that prevents me from connecting out to a remote db, or something that is mangling/hiding reporting of my correct IP?
Thanks for any help, I'm clutching at straws here...
Error 10060 happens when the remote MySQL server does not respond.
It could be that connections to port 3306 on the remote machine are being blocked. It could be that the system hosting PHP/Apache has a software firewall that is blocking the outgoing connection, or that PHP/Apache is not permitted to open network connections by that firewall.

Categories