Python Flask wsgi app cannot work with WSGI Module

413 views
Skip to first unread message

nikos.at....@gmail.com

unread,
Aug 29, 2018, 8:01:50 PM8/29/18
to modwsgi
<VirtualHost *:80>
    ServerName superhost.gr
    ServerAdmin nikos@superhost.gr

    WSGIDaemonProcess public_html user=nikos group=nikos processes=1 threads=5
    WSGIScriptAlias / /home/nikos/public_html/webapp.py

    ProxyPass / http://superhost.gr:5000/
    ProxyPassReverse / http://superhost:5000/

    <Directory /home/nikos/public_html>
        WSGIProcessGroup public_html
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptReloading On

       AddHandler wsgi-script .wsgi .py
       Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI

       AllowOverride None
       Require all granted
   </Directory>
</VirtualHost>

Hello, 3 days now i;m facing the same problem i have installed python36u-mod_wsgi module because mod_wsgi coudl not be isntalled.
I reinstalled anything from scratch but still my wsgi webapp.py application wont run.
Please help me out. The above is httpd-vhosts.conf  as i have configured it.
I'am running on centOS 7 with python36u installed and Apache Web Server.

Graham Dumpleton

unread,
Aug 29, 2018, 8:04:20 PM8/29/18
to mod...@googlegroups.com
What is the full details of the error you are getting? Apache error message in browser. Errors in log including any Python stack trace.

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

nikos.at....@gmail.com

unread,
Aug 30, 2018, 5:08:25 AM8/30/18
to modwsgi
Hello the flask vevelopmnet web server listens on http://superhost.gr:5000 and runs but in does not listen to http://superhost.gr:80 which is being managed by Apache.
It seem like Apache is not aware of mod_wsgi application. Here:

 

[root@superhost ~]# yum list installed | grep python36
python36u.x86_64                  3.6.5-1.ius.centos7      @ius                 
python36u-devel.x86_64            3.6.5-1.ius.centos7      @ius                 
python36u-libs.x86_64             3.6.5-1.ius.centos7      @ius                 
python36u-mod_wsgi.x86_64         4.6.2-1.ius.centos7      @ius                 
python36u-pip.noarch              9.0.1-1.ius.centos7      @ius                 
python36u-setuptools.noarch       39.0.1-1.ius.centos7     @ius   

and

[root@superhost public_html]# mod_wsgi-express start-server webapp.py
[nikos@superhost public_html]$  mod_wsgi-express start-server webapp.py
Server URL         : http://localhost:8000/
Server Root        : /tmp/mod_wsgi-localhost:8000:1021
Server Conf        : /tmp/mod_wsgi-localhost:8000:1021/httpd.conf
Error Log File     : /tmp/mod_wsgi-localhost:8000:1021/error_log (warn)
Request Capacity   : 5 (1 process * 5 threads)
Request Timeout    : 60 (seconds)
Startup Timeout    : 15 (seconds)
Queue Backlog      : 100 (connections)
Queue Timeout      : 45 (seconds)
Server Capacity    : 20 (event/worker), 20 (prefork)
Server Backlog     : 500 (connections)
Locale Setting     : en_US.UTF-8
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8000
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8000
no listening sockets available, shutting down
AH00015: Unable to open logs
[nikos@superhost public_html]$ 

All i want to do is wehn my flask webapp.py run is intead of being run by the development server on port 5000 to be run by Aapche on port 80.
I dont know why epxress module mentiones port 8000 .....

Graham Dumpleton

unread,
Aug 30, 2018, 5:34:15 AM8/30/18
to mod...@googlegroups.com
A few things.

The first is that mod_wsgi-express is intended for running a distinct Apache instance to you main Apache instance. It mentions port 8000 because that is the port it will use by default. So it isn't modifying your main Apache installation and you can't take over port 80 when using it unless you disable your main Apache instance and then do various configuration to have it run on port 80 as explained in:


