Complete newbie - php/angular.js 3 tier architecture

108 views
Skip to first unread message

Hitendra Sahay

unread,
Dec 20, 2016, 5:26:01 PM12/20/16
to Angular
Gentlemen 

I need some help. 

Full disclosure - I am not a php/angular developer. I am just a guy who has somehow ended up managing a project that is using this technology. So I am going to explain the issue in as much layman/quasi-tech language as possible and hope it makes enough sense to some of you who can then help me. 

We have a bootstrap/angular.js application running on a webserver. 

The UI calls a PHP script that sends a query to the sql server and returns the result of the query to the UI as a json object. 

Here is how we deployed the application 

1. Bootstrap UI with angular.js on the frontend server (serverFront)

2. PHPs deployed on middleware server (serverMiddle)

3. sql server running the database (serverDB)

There is a .js file on the front end that calls the php using the following code - 

$http({
            method: "POST",
            data: {
                data: current
            }

The problem is - 

ServerFront is in the DMZ exposed to the internet. 
ServerMiddle is inside the firewall. 

ServerFront can ping and access ServerMiddle

However - when we access the application from the internet (outside of our network), when the .js tries to send it to the php file on the middleware using the url = https://serverMiddle/static/php/search1.php, we get an error saying ERR_NAME_NOT_RESOLVED  ...probably because serverMiddle is not knows outsideour network ? 

How can we make this three tier architecture work ....where the UI in the DMZ talks to the middleware server hosting the PHP files inside our firewall talking to the sql sserver insdie our network ? 

thanks for any help you can render in this matter. 

This e-mail and any files or data transmitted with it are confidential and intended solely for the use of the individual named above. If you have received this email in error and are not the intended recipient, please notify the sender by e-mail and immediately delete the message and all materials without reading them.  If you are not the intended recipient, copying, forwarding or otherwise disseminating or distributing this information is prohibited.

Christoph Zwerschke

unread,
Dec 21, 2016, 1:37:30 AM12/21/16
to ang...@googlegroups.com
Am 20.12.2016 um 17:36 schrieb 'Hitendra Sahay' via Angular:
> However - when we access the application from the internet (outside of
> our network), when the .js tries to send it to the php file on the
> middleware using the url = https://serverMiddle/static/php/search1.php,
> we get an error saying ERR_NAME_NOT_RESOLVED ...probably because
> serverMiddle is not knows outsideour network ?
>
> How can we make this three tier architecture work ....where the UI in
> the DMZ talks to the middleware server hosting the PHP files inside our
> firewall talking to the sql sserver insdie our network ?

The main fault in your reasoning is the thought that your "UI is in the
DMZ". It isn't. It may be delivered from a server in the DMZ, but then
it works on the client - i.e. some webbrowser in the Internet - from
where it can't reach to your private PHP server.

So you must move the PHP server into the DMZ or set up a proxy for the
PHP server in the DMZ that exposes only the things you need for your UI.

Anyway you will need someone who fully and properly understands the
technology, otherwise your application will never become secure.

-- Christoph

chanda...@yahoo.com

unread,
Dec 21, 2016, 11:28:29 AM12/21/16
to ang...@googlegroups.com

--------------------------------------------
On Wed, 12/21/16, Christoph Zwerschke <ci...@online.de> wrote:

Subject: Re: [AngularJS] Complete newbie - php/angular.js 3 tier architecture
To: ang...@googlegroups.com
Date: Wednesday, December 21, 2016, 8:37 AM
--
You received this message
because you are subscribed to the Google Groups
"Angular" group.
To unsubscribe
from this group and stop receiving emails from it, send an
email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at
https://groups.google.com/group/angular.
For
more options, visit https://groups.google.com/d/optout.
uteana si hotaraste ca acest salut sa se aduca la cunostinta tuturor acelor natiuni
Reply all
Reply to author
Forward
0 new messages