Flask wsgi app cannot work with WSGI Module

Issues related to applications and software problems
NikosThess
Posts: 19
Joined: 2018/05/10 20:36:20

Re: Flask wsgi app cannot work with WSGI Module

Post by NikosThess » 2018/09/06 21:04:03

So, how you think i should set it up? i only want wsgi to run in domain superhost.gr and i have only 3 scripts inside it.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Flask wsgi app cannot work with WSGI Module

Post by hunter86_bg » 2018/09/07 04:41:38

I will try to recreate your setup and will provide the setup steps.
Keeep in mind that I use and recomend SELINUX for internet facing systems. The positives are much more than the complexity.

NikosThess
Posts: 19
Joined: 2018/05/10 20:36:20

Re: Flask wsgi app cannot work with WSGI Module

Post by NikosThess » 2018/09/07 08:30:44

Thanks for your time and effort!

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Flask wsgi app cannot work with WSGI Module

Post by hunter86_bg » 2018/09/10 08:21:53

Ok, I have deployed a simple wsgi on a test instance and here is my history .
The sample wsgi code is this one:

Code: Select all

def application(environ, start_response):
    status = '200 OK'
    output = b'Hello World!'

    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)

    return [output]
As you can see, wcgi works even as "/" like a charm without any issues.

Repo list:

Code: Select all

]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.steadfastnet.com
 * epel: mirror.steadfastnet.com
 * extras: ftpmirror.your.org
 * updates: mirrors.liquidweb.com
repo id                                                       repo name                                                                                status
base/7/x86_64                                                 CentOS-7 - Base                                                                           9,911
epel/x86_64                                                   Extra Packages for Enterprise Linux 7 - x86_64                                           12,672
extras/7/x86_64                                               CentOS-7 - Extras                                                                           402
google-cloud-compute                                          Google Cloud Compute                                                                         10
google-cloud-sdk                                              Google Cloud SDK                                                                            278
updates/7/x86_64                                              CentOS-7 - Updates                                                                        1,333
repolist: 24,606
Edit: I forgot to provide the conf before deleting the instance, but it should be something like:

Code: Select all

<Directory /srv/myapp>
          Require all granted
</Directory>
<VirtualHost *:80>
    DocumentRoot "/var/www/html"
    ServerName your-FQDN

    WSGIScriptAlias / /srv/myapp/myapp.py
</VirtualHost>

Post Reply