The second is that mod_wsgi-express is showing an error that something is already using port 8000, so you can't use that port either.

Finally, if you are installing 'python36u-mod_wsgi.x86_64' you shouldn't even need to install mod_wsgi-express separately as you have. Just configure your main Apache to host your WSGI application using mod_wsgi and don't use mod_wsgi-express.

See the Flask docs for an example. You will be using a different system mod_wsgi package is all.

Νίκος @ SuperHost

unread,
Aug 30, 2018, 6:05:41 AM8/30/18
to mod...@googlegroups.com
ok, i have un-installed python36u-mod_wsgi and just installes yum install mod_wsgi

then i used the configuration i mentioned in my 1st post and i still get this error whn i http://superhost.gr

Forbidden: You don't have permission to access / on this server.

Why Apache since i have configured it correctly wont take over ?
Then only way i cna see my webpage is only if i http://superhost.gr:5000

I need the latter to send data on Apache's port 80. Why isnt this happening?



You received this message because you are subscribed to a topic in the Google Groups "modwsgi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modwsgi/qUrloVGZRDA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modwsgi+u...@googlegroups.com.

Graham Dumpleton

unread,
Aug 30, 2018, 6:09:10 AM8/30/18
to mod...@googlegroups.com
Which is possibly because your home directory /home/nikos is not accessible to the Apache user, or SELinux prevents Apache from hosting files from there.

It is usually a better idea to place the project under a directory such as /var/www/projects.

What do you get when you run:

    ls -lasd /home/nikos

Graham

Νίκος @ SuperHost

unread,
Aug 30, 2018, 6:25:23 AM8/30/18
to mod...@googlegroups.com
[nikos@superhost public_html]$ ls -lasd /home/nikos
4 drwxr-x--- 15 nikos nikos 4096 Aug 30 13:10 /home/nikos
Yes, because i was moving from another webhost company there some lines with groups inside httpd.conf starting with Suexec that i removed by hand now 5 mins ago.
Perhaps SuLinux prevtns accessing to /home/nikos. How can i entirely disable it?

Graham Dumpleton

unread,
Aug 30, 2018, 6:42:36 AM8/30/18
to mod...@googlegroups.com
It is not SELinux, it is because Apache can't see inside of your home directory.

Your home directory is: drwxr-x---

This means other users can't see into it, including Apache.

Try going:

    chmod o+rx /home/nikos

and see if it makes a difference.

Graham

Νίκος @ SuperHost

unread,
Aug 30, 2018, 6:51:42 AM8/30/18
to mod...@googlegroups.com
After:

[root@superhost public_html]# ls -lasd ../
4 drwxr-xr-x 15 nikos nikos 4096 Aug 30 13:10 ../
Still:

Forbidden

You don't have permission to access / on this server.

Graham Dumpleton

unread,
Aug 30, 2018, 6:54:37 AM8/30/18
to mod...@googlegroups.com
You should not totally disable SELinux, especially if you don't understand what it is for.

You can temporarily disable it to see if that is the issue. See:


What permissions though are all the other directories in the path down to the WSGI script file. They all need to be accessible to Apache, as does the WSGI script file.

Νίκος @ SuperHost

unread,
Aug 30, 2018, 7:08:47 AM8/30/18
to mod...@googlegroups.com
[root@superhost public_html]# ls -lasd /home/nikos
4 drwxr-xr-x 15 nikos nikos 4096 Aug 30 13:10 /home/nikos
[root@superhost public_html]# ls -lasd /home/nikos/public_html/
4 drwxr-xr-x 7 nikos nikos 4096 Aug 30 12:34 /home/nikos/public_html/
[root@superhost public_html]# ll webapp.py 
-rwxr-xr-x 1 nikos nikos 13681 Aug 30 13:46 webapp.py
[root@superhost public_html]# 

Νίκος Βέργος

