-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nginx + AJP - open() failed (13: Permission denied) while reading upstream #3
Comments
Hi, Can you delete the directory of ajp_temp, and run the nginx again? Can you show me you config file? You may get some failures with the test scripts. Because I use the specific webapp pages in the localhost tomcat instance. To use the test scripts, you should copy the nginx_ajp_module/test/webapps/* to your jave servers web directory. And Change the nginx_ajp_module/test/test.sh to point the your path of binary nginx. |
(1)The problem exists after deleting the ajp_temp directory and running the nginx again. My config file is as below: http {
} events { (2) This problem is not relative with the test scripts. The error log is :2011/04/07 09:24:48 [error] 23875#0: *5 open() "/tmp/ajp/test/index.html" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /test/index.html HTTP/1.1", host: "localhost:1984" ------ Comment: this is OK 2011/04/07 09:24:48 [crit] 23875#0: *5 open() "/root/install/ajp_temp/1/00/0000000001" failed (13: Permission denied) while reading upstream, client: 127.0.0.1, server: localhost, request: "GET /test/index.html HTTP/1.1", upstream: "ajp://10.34.63.188:8009", host: "localhost:1984"When I changed the installation to /home1/install/, the Nginx + AJP worked well. I guess that it's related with the root priveleges and Nginx's prefix should not be a subdirectory of /root/ directory. I also discovered that the Nginx document root should not under a subdirctory of /root/. |
This is maybe the problem of user 'nobody', Can you explicitly specify another worker process's user name? |
You are right! I use "user root root;" in nginx config file, and the Nginx + AJP works well. |
Thank you, very usefull! |
When access a web page from Nginx + AJP, my browser can't display the content of the web page.
I found the below failure in error.log:
2011/04/06 10:23:01 [debug] 17578#0: *18 ngx_http_ajp_process_header: state(3)
2011/04/06 10:23:01 [debug] 17578#0: *18 ngx_http_ajp_process_header: parse response, pos:0842F0B8, last:0842F13D
2011/04/06 10:23:01 [debug] 17578#0: *18 ngx_http_ajp_input_filter: state(5)
2011/04/06 10:23:01 [debug] 17578#0: *18 ngx_http_ajp_input_filter: state(7)
2011/04/06 10:23:01 [crit] 17578#0: *18 open() "/root/download/nginx-0.8.54/addons/nginx_ajp_module/test/t/servroot/ajp_temp/1/00/0000000001" failed (13: Permission denied) while reading upstream, client: 127.0.0.1, server: localhost, request: "GET /test/index.html HTTP/1.1", upstream: "ajp://10.34.63.188:8009", host: "localhost:1984"
Condition:
The Nginx prefix is /root/download/nginx-0.8.54/addons/nginx_ajp_module/test/t/servroot/, and I run nginx as root role.
The owner of prefix and ajp_tmep directory is as following, which isn't a problem.
drwxr-xr-x 11 root root 4096 Apr 6 11:55 servroot
drwx------ 2 nobody root 4096 Apr 6 14:21 ajp_temp
The debug info in strace cmd:
[pid 18438] open("/root/download/nginx-0.8.54/addons/nginx_ajp_module/test/t/servroot/ajp_temp/1/00/0000000001", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = -1 EACCES (Permission denied)
I have wondering why this permission problem occur.
The text was updated successfully, but these errors were encountered: