Re: [modwsgi] RHEL 7 mod_wsgi s.bind Permission denied errors

2019-08-16 Thread Jay Rat
The alias in the Apache config I'll have to look at monday. Think its
/online but cant recall of there is at the end or not

On Fri, Aug 16, 2019, 18:40 Graham Dumpleton 
wrote:

> You didn't answer my other questions.
>
> What does the Location header in responses say?
>
> How do you have WSGIScriptAlias set in the Apache config?
>
> On 17 Aug 2019, at 8:01 am, Jay Rat  wrote:
>
> The http response is 302.
>
> Using blueprints. For the posts the end point is admin/faculty/
> I added a logger into that method and the logger statement at the front of
> the method runs bit the statements in the form processing sections never
> run
>
> On Fri, Aug 16, 2019, 16:24 Graham Dumpleton 
> wrote:
>
>> At what sub path to the site are the post requests being targeted?
>>
>> Sounds more like you have an issue where handler is at /subpath/, but you
>> are using /subpath, and so trailing slash redirection is being tripped.
>>
>> What does the Location header in responses say?
>>
>> How do you have WSGIScriptAlias set in the Apache config?
>>
>> On 17 Aug 2019, at 6:14 am, Jeremy Hawkins  wrote:
>>
>> Thank you.  Removing the app.run() and changing the app to application
>> (using a factory so changed app = create_app() --> application =
>> create_app())
>>
>> Now when running the site via apache the post requests don't seem to be
>> running.  They all return the http code of 302 (found) instead of 200 like
>> they do when I run the app directly in python.  I am not seeing any errors
>> in any logs and the path the post is using is being formed correctly by the
>> url_for function.  I'd almost say the post request aren't passing data to
>> the wsgi application?
>>
>> On Friday, August 16, 2019 at 1:21:16 AM UTC-5, Graham Dumpleton wrote:
>>>
>>> You shouldn't be invoking app.run() when hosting under mod_wsgi as that
>>> is trying to start its own server.
>>>
>>> You should use a check like:
>>>
>>> if __name__ == "__main__":
>>> 
>>>
>>> around the parts of the Flask code where the Flask development server is
>>> started so that it isn't run when that file is imported in a context other
>>> than being a main program.
>>>
>>> What mod_wsgi is expecting is a WSGI application entry point called
>>> "application". See:
>>>
>>> https://flask.palletsprojects.com/en/1.1.x/deploying/mod_wsgi/
>>>
>>> On 16 Aug 2019, at 4:34 am, Jeremy Hawkins  wrote:
>>>
>>> I am trying to run a flask app as a script with Apache 2.4 under a Red
>>> Hat Enterprise Linux 7.6
>>>
>>> I got the app to the point where it will run if a do use python app.wsgi
>>> (within that directory).
>>>
>>> When I try to run it from apach using the mod_wsgi I get the following
>>> errors in the logs.
>>>
>>> I have tried everything that I can run across to try to resolve this
>>> issue.  I am at a lost to even figure what is actually causing this issue.
>>>
>>>
>>> Error Log:
>>> mod_wsgi (pid=4159): Exception occurred processing WSGI script
>>> '/var/projects/janus/app.wsgi'.
>>> Traceback (most recent call last):
>>> File "/var/projects/janus/app.wsgi", line 11, in 
>>> app.run(host="0.0.0.0")
>>> File
>>> "/var/projects/janus/venv/lib/python3.6/site-packages/flask/app.py", line
>>> 990, in run
>>> run_simple(host, port, self, **options)
>>> File
>>> "/var/projects/janus/venv/lib/python3.6/site-packages/werkzeug/serving.py",
>>> line 987, in run_simple
>>> s.bind(server_address)
>>> PermissionError: [Errno 13] Permission denied
>>>
>>>
>>> --
>>> 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 mod...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/modwsgi/6ffd7529-a989-45de-9ce3-5b3466915623%40googlegroups.com
>>> <https://groups.google.com/d/msgid/modwsgi/6ffd7529-a989-45de-9ce3-5b3466915623%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "modwsgi" group.
>> To unsubscribe from this group and stop 

