Page 5 of 5

Re: Bad Gateway

PostPosted: Tue Jan 06, 2015 4:25 pm
by manics
Hi

Thanks for helping to debug the problem! Based on those messages I think the following should work:
Code: Select all
semanage port -a -t http_port_t -p tcp 4080
setsebool -P httpd_read_user_content 1


It seams, that I have to change the context of the var dir ... Am I right?

I think the var directory is checked so that you can put up a "under maintenance" page whilst you modify/reconfigure the server, so you might be able to figure out a way of changing the context of the file/directory instead of using httpd_read_user_content as suggested.

Either way, if you could try it out and let me know that would be a great help, I'll add it to our docs. Also I've belately found something official from Nginx http://nginx.com/blog/nginx-se-linux-ch ... -rhel-6-6/

Re: Bad Gateway

PostPosted: Tue Jan 06, 2015 4:46 pm
by xkunes
Than it is working:

I have to do:
Code: Select all
(# yum install setroubleshoot)
# semanage port -a -t http_port_t -p tcp 4080
# setsebool -P httpd_read_user_content 1
# setsebool -P httpd_enable_homedirs 1



After setting the httpd_read_user_content, I was not able to sea images, and there was another error whit suggestion to set the httpd_enable_homedirs.

and after that it is working.
And there is no error in /var/log/nginx/error.log, /var/log/audit/audit.log

I hope that it is the righ solution. Could you confirm that?
Another way could be to chance the context of the var directory (ls -Z, chcon)

Do you have any idea, what is safer way?

Re: Bad Gateway

PostPosted: Tue Jan 06, 2015 5:05 pm
by manics
I'm afraid I don't know what the best way is. In addition to var/ nginx also requires access to the static files under /home/omero/OMERO.server/lib/python/omeroweb/static

If you don't have anything else running on the server what you've got now is probably a reasonable solution, if you do figure something else out let us know. Note it'd be worth checking everything still works after a reboot.

Once again, thanks for your help with debugging and testing!

Simon