fresh install configuration problem

Max Romanov max.romanov at nginx.com
Tue Jan 5 19:47:22 UTC 2021


Hello,

Most likely it’s a permission issue. Try to specify "user": "ec2-user" for your "demo" app in configuration.
By default, application starts as "nobody" user and have no permissions to access files in other users’ directories.

—
Regards,
Max

> On 5 Jan 2021, at 16:37, Bot-Publishing Inc. <info at botpublishing.com> wrote:
> 
> Hello,
> 
> I installed the latest Unit package for RHEL 8.
> 
> When I try to configure a simple demo app, I am getting:
> 
> 2021/01/05 13:27:07 [info] 13694#13694 "demo" application started
> 2021/01/05 13:27:07 [alert] 13694#13694 Python failed to import module "temp" ModuleNotFoundError: No module named 'temp'
> 2021/01/05 13:27:07 [notice] 13630#13630 process 13694 exited with code 1
> 2021/01/05 13:27:07 [warn] 13633#13633 failed to start application "demo"
> 2021/01/05 13:27:07 [alert] 13633#13633 failed to apply new conf
> 
> The JSON config is as following
> ============================================
> {
>   "listeners": {
>       "*:8080": {
>           "pass": "applications/demo"
>       }
>   },
>   "applications": {
>       "demo": {
>           "type": "python",
>           "path": "/home/ec2-user/bp_tts/tmp/",
>           "module": "temp",
>           "protocol": "wsgi"
>       }
>   }
> }
> 
> temp.py
> ============================================
> def application(environ, start_response):
>     start_response("200 OK", [("Content-Type", "text/plain")])
>     return (b"Hello, Python on Unit!")
> 
> 
> PWD of temp.py
> ============================================
> /home/ec2-user/bp_tts/tmp
> 
> Would appreciate any advice.
> 
> Thank you,
> gen
> _______________________________________________
> unit mailing list
> unit at nginx.org
> https://mailman.nginx.org/mailman/listinfo/unit



More information about the unit mailing list