Fundamentals of web-applications vs http server - http

I am required to preface this question with a disclaimer:
Im sorry if the question is silly and I am sure this information is on the Internet somewhere, but the reason why I ask here is because, I lack the knowledge to begin my research anywhere useful I don't need to read what an http server is, but rather what it's place in a backend environment is. Somehow, I was not able to find anything useful, which is why I believe that the idea I have of this issue at this moment is completely wrong.
I am fairly new to the ins and outs of how the web works. I believe I have good knowledge on how the http protocol works, frontend development and programming. But I don't seem to be able to connect the pieces.
What happens after the request reaches the http server?
Specifically, I can't seem to understand what exactly the back-end means. For example, if someone were to use Django as their backend framework -> what would be the role the application written in python(django) plays? Does it interpret the server request and if so, what are applications such as apache http server used for in a situation such as this?
I don't understand the link between the http server and the web application.
How would you get a web application to run on a server?
I understand that if you just need a web server to serve static html files than apache server would be enough. But how does it work when user data has to be inserted into the html file, or when the database has to be updated as a result of a http request.
I believe this would be the responsibility of the web application, but how do they interact?
tl;dr:
What is the role of an http-server vs role of a web application?
How do they interact?
To point is an http server software such as apache or nginx necessary?

What is the role of an http-server vs role of a web application?
An HTTP-Server is roughly an application that serves files to clients. Basically those files are of HTML type, thus contains hyperlinks that refers to other files.
A web application is just a set of related HTML files, that the user navigates through.
That is the base; as that model can be extended : files can be generated dynamically, of type different than HTML, etc.
How do they interact?
The server manages the files and send them to the client application (usually a web browser).
To point is an http server software such as apache or nginx necessary?
Sure it is, as it is the core infrastructure of a web application. Your web application is a set of HTML files that are accessed through a web-browser that ask the HTTP-server to obtain them.

Related

Why asp.net needs IIS(Internet Information Services) to run web server? How this works in nodejs?

If a web application is developed in Asp.net, IIS is needed to run a webserver.
How these two(Asp.net and IIS) works together? Do IIS takes the build files and runs the server?
How expressjs(A frame work of nodejs) run web server since it isn't using any other software?
I can explain the node.js side of things and hopefully someone else can come along and explain the IIS/ASP.net side of things.
Node.js is a generic Javascript run-time environment. You can build all sorts of apps in it, even applications that have nothing at all to do with a web server.
It so happens that one of the built-in libraries in node.js is an http/https server. So, if you want to build a node.js-driven web server, you just grab the http server object, create a server, start it and program away on request handling.
Express is a web framework that is built on top of the node.js http/https server objects. It uses the built in server and provides a framework around that for defining request handlers, setting up routing and middleware and the middleware API is supports enables all sorts of 3rd party libraries for doing a wide variety of web-server-type things such as authentication, encryption, compression, uploads, downloads, image handling, audio handling, video handling, etc...
What set node.js apart from a number of other web-server frameworks is that node.js didn't start out saying I'm only a tool for doing web server stuff. It started out as a generic programming environment that happened to have a pretty good web server built-in as one of the tools one could use. And, it only takes a few lines of code to create and start your own web server using the built-in support. I would hazard a guess that building web-server apps is perhaps the most popular thing to do with node.js, but certainly not the only thing.
For example, I have a node.js script I wrote that does nightly housecleaning on my disk drive. It removes certain types of files from my temp directory. It helps manage backup files (keeping only the last 10 backups of my Adobe Lightroom catalog). This use of node.js has absolutely nothing to do with a web server. It's just a Javascript run-time environment that I happen to use the file system access libraries in it to do a bunch of file management.
For example, here's code to start a basic web server in plain node.js:
const http = require('http');
const server = http.createServer(function(req, res) {
console.log("got a request from", req.url);
res.end("Hi");
});
// start web server on port 3000
server.listen(3000);

Working with IIS on DMZ