unread,
Aug 30, 2018, 7:29:06 AM8/30/18
to modwsgi
ok have disabled it and rerun apache

[root@superhost public_html]# sestatus
SELinux status:                 disabled

Still iam presenting the same error.

SELinux is disabled and paths and wsgi permisssions are 755 and still the wsgi app won't run.

Graham Dumpleton

unread,
Aug 30, 2018, 7:52:05 AM8/30/18
to mod...@googlegroups.com
Did you fully stop and restart Apache in case doesn't pick up change in state of SELinux.

Also, can you try putting it under '/var/www/project'?

That is under where Apache normally expects stuff to be.

Graham Dumpleton

unread,
Aug 30, 2018, 7:59:59 AM8/30/18
to mod...@googlegroups.com
Also, do you still have:

    ProxyPass / http://superhost.gr:5000/
    ProxyPassReverse / http://superhost:5000/

in the config. You shouldn't as that would try and proxy all your traffic through to the Flask development server instance.

Graham

Νίκος @ SuperHost

unread,
Aug 30, 2018, 8:04:36 AM8/30/18
to mod...@googlegroups.com
Yes, i did server times restarting httpd.

( as root )
mkdir /var/ww/projects
cp -R static/ templates/ webapp.py /var/www/projects/

Still Forbidden !!

You received this message because you are subscribed to a topic in the Google Groups "modwsgi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modwsgi/qUrloVGZRDA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modwsgi+u...@googlegroups.com.

Νίκος @ SuperHost

unread,
Aug 30, 2018, 8:07:23 AM8/30/18
to mod...@googlegroups.com
OK, ill remove that too.
Would it be any good if it were enabled?

Νίκος Βέργος

unread,
Aug 30, 2018, 8:16:38 AM8/30/18
to modwsgi
Here is the updated httpd-vhosts.conf
I habe reanmes project/ to flask_app

<VirtualHost *:80>
    ServerName superhost.gr
    ServerAdmin ni...@superhost.gr
   
    DocumentRoot /var/www/flask_app
    AddHandler wsgi-script .wsgi .py

    WSGIDaemonProcess flask_app user=root group=root processes=1 threads=5
    WSGIScriptAlias /flask_app /var/www/flask_app/webapp.py


    <Directory /var/www/flask_app>     
        WSGIProcessGroup flask_app  
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptReloading On

        Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI

        AllowOverride None
        Require all granted
   </Directory>


    ErrorLog /home/nikos/public_html/logs/error.log
    CustomLog /home/nikos/public_html/logs/requests.log combined
</VirtualHost>

Still Forbidden.
Should the user be nikos or root? and the ownership of the files? or perhaps Apache?

Graham Dumpleton

unread,
Aug 30, 2018, 8:27:48 AM8/30/18
to mod...@googlegroups.com
You are using:


aren't you?

You can't use:


because you have set the mount point for the application as:

    /flask_app

in the WSGIScriptAlias.

Another thing you should not have in there is:

    DocumentRoot /var/www/flask_app

You should never set DocumentRoot to be a parent directory of your source code.

As it is, someone could likely use:


which would try and execute that file when you don't want that, or they could even download your source code.

So don't set DocumentRoot. Also don't put in:

    AddHandler wsgi-script .wsgi .py

That isn't needed and could cause other complications in some cases.

Graham

Νίκος @ SuperHost

unread,
Aug 30, 2018, 8:44:29 AM8/30/18
to mod...@googlegroups.com
I have corrected all the error you mentioned to me and thank you for doing so.

Still iam gettign the usual forbidden error.

Another weird thing which will reveal something  iimagine is that although i have renames my script from webapp.py to some_name.py

http://superhost.gr/webapp.py still displayes the code, and thankfully it wont run.

But my wsgi script still wont run.

You received this message because you are subscribed to a topic in the Google Groups "modwsgi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modwsgi/qUrloVGZRDA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modwsgi+u...@googlegroups.com.

Νίκος Βέργος

unread,
Aug 30, 2018, 8:47:37 AM8/30/18
to modwsgi
Here is when i try to run it.
Does it matter because iam under root? Does it have to be 'nikos' user?

[root@superhost flask_app]# pwd
/var/www/flask_app
[root@superhost flask_app]# python3 somename.py 
 * Serving Flask app "somename" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://superhost.gr:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 196-393-755

Graham Dumpleton

unread,
Aug 31, 2018, 12:17:01 AM8/31/18
to mod...@googlegroups.com
You shouldn't be running 'python3 somename.py' at same time. That has nothing to do with running it under Apache/mod_wsgi.

What is the current Apache configuration you are using, and what URL are you using in the web browser?

Graham

Νίκος @ SuperHost

unread,
Aug 31, 2018, 4:27:58 AM8/31/18
to mod...@googlegroups.com
I thought python3 some_name.py was used to start the wsgi process for the Apache to take over no?


Accessing at as  =>  http://superhost.gr/ gives forbidden while only works as http://superhost.gr:5000

You received this message because you are subscribed to a topic in the Google Groups "modwsgi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modwsgi/qUrloVGZRDA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modwsgi+u...@googlegroups.com.

Graham Dumpleton

unread,
Aug 31, 2018, 4:42:09 AM8/31/18
to mod...@googlegroups.com

On 31 Aug 2018, at 6:27 pm, Νίκος @ SuperHost <nikos.at....@gmail.com> wrote:

I thought python3 some_name.py was used to start the wsgi process for the Apache to take over no?

No. Is a completely separate instance.


Not your main Apache configuration, just the virtual host file with mod_wsgi set up for application

Accessing at as  =>  http://superhost.gr/ gives forbidden while only works as http://superhost.gr:5000

As I said before, because you are using:

    WSGIScriptAlias /flask_app /var/www/flask_app/webapp.py

where the WSGI application is mounted at /flask_app, you must use as URL:


If you want it to be hosted at the root of the site, use:

    WSGIScriptAlias / /var/www/flask_app/webapp.py

Graham

Νίκος @ SuperHost

unread,
Aug 31, 2018, 4:55:33 AM8/31/18
to mod...@googlegroups.com
Ah i forgot to mention that because on /var/www/ we had the same forbidden error i took the site back to nikos public. Here:

<VirtualHost *:80>
    ServerName superhost.gr
    ServerAdmin ni...@superhost.gr

    WSGIDaemonProcess public_html user=nikos group=nikos processes=1 threads=5
    WSGIScriptAlias / /home/nikos/public_html/some_page.py


    <Directory /home/nikos/public_html>
        WSGIProcessGroup public_html
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptReloading On 

        Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI

        AllowOverride None
        Require all granted
   </Directory>


    ErrorLog /home/nikos/public_html/logs/error.log
    CustomLog /home/nikos/public_html/logs/requests.log combined
</VirtualHost>

Graham Dumpleton

unread,
Aug 31, 2018, 5:35:15 AM8/31/18
to mod...@googlegroups.com
What other VirtualHost definitions do you have which use the same ServerName value of 'superhost.gr'?

Νίκος Βέργος

