I thought python3 some_name.py was used to start the wsgi process for the Apache to take over no?
httpd.conf => https://pastebin.com/LWTiPMkD Accessing at as => http://superhost.gr/ gives forbidden while only works as http://superhost.gr:5000 Στις Παρ, 31 Αυγ 2018 στις 7:17 π.μ., ο/η Graham Dumpleton < [email protected]> έγραψε: > 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 > > On 30 Aug 2018, at 10:47 pm, Νίκος Βέργος <[email protected]> > wrote: > > 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 > > > Τη Πέμπτη, 30 Αυγούστου 2018 - 3:27:48 μ.μ. UTC+3, ο χρήστης Graham > Dumpleton έγραψε: >> >> You are using: >> >> http://superhost.gr/flask_app >> >> aren't you? >> >> You can't use: >> >> http://superhost.gr >> >> 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: >> >> http://superhost.gr/webapp.py >> >> 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 >> >> On 30 Aug 2018, at 10:16 pm, Νίκος Βέργος <[email protected]> wrote: >> >> Here is the updated httpd-vhosts.conf >> I habe reanmes project/ to flask_app >> >> <VirtualHost *:80> >> ServerName superhost.gr >> ServerAdmin [email protected] >> >> 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? >> >> >> Τη Πέμπτη, 30 Αυγούστου 2018 - 2:59:59 μ.μ. UTC+3, ο χρήστης Graham >> Dumpleton έγραψε: >>> >>> 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 >>> >>> On 30 Aug 2018, at 9:51 pm, Graham Dumpleton <[email protected]> >>> wrote: >>> >>> 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. >>> >>> On 30 Aug 2018, at 9:29 pm, Νίκος Βέργος <[email protected]> wrote: >>> >>> 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. >>> >>> -- >>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at https://groups.google.com/group/modwsgi. >>> For more options, visit https://groups.google.com/d/optout. >>> >>> >>> >>> >> -- >> 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 [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/modwsgi. >> For more options, visit https://groups.google.com/d/optout. >> >> >> > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/d/optout. > > > -- > 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 > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
