1

I want to deploy my Flask application on an Apache server. I have an account on the server, and have been told that "The server can be used to run scripts and web apps written in Python (using django and mod_wsgi)".

I am on Windows, and to transfer files I have to use an FTP client - so I am using WinSCP.

Installing mod_wsgi is not as straightforward as I expected and I cannot get any clear documentation online.

Because the server can already run Python scripts using mod_wsgi does that mean that I just have to create a .wsgi file or do I still need to download it? I don't know how to go about this.

Paul Rooney
  • 20,879
  • 9
  • 40
  • 61
gbhrea
  • 494
  • 1
  • 9
  • 22
  • 1
    Have you gone through this link: http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi – salmanwahed May 27 '15 at 06:52
  • You probably need to ask the people who provided the server to you as to how Apache is set up, if it is, and how you add apps to it. Going to be hard for us to guess if you have no idea. – Graham Dumpleton May 27 '15 at 07:28
  • @GrahamDumpleton it's Apache 2.4 – gbhrea May 27 '15 at 07:43
  • 1
    Knowing the version doesn't mean anything in itself. When you say you have an account, do you also have super user access? What variant of Linux is it? – Graham Dumpleton May 27 '15 at 07:53
  • 1
    We do not know about the active configuration. The people hosting your apache server should provide instructions on where to put the .wsgi file (if it's a multi-tenant apache, you probably have limited access using FTP and do not have ssh, sudo or access to the apache logs). Start small, using a 'hello world' file. Once you have the wsgi link running, it's time to add the Flask app. – Freek Wiekmeijer May 27 '15 at 08:29
  • @FreekWiekmeijer I've added a new question which is more specific than this, I've made some progress. http://stackoverflow.com/questions/30506385/hello-world-using-mod-wsgi-internal-error-misconfiguration – gbhrea May 28 '15 at 12:21

1 Answers1

1

First you need to check if mod_wsgi is really enabled on the server, then you have to check how your virtual host is configured in apache. There you will find the name you have to give to the wsgi file.

If you have shell access to the server you can do that by using the following commands:

Check mod_wsgi:

sudo apache2ctl -t -D DUMP_MODULES | grep wsgi

Check what name the .wsgi file should have:

sudo grep WSGIScriptAlias /etc/apache2/sites-enabled/yoursite.conf
Bogdan T
  • 371
  • 2
  • 8