简体   繁体   中英

Deploy Flask app on Apache Server using mod_wsgi and WinSCP

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM