How to deploy a server script?

Why should I use a web server like Apache or Nginx?

  • I have developed a web application with the Flask framework. Now I want to deploy it on my server. I am really confused because when developing the web app, I can run it with a simple script. But when it comes to deployment ,why should I use a web server like Apache? Why can't I just run the script and turn the debug mode off?

  • Answer:

    While you technically can use the Flask server for deployment, it's not a good idea, and here's why: the Flask server was designed to be a development server.  What this means is that it is most likely lacking a number of features of a production server.  For example, it might not scale well for a large number of users.  It might not have GZIP support.  It might not be multi-threaded.  It might not be as secure as it needs to be.  And I'm sure there are a number of other reasons.  In summary, if you deploy using the Flask server, your website might run slowly and be open for attacks.  You can think of it like going to a Chinese restaurant and ordering pizza.  Sure, you'll get pizza, but it won't be as good as pizza prepared by someone from Italy who has been making it for twenty years.

John Kurlak at Quora Visit the source

Was this solution helpful to you?

Other answers

Putting Apache or nginx in front of a scripting language's web server gives a layer of protection against the Internet. One can think of it as an application-layer firewall which will deal with requests and has a chance to look at them, before forwarding to the more fragile inner layer.

Miguel Paraz

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.