unread,
Aug 31, 2018, 8:01:36 AM8/31/18
to modwsgi
I have no other vosts file except the part on the httpd.conf file:

  1. <VirtualHost 176.223.129.220:80 [fe80::21c:42ff:fe91:a981]:80>
  2. ServerName superhost.gr
  3. ServerAlias www.superhost.gr
  4. ServerAlias admin.superhost.gr
  5. DocumentRoot /home/nikos/public_html
  6. ErrorLog /var/log/virtualmin/superhost.gr_error_log
  7. CustomLog /var/log/virtualmin/superhost.gr_access_log combined
  8. ScriptAlias /cgi-bin/ /home/nikos/cgi-bin/
  9. ScriptAlias /AutoDiscover/AutoDiscover.xml /home/nikos/cgi-bin/autoconfig.cgi
  10. ScriptAlias /Autodiscover/Autodiscover.xml /home/nikos/cgi-bin/autoconfig.cgi
  11. ScriptAlias /autodiscover/autodiscover.xml /home/nikos/cgi-bin/autoconfig.cgi
  12. DirectoryIndex index.html index.htm index.php index.php4 index.php5
  13.  
  14.  
  15. <Directory /home/nikos/public_html>
  1. Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
  1. allow from all
  2. AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
  3. Require all granted
  4. </Directory>
  5.  
  6.  
  7. <Directory /home/nikos/cgi-bin>
  8. allow from all
  9. AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
  10. Require all granted
  11. </Directory>
  12.  
  13.  
  14. RewriteEngine on
  15. RewriteCond %{HTTP_HOST} =webmail.superhost.gr
  16. RewriteRule ^(.*) https://superhost.gr:20000/ [R]
  17. RewriteCond %{HTTP_HOST} =admin.superhost.gr
  18. RewriteRule ^(.*) https://superhost.gr:10000/ [R]
  19. RemoveHandler .php
  20. RemoveHandler .php7.2
  21. php_admin_value engine Off
  22. Alias /dav /home/nikos/public_html
  23. <Location /dav>
  24. DAV on
  25. AuthType Basic
  26. AuthName "superhost.gr"
  27. AuthUserFile /home/nikos/etc/dav.digest.passwd
  28. Require valid-user
  29. ForceType text/plain
  30. Satisfy All
  31. RemoveHandler .php
  32. RemoveHandler .php7.2
  33. RewriteEngine off
  34. </Location>
  35. Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
  36. Redirect /.well-known/autoconfig/mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
  37. php_value memory_limit 32M
  38. <FilesMatch \.php$>
  39. SetHandler proxy:fcgi://localhost:8004
  40. </FilesMatch>
  41. </VirtualHost>

Νίκος Βέργος

unread,
Aug 31, 2018, 10:40:43 AM8/31/18
to modwsgi
Also i want to show you this structure in case it helps. Perhpas php7.2 and cgi-bin gives us trouble?

[root@superhost nikos]# ll
total 140
lrwxrwxrwx 1 root  root     32 Aug 18 01:37 cgi-bin -> /home/nikos/public_html/cgi-bin/
drwxr-xr-x 5 nikos nikos  4096 Aug 30 19:17 etc
drwxr-xr-x 2 nikos nikos  4096 May 21 09:28 fcgi-bin
drwxr-xr-x 2 nikos nikos  4096 May 19 20:58 homes
drwxr-x--- 2 nikos nikos  4096 Aug 18 01:34 logs
drwx------ 9 nikos nikos  4096 Aug 29 13:24 Maildir
drwxr-xr-x 7 nikos nikos  4096 Aug 31 14:50 public_html
-rwxr-xr-x 1 nikos nikos  1647 Aug 21 12:40 ssl.ca
-rwx------ 1 nikos nikos  2264 Aug 21 12:40 ssl.cert
-rwx------ 1 nikos nikos  3911 Aug 21 12:40 ssl.combined
-rwx------ 1 nikos nikos  5586 Aug 21 12:40 ssl.everything
-rwx------ 1 nikos nikos  1675 Aug 21 12:40 ssl.key
drwxr-x--- 2 nikos nikos 86016 Aug 31 13:34 tmp
drwx------ 2 nikos nikos  4096 Aug 18 01:34 virtualmin-backup
[root@superhost nikos]# ll cgi-bin/
total 4
-rwxr-xr-x 1 nikos nikos 231 Aug 29 17:54 php7.2.cgi
[root@superhost nikos]# 
 

Νίκος @ SuperHost

