Filemaker PHP Web Publishing - Synchronising not working with new host address - php

We have a windows server setup in our premises where we host our FileMaker server (FMS 15).
We are thinking of moving the host into a cloud server (FMS19).
We have taken the latest backup of our databases (from FMS 15) and uploaded it into the cloud server (FMS 19).
The extension of the backup file is .fm12 so it was uploaded easily from FMS15 to FMS 19. Database structure remains exactly the same and the connection from FileMaker pro is also working fine.
The Issue
One of these databases (database db_fm for example) is connected to our website. A cron job runs every 5 minutes on our website that syncs information from the website's database (db_website) to that of FileMaker's databases (db_fm). The sync uses FileMakers “PHP Web Publishing”
After uploading the latest backup in the cloud server (FMS 19) I have changed the host address in the config file
i.e; I have changed the host address from
//host for our internal server
$FileMakerHost = 'http://77.**.***.40:8080';
to
//host for cloud server
$FileMakerHost = 'https://a*****2.fmphost.com/ ;
Database structure and the password for the Filemaker database remained the same. So have not changed anything else other than the host address.
The synchronization works with the current database (hosted in our windows server FMS15) but it is not working with the new host (hosted in cloud server FMS19).
After changing the host address we have created a test subscriber. That record should be added to the FileMaker database (i.e the one hosted in cloud server). But there is no new record created.
Can you please assist me with what can be the issue? I cannot think of anything else other than changing the host address. What can I do to make it work with both servers?
FYI
The sync uses filemakers “PHP Web Publishing” The cloud server
(FMS19) is also in windows and PHP publishing engine is enabled
Our site is built with laravel.

The main problem was the new host address was https. The sync was working for HTTP address not https.
Following are things that we have done to make it work
We added an outbound rule in our webserver (where our website is hosted) on port 443.
Then we have reset the cache via ssh. systemd-resolve --flush-caches
. Because automatic redirect was cached
FMPHOST (The hosting company) suggested us, to test from PHP so that it can get any response from https://a******.fmphost.com/ or http://a******.fmphost.com/ (Use curl commands to prove port is not blocked between the web server and FileMaker Server)
Thank you

Related

how to connect and secure the connection between my website and and the accounting system on my local server?

my website is php laravel hosted in a cloud server and the accounting system is on my local server and coded by apache using php codeigniter, keep in mind i have mikrotik router on my local network and have bought a static ip from my ISP, would like to provide the maximum level of security possible
so far i installed windows server 2016 on my local server and installed active domain directory and dns and file server and installed winbox to configure the mikrotik router for what is needed

connect to mysql using php vpn

I have a php script that accesses a mysql database. It lives on a server that has been migrated to aws (amazon web services). This server hosts a website that used to live on a physical server part of a private network.
The databases are still on that private network. I need to connect to a mysql database that is on a server with no public ip address. There is a vpn set up for this network.
I would like to ssh or vpn to the network from the aws server.
This is just to query something once a day.
I tried exec('ssh -f -L 3307:PrivateMYSQLServer:3306 USER#VPNADDRESS') but could not get it to work.
Is there a one liner that I can insert into the php script?
thanks
You’ll have to set up the server in which your script runs to connect back to your network via your VPN client.
Alternatively, you can set up a site to site VPN between your data center and AWS.
If you have a correctly configured site-to-site VPN (and routing tables, security groups, etc.), one end in your VPC and the other end in your private on premises network, then you don't need to create an SSH tunnel. Just connect to your database and run the query.

CodeIgniter: How to synchronize local and remote databases

I have a Hotel monitoring web application developed in CodeIgniter.
It monitors each room of a hotel for activities and Sends live data about rooms occupancy, status of electrical switches etc.
It hosted in cpanel web server. I have the same copy of it in my local computer.
I want to synchronize the 2 databases (ie. in localhost and in remote server).
Every change in any database should be automaticaly updated to other database.
First I tried to access my remote database from localhost by putting host name as my cpanel Shared IP Address as follos
$db['default']['hostname'] = 'xx.xx.xx.xx';
where xx.xx.xx.xx is the shared IP of cpanel. but no use.
how should I proceed?
Thanks in advance
Option 1: The Codeigniter Way
You can set up a remote access MySQL server:
Tutorial for cpanel here: https://www.liquidweb.com/kb/enable-remote-mysql-
connections-in-cpanel/
Then just set up a new connection in your database.php changing the to $db['remote']['hostname'] = 'xxx.xxx.xxx.xxx';
Do note that you'll have to make a method to pull in this new data and replace it in your local database, so a script that can be run via cronjob.
Option 2: The Master/Slave Way
You can set up a Master database, being the hotel, and a slave being your local database. I don't know of a method to do this straight cpanel, but you can do it in phpmyadmin, there's a video on how to do it here: https://www.youtube.com/watch?v=nfsmnx24gxU
This method would be the most comprehensive/automatic way to do it. It will overwrite any changes in your database though.
Note that any outside access to a database is potentially insecure. Be aware of this when choosing.

How to update remote server application from local server application

I have a PHP/MySQL application running with WAMP on a local server. This application contains sensitive and confidential data that can only be accessed from devices on the network in the office.
However, this application generates reports that clients should be able to access from the web from an entirely separate application running on a LAMP stack.
Currently, I have the reports transferring via SFTP from the local server to the web based server.
My question is, how can I update the remote database from the local application securely, and so that the MySQL db can only be modified by the localhost of the remote application and the server running the local application?
I'm thinking about creating some kind of API that only accepts data from the IP of the local app, but I do not know the best practices for this, nor do I know how to start going about it.
MySQL provides a USER > FROM HOST > PER DATABASE > PER TABLE > PER COLUMN grant system.
Meaning that you can specify which user can connect from which host to which database,... Make usage of the FROM HOST feature.

How can I connect to MySQL database on a dedicated Windows 2003 server from EC2 based app server with PHP

I have developed a web application that uses PHP and MySQL and has all been running fine from a single development server. I now want to separate things a bit and place an app server within Amazons cloud that will receive and process uploaded files. The database is going to remain on the dedicated server but will need to be accessed by the EC2 instance.
Heres what I have tried so far...
In phpMyAdmin I added a new user to the privileges table. I gave it the elastic IP address from AWS as the host name, a new password and granted privileges to INSERT, SELECT and UPDATE.
In the PHP scripts on my EC2 based app server I included this username, password and the domain name of the location of the mysql server (example.domain.net) when connecting with mysql_connect
I have a simple test page that tries to SELECT and echo some results from the database but get the following error -
Could not connect to MySQL: Can't connect to MySQL server on 'example.domain.net' (4)
What could this mean, what have I missed, are there any other issues such as trying to do this from within EC2 that will cause other problems?
cheers all
Turns out the only other thing I needed to do was to open port 3306 on the database server to allow access. Did this by going to Control Panel -> Windows Firewall -> Exceptions -> Add Port ["SQL", 3306]
Now it works great!

Categories