Scenario
I have an application that I have been developing for two years. I use the framework .NET to develop it in a language called Oxygene that comes from Pascal.
When I have something new in my code, I publish my application in File System method. I have a couple servers working on Amazon EC2, so I transfer this files to a folder in my IIS Server. In this IIS Server I already have a website that corresponds to my application, so I just replace the old files for the newest files.
I have another server that works as an SQL server.
Last detail is that in my application the user is able to attach files, import pictures, export PDF and Excel files. Attachments and pictures are stored in the same folder the application is located.
Issue
Here is my problem. I have got a new client that is kind of a big client. It seems like this company has a strong IT security, so the application must be located in their servers.
The big problem is that they required my application to be set in the following architecture:
I am used to only use an app server (works for external access) and a SQL server. They want the third server in DMZ net so they can let external access happen. The reason the application can't be placed in the DMZ is because there are the files I mentioned bellow that the user stores in the application. The database stores all the data, but not those files mentioned.
Solutions I have offered, but won't be accepted:
Publishing the application in a IIS server located in the DMZ: That won't be accepted since my application stores user attachments in the same folder the application is located. There are also images stored there.
Publishing the application in the app server, but also publishing a empty application in the DMZ server redirecting to the IIS server inside the LAN: That's the best solution I have come up.
Using a reverse proxy to protect the LAN Net: This is off the table, since reverse proxy is not safe at all.
I am kind of confused because I can't see a way to separate my application in two to make it work in that suggested architecture.
Can anybody give me a hint or ideas of how this would work?
-
You can't "redirect" to inside the LAN, a redirect is a client-side operation, so if the internal server isn't already exposed, you can't redirect someone to it.
A reverse proxy is likely your best bet. Why do you believe it is not safe? This is a tried-and-true solution, it allows you to leave additional ports/services open to internal requests (like a file server, which it sounds like you are trying to expose).
How are these files getting uploaded? Are you using FTP? SMB? HTTP? This solution will not expose those other protocols to the outside world (please don't expose SMB to the outside, it will result in tragedy). Do the external users need to upload these files?

ASP.NET application to host on Java EE configured directory

One of our clients has a Java EE application. We would like to develop a new project using ASP.NET/C# by hosting the application as a sub directory under this Java EE project.
My questions are:
Will the .NET application run smoothly?
Do I need to keep anything in mind before I make a promise to the client?
The way you strucure your projects do not affect the behavior of your applications at all.
However in the end, each of the compiled and not compiled resources need to be configured propoerly to their proper Web Server, you shouldn't have any problem at all.
IIS has its own directory and Tomcat(or whatever you are using) will have its own directory.
Just let him understand that there is no sense on sharing the projects in a single root folder if the projects are not going to be related at all.
The only way to make them interact is by means of services and queues that you can orchestrate in any of both technologies.
UPDATE
let's suppose that:
you are using default of both web servers: your IIS need your applications to be copied to c:\inetpub folder whereas tomcat uses the $CATALINA_BASE system variable to locate their own folder. That won't be a problem at all.
Now, let's suppose that your client chose the same exact folder to be the root of your websites in tomcat and iis, (very bad maintenance decision by the way)
you could also separate both environments by having two folders : JAVA and DOTNET
Now let's suppose your client won't accept any logic suggestion, and you have to merge java files and aspx files, technically there won't be any issue because each web server will handle requests for very different issues, however, if you are also using the same resources, let's say a picture used in both pages, you will have locked-files issues, your iis can only respond for its own behavior and tomcat will only respond with its own behavior.
So in summary, technically speaking it could work, performance will be hit on your hard drive, it all depends on the request loads of each app, but overall it is a bad infrastructure design.
hope it helps,

Flex app not hitting web service

I have zero knowledge on flex and need help to determine what is preventing my web service from being called.
We have a working application in production and the developer who wrote it has left.
I am trying to build it on my machine and I can see a web service call in fiddler being made with the URL "/Services.asmx/MethodName" (as a GET request).
I have set my break point in the asmx web service and it is not being hit. All I get in the flex front end is a pop up with " The remote server failed to respond and may be offline. http://MachineName/Services.asmx/MethodName"
The web service is in the same application as the web app that hosts the SWF file.
I have the cross domain policy file in place.
What I noticed in fiddler is the URL is "/Services.asmx/MethodName" and not "/WebApp/Services.asmx/MethodName" (not sure if this makes a difference) where WebApp is the IIS virtual directory to the web application that hosts the SWF.
Any ideas?
JD
If you are Web-services and your web-application is same domain then just pass the whole path like "http://..../Services.asmx" for creating web-service api instance in ActionScript 3.0 (for flex). and use this instance name to call your web-service method.
Please read this article from Adobe help for your perfect answer

asp.net application that manages an ftp server

I have a requirement to build an application that a company can use to manage an ftp server. The idea is that through the web app, they can create users which will also create an ftp space etc so that the user can then upload documents and files to the company. The requirement is specifically that clients can use an ftp program and the company manages it through a web application.
I know Plesk provides an API which could be used by an asp.net application, as well as being able to work with IIS directly etc
however, can anyone suggest:
- a .net library that makes this straight forward (or just tell me that IIS is the best way to go)
- a package that does this (even if it costs)
- an alternate ftp server (not the IIS one) that may make this easier
- examples of .net code managing the IIS ftp server
- "just use plesk"! but really, plesk has too much in it, really I just want the ftp management part of plesk
assume it would be running on a windows server with complete control...I was just presuming that I'd interact with the IIS ftp server but cannot find any real examples of managing the ftp side of things (mind you, searching FTP IIS and .Net etc gives a real mixture of results)
thanks heaps!
(do you always find stuff after you ask?)...
This looks exactly what I'm after...
http://learn.iis.net/page.aspx/285/provisioning-sample-in-c/#CreateFTP
But I'm still open to what's out there...has anyone implemented code similar to this?
This would be the best place to start with IIS7: http://msdn.microsoft.com/en-us/library/microsoft.web.administration%28v=VS.90%29.aspx
we've recently started using WinSCP's (winscp.net) scripting/command-line interface (CLI) from Windows Scheduled Tasks calling standard Windows batch files, but i noticed they also have a howto for c#:
C# example link: winscp.net/eng/docs/guide_dotnet#full_c_example

Resources