unread,
Aug 31, 2018, 4:36:36 PM8/31/18
to mod...@googlegroups.com
I have no other vhosts files just the following directives within httpd.conf

    1. <VirtualHost 176.223.129.220:80 [fe80::21c:42ff:fe91:a981]:80>
    2. ServerName superhost.gr
    3. ServerAlias www.superhost.gr
    4. ServerAlias admin.superhost.gr
    5. DocumentRoot /home/nikos/public_html
    6. ErrorLog /var/log/virtualmin/superhost.gr_error_log
    7. CustomLog /var/log/virtualmin/superhost.gr_access_log combined
    8. ScriptAlias /cgi-bin/ /home/nikos/cgi-bin/
    9. ScriptAlias /AutoDiscover/AutoDiscover.xml /home/nikos/cgi-bin/autoconfig.cgi
    10. ScriptAlias /Autodiscover/Autodiscover.xml /home/nikos/cgi-bin/autoconfig.cgi
    11. ScriptAlias /autodiscover/autodiscover.xml /home/nikos/cgi-bin/autoconfig.cgi
    12. DirectoryIndex index.html index.htm index.php index.php4 index.php5
    13.  
    14.  
    15. <Directory /home/nikos/public_html>
    1. Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
    1. </VirtualHost>

    Νίκος Βέργος

    unread,
    Sep 1, 2018, 3:03:32 AM9/1/18
    to modwsgi
    is it possbile a line like that is missing and should be appllied to httpd-vhosts.conf ?

    LoadModule wsgi_module modules/mod_wsgi.so

    Νίκος Βέργος

    unread,
    Sep 2, 2018, 4:41:25 PM9/2/18
    to modwsgi
    Please tell me that we can resolve this. Its 4 days now and i still haven't figured it out. I tried everything in my knowledge.

    Graham Dumpleton

    unread,
    Sep 2, 2018, 8:32:07 PM9/2/18
    to mod...@googlegroups.com

    On 1 Sep 2018, at 5:03 pm, Νίκος Βέργος <nikos.at....@gmail.com> wrote:

    is it possbile a line like that is missing and should be appllied to httpd-vhosts.conf ?

    LoadModule wsgi_module modules/mod_wsgi.so
    If that was missing then Apache should have given an error as soon as it saw any WSGI directive.

    If you have found you don't have that, then your virtual host site file mustn't even be looked at. If using Debian/Ubuntu, is the virtual host site file in the sites-available directory and then been enabled so it is symlinked in the sites-enabled directory? If using CentOS/Fedora, is the virtual host site file include in the main Apache configuration file?

    Did you try the changes related to using a separate 'python.superhost.gr' host name?

    Can you validate the virtual host site file is even being read, if it is a separate file, by adding a syntax error into it? Just add a new line in the VirtualHost of 'XXX'. That isn't obviously a valid directive and so should create an error when you restart or start Apache.

    Graham

    Νίκος Βέργος

    unread,
    Sep 3, 2018, 2:27:54 AM9/3/18
    to modwsgi
    >Can you validate the virtual host site file is even being read, if it is a separate file, by adding a syntax error into it? Just add a new line in the VirtualHost of 'XXX'. That isn't obviously a valid directive and so >should create an error when you restart or start Apache.

    Hello Graham,

    I just added 'XXX' in '/etc/httpd/conf/httpd-vhosts.conf' and Apache restarted without error. So, you are right it does NOT evan being read the whole time! I'am using CemtOS by the way.

    >If using CentOS/Fedora, is the virtual host site file include in the main Apache configuration file?

    I don't know. How can i check that Directive if is present? What's its name?

    Graham Dumpleton

    unread,
    Sep 3, 2018, 3:35:32 AM9/3/18
    to mod...@googlegroups.com
    Look for existing lines in main Apache configuration file of:

    # Virtual hosts
    #Include /private/etc/apache2/extra/httpd-vhosts.conf

    The '#' is a comment character. Remove the '#' in front of the 'Include' line.

    Graham

    Νίκος @ SuperHost

    unread,
    Sep 3, 2018, 3:54:37 AM9/3/18
    to mod...@googlegroups.com
    I just checked, there arent present, Also you line seems to search for Debian distro while iam using CentOS.

    You received this message because you are subscribed to a topic in the Google Groups "modwsgi" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/modwsgi/qUrloVGZRDA/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to modwsgi+u...@googlegroups.com.

    Graham Dumpleton

    unread,
    Sep 3, 2018, 3:57:42 AM9/3/18
    to mod...@googlegroups.com
    The example is not Debian, it is from macOS.

    Just add the 'Include' at the end of httpd.conf and give it the full path name to your file for your virtual host.

    If you don't have a LoadModule line for wsgi_module, you will need to add it before including the file, or at the start of the virtual host file.

    Graham

    Νίκος @ SuperHost

    unread,
    Sep 3, 2018, 4:01:21 AM9/3/18
    to mod...@googlegroups.com
    LoadModule wsgi_module modules/mod_wsgi.so
    Include /etc/httpd/conf/httpd-vhosts.conf
    Iam using python36u-mod_wsgi though? is the loadmodule still the same?

    Graham Dumpleton

    unread,
    Sep 3, 2018, 4:02:41 AM9/3/18
    to mod...@googlegroups.com
    I have no idea what the module file is called for that distro. Look in the Apache modules directory to confirm you have it and what it is called.

    Νίκος @ SuperHost

    unread,
    Sep 3, 2018, 4:03:54 AM9/3/18
    to mod...@googlegroups.com
    -- Unit httpd.service has begun starting up.
    Sep 03 11:02:49 mail.superhost.gr httpd[16243]: httpd: Syntax error on line 1 of /etc/httpd/conf/httpd.conf: Cannot load modules/mod_wsgi.so into server: /etc/httpd/modules/mod_wsgi.so: cannot open shared object file: No such file
    Sep 03 11:02:49 mail.superhost.gr systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
    Sep 03 11:02:49 mail.superhost.gr kill[16245]: kill: cannot find process ""
    Sep 03 11:02:49 mail.superhost.gr systemd[1]: httpd.service: control process exited, code=exited status=1
    Sep 03 11:02:49 mail.superhost.gr systemd[1]: Failed to start The Apache HTTP Server.

    Νίκος @ SuperHost

    unread,
    Sep 3, 2018, 4:06:15 AM9/3/18
    to mod...@googlegroups.com
    i removed python36u-mod_wsgi and yum install mod_wsgi but iam still gettign the same error.

    Νίκος @ SuperHost

    unread,
    Sep 3, 2018, 4:18:01 AM9/3/18
    to mod...@googlegroups.com
    i cant make it work please do help. i have install tha normal mod_wsgi but still it provides an error.

    Νίκος Βέργος

    unread,
    Sep 3, 2018, 4:33:20 AM9/3/18
    to modwsgi
    Okey i managed to put correctly those  2 lines an put them on the top of httpd.conf

    LoadModule wsgi_module modules/mod_wsgi.so
    Include /etc/httpd/conf/httpd-vhosts.conf

    i restarted the web server and http://superhost.gr/

    and then still the forbidden error :-((

    Νίκος Βέργος

    unread,
    Sep 3, 2018, 5:12:27 PM9/3/18
    to modwsgi
    I Removed both mod_wsgi and python36u-mod_wsgi as well. I installed yum install httpd-devel to get rid of the 'apsx' issue. Here is the results of the express install.
     mod mod_wsgi-express install-module
     LoadModule wsgi_module "/usr/lib64/httpd/modules/mod_wsgi-py36.c
     python-36m-x86_64-linux-gnu.so" WSGIPythonHome "/usr" 
     Do you make anyhting out of it as to why still cannot load my wsgi file? I'm still getting the forbidden error.... :-(
    Reply all
    Reply to author
    Forward
    0 new messages