Re: [modwsgi] RHEL 7 mod_wsgi s.bind Permission denied errors

2019-08-16 Thread Jay Rat
The http response is 302.

Using blueprints. For the posts the end point is admin/faculty/
I added a logger into that method and the logger statement at the front of
the method runs bit the statements in the form processing sections never
run

On Fri, Aug 16, 2019, 16:24 Graham Dumpleton 
wrote:

> At what sub path to the site are the post requests being targeted?
>
> Sounds more like you have an issue where handler is at /subpath/, but you
> are using /subpath, and so trailing slash redirection is being tripped.
>
> What does the Location header in responses say?
>
> How do you have WSGIScriptAlias set in the Apache config?
>
> On 17 Aug 2019, at 6:14 am, Jeremy Hawkins  wrote:
>
> Thank you.  Removing the app.run() and changing the app to application
> (using a factory so changed app = create_app() --> application =
> create_app())
>
> Now when running the site via apache the post requests don't seem to be
> running.  They all return the http code of 302 (found) instead of 200 like
> they do when I run the app directly in python.  I am not seeing any errors
> in any logs and the path the post is using is being formed correctly by the
> url_for function.  I'd almost say the post request aren't passing data to
> the wsgi application?
>
> On Friday, August 16, 2019 at 1:21:16 AM UTC-5, Graham Dumpleton wrote:
>>
>> You shouldn't be invoking app.run() when hosting under mod_wsgi as that
>> is trying to start its own server.
>>
>> You should use a check like:
>>
>> if __name__ == "__main__":
>> 
>>
>> around the parts of the Flask code where the Flask development server is
>> started so that it isn't run when that file is imported in a context other
>> than being a main program.
>>
>> What mod_wsgi is expecting is a WSGI application entry point called
>> "application". See:
>>
>> https://flask.palletsprojects.com/en/1.1.x/deploying/mod_wsgi/
>>
>> On 16 Aug 2019, at 4:34 am, Jeremy Hawkins  wrote:
>>
>> I am trying to run a flask app as a script with Apache 2.4 under a Red
>> Hat Enterprise Linux 7.6
>>
>> I got the app to the point where it will run if a do use python app.wsgi
>> (within that directory).
>>
>> When I try to run it from apach using the mod_wsgi I get the following
>> errors in the logs.
>>
>> I have tried everything that I can run across to try to resolve this
>> issue.  I am at a lost to even figure what is actually causing this issue.
>>
>>
>> Error Log:
>> mod_wsgi (pid=4159): Exception occurred processing WSGI script
>> '/var/projects/janus/app.wsgi'.
>> Traceback (most recent call last):
>> File "/var/projects/janus/app.wsgi", line 11, in 
>> app.run(host="0.0.0.0")
>> File "/var/projects/janus/venv/lib/python3.6/site-packages/flask/app.py",
>> line 990, in run
>> run_simple(host, port, self, **options)
>> File
>> "/var/projects/janus/venv/lib/python3.6/site-packages/werkzeug/serving.py",
>> line 987, in run_simple
>> s.bind(server_address)
>> PermissionError: [Errno 13] Permission denied
>>
>>
>> --
>> 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 mod...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/modwsgi/6ffd7529-a989-45de-9ce3-5b3466915623%40googlegroups.com
>> 
>> .
>>
>>
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/modwsgi/103fd512-f17f-40ab-8744-01972ca81aee%40googlegroups.com
> 
> .
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/modwsgi/8F149628-B662-44D5-A725-4EBCFFB9A981%40gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/CABnGW5o5yqMeXjhR0kjM_r_OV2PT9RZAUfcs%2B5MxMGoXP1rSxQ%40mail.gmail.com.