Is a Flask application running under a production server still a Flask application? - apache

According to Flask's documentation:
You can use the builtin server during development, but you should use
a full deployment option for production applications.
Assume I am using mod_wsgi.
Is Flask still running "under the hood" with Apache delegating to it or is Flask "gone"? According to this SO, one of Flask's obvious limitations is that it is single-threaded. If Apache is just delegating to Flask, wouldn't we run into the same issues? And if not, what is Flask for at all? What makes it a "Flask application"? In other words, is a production Flask application running under an Apache server really a Flask application and if so, why?

Flask is not the development server, it's a framework for handling the request/response cycle of a web application. (The dev server isn't even part of Flask, it's part of Werkzeug.)
A deployed project typically consists of a web server (Apache, Nginx, etc.), an application server (mod_wsgi, uwsgi, gunicorn, etc.), and a WSGI application (Flask in this case).
The development server just makes it easy to run your app when you don't have a real application server set up. In your case, mod_wsgi takes the place of the development server, both of which run the Flask application.

Related

Do we need to reboot Apache web server if we update the source code of website it is hosting?

Well I am not an expert on Apache or any web server, I have recently finished my first web app, so I have rsyncd code to web server /HTML.
The web app is python flask based uses wsgi module to load.
I do not have control over Apache as it's taken care by systems department.
So I cannot test myself in office. I just want to know if we upload updated/modified code to the host machine running apache web server, will it pick up changes or we need to restart the Apache web server?

Apache Tomac Web Server and LOG4J Framework

I am new to Web Service and LAMP Stack.Currently I am working on a Web Application.It is a PHP Based Application that uses Apache Tomcat Web Server 8.0.26 ,MySQL Database ad Linux operating system(LAMP Stack).It has Web Services in Spring.
Following are the issues I am facing with the Application:-
1) Responses are slow over a period of few weeks from a web service hosted on tomcat.
Temporary Solution:-The problem is solved when we restart the Web Server.
2) What are the tools we can use to monitor tomcat / performance ?
Regards
Kaustubh
Take the dump of heap usage before and after of slow down and analyze. And also check your connection pooling with the database, check whether logs are getting rotated properly or not, check the number of active sessions in tomcat admin console.

Is it possible to run ASP.NET 5 site directly on Kestrel in Azure WebApps?

I have checked that in the web response the server is IIS when I deploy ASP.NET5 to azure web app, so I guess the IIS platform handler is used to redirect it to Kestrel. So I am wondering if it is possible to run directly on Kestrel, and what benefits/drawbacks will that have (probably regardless if it's in Azure or not). I suppose it will be a bit faster since IIS will be excluded from the pipline, but it should not be too much overhead I suppose...
On Azure Web App, you cannot bypass IIS.
But in the general case, you can definitely run Kestrel directly. It is after all just dnx web and it's exactly what the XPlat version (Linux, OSX) will end-up using (almost).
What you lose from not using IIS
Security (newer component compared to IIS)
Easy setup of SSL
Kernel module that handle file/cache and other things (kernel = faster)
Application monitoring/Keep-Alive (what happens if Kestrel crash)
Multiple hostnames single-port (80) reuse
etc.
What you gain from not using IIS
Complete control over your process
Higher overall performance
Simpler installation/execution
What you should do if you choose not to use IIS
If you are OK with the "lose" points, I would still go and host your Kestrel behind a reverse proxy or an NGINX server. Kestrel was made to be "production ready" but it's not NGINX or IIS.
It will not keep itself alive as far as I know.
If I missed anything, please let me know.
Your question is a bit ambiguous, as it asks at the same time about Azure Web Apps and about the general case. #Maxime answered the general part, so I'll answer the Azure Web App part.
It is not possible to bypass IIS in Azure Web Apps. Stack that normally run without IIS are typically handled using HttpPlatformHandler (as is the case for ASP.NET 5), or in the case of Node some variant of that (iisnode).

Using dropins in a web app not running in the cloud

I am trying to use the Dropbox drop-ins in one of my projects. It is a web application that should be able to be run locally without a web server. I am using the Dropbox chooser, but it gives an error if it is not running on a web server. It says "invalid origin". Is it possible to get rid of this error without using a local web server to run the application?
You'll probably need to run a local server. Each domain you serve your page from has to be entered in the App console. "localhost" or "127.0.0.1" will work, but those require you to actually run a local web server. (It doesn't have to be a complicated web server... python -m SimpleHTTPServer would work.)

Using Jetty to serve a web application

I am using Jetty for the first time to deploy a GWT web app connecting to a Restlet API and I am trying to understand the best way to use it.
I want to make it embeddable so that I can update config during run-time (allowing me to add new domain names etc).
Our web server currently runs Apache to serve a PHP web app and this will be our first time deploying a GWT app and using Jetty.
Is it possible to use Jetty in parallel with Apache (both serving requests on port 80) and since I am embedding it do I use Apache before it reaches Jetty? So Apache receives request and forwards to Jetty?
Both server cannot run on same port. But you can run both on same machine. So use a separate port for jetty.
Jetty receives the request through its own port and doesn't depend on other server.