Hi everyone,
I am running the latest Plesk on a Ubuntu server.
I have a domain (domain.com) and a subdomain called api.domain.com
I have installed a nodejs application for the api.domain.com via the interface and it is running and will return sample route return data as long as it is not querying the database.
I have installed a database under domain.com and it shows api.domain.com on the interface to the side where it says add-on domains also.
I have tried connecting to this database from my local machine and also from the node application but it will not work locally and I assume it will not work from the node application either.
I checked var/log/apache2/logs/error.log and it does not seem to throw an error for the initial connection in the start of the nodejs app:
const connection = mysql.createConnection({
host: 'localhost',
user: 'admin',
password: 'secretpassword',
database: 'app',
});
connection.connect(err => {
if (err) throw err;
console.log('Connected!');
});
because in the error.log it does show the Connected! so it seems to have a connection?
But in my test route nothing is shown except: 'Cannot GET /people/1' on the browser
I also have 2 different rows added with data in the people table within the app database.
app.get('people/:id', (req, res) => {
console.log('Fetching data with id' + req.params.id);
const id = req.params.id;
const queryString = "SELECT * FROM people WHERE id = ?";
connection.query(queryString, [id], (err, rows, fields) =>
{
console.log('I think we fetched'); // this does not show
res.json(rows);
});
});
In the database management for the user it is set to Allow remote connections from any host
From the firewall screen it seems to allow all incoming connections:
FTP server passive ports Allow incoming from all
Customer & Business Manager payment gateways Allow incoming from all
Single Sign-On Allow incoming from all
Plesk Installer Allow incoming from all
Plesk administrative interface Allow incoming from all
WWW server Allow incoming from all
FTP server Allow incoming from all
SSH (secure shell) server Allow incoming from all
SMTP (submission port) server Allow incoming from all
SMTP (mail sending) server Allow incoming from all
POP3 (mail retrieval) server Allow incoming from all
IMAP (mail retrieval) server Allow incoming from all
Mail password change service Allow incoming from all
MySQL server Allow incoming from all
PostgreSQL server Allow incoming from all
Samba (file sharing in Windows networks) Allow incoming from all
Plesk VPN Allow incoming from all
Domain name server Allow incoming from all
IPv6 Neighbor Discovery Allow incoming from all
Ping service Allow incoming from all
Hoping some of you can help me out with this headache, thanks!
I am running the latest Plesk on a Ubuntu server.
I have a domain (domain.com) and a subdomain called api.domain.com
I have installed a nodejs application for the api.domain.com via the interface and it is running and will return sample route return data as long as it is not querying the database.
I have installed a database under domain.com and it shows api.domain.com on the interface to the side where it says add-on domains also.
I have tried connecting to this database from my local machine and also from the node application but it will not work locally and I assume it will not work from the node application either.
I checked var/log/apache2/logs/error.log and it does not seem to throw an error for the initial connection in the start of the nodejs app:
const connection = mysql.createConnection({
host: 'localhost',
user: 'admin',
password: 'secretpassword',
database: 'app',
});
connection.connect(err => {
if (err) throw err;
console.log('Connected!');
});
because in the error.log it does show the Connected! so it seems to have a connection?
But in my test route nothing is shown except: 'Cannot GET /people/1' on the browser
I also have 2 different rows added with data in the people table within the app database.
app.get('people/:id', (req, res) => {
console.log('Fetching data with id' + req.params.id);
const id = req.params.id;
const queryString = "SELECT * FROM people WHERE id = ?";
connection.query(queryString, [id], (err, rows, fields) =>
{
console.log('I think we fetched'); // this does not show
res.json(rows);
});
});
In the database management for the user it is set to Allow remote connections from any host
From the firewall screen it seems to allow all incoming connections:
FTP server passive ports Allow incoming from all
Hoping some of you can help me out with this headache, thanks!