This question has been flagged

I want to run odoo behind an apache proxy server in multi process mode.

odoo server and the apache are on separate virtual machines


This is my relevant odoo-server config 

workers =4

xmlrpc_port = 8069

longpolling_port = 8072

proxy_mode = 1


In proxy-server I have these in the config file to serve odoo over https (I use mode_rewrite to redirect http to https):

ServerName odoo-server-name

ProxyRequests Off

ProxyPreserveHost On

ProxyPass /longpolling/ http://odoo-server-ip:8072/longpolling/

ProxyPassReverse /longpolling/ http://odoo-server-i:8072/longpolling/

ProxyPass / http://odooserver-ip:8069/

ProxyPassReverse / http://odoo-server-i:8069/

 

Now odoo works fine except for im_chat it is unresponsive (No Ajax) and only works if you refresh the page, in addition I guess this recurring error in the odoo log. I can't figure out what call poll via http

ERROR testfp openerp.http: <function poll at 0x3a9bd70>, /longpolling/poll: Function declared as capable of handling request of type 'json' but called with a request of type 'http'


In apache access log:

"POST /longpolling/poll HTTP/1.1" 301 255  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"

"GET /longpolling/poll HTTP/1.1" 400 275  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"

notice the 400 code in the GET

And there is nothing relevant in the apache access error log


Things I have tried:
- Selinux permissive mode

- Installed psycogreen==1.0

- adding :

    xmlrpc_interface = 127.0.0.1     
    netrpc_interface = 127.0.0.1
         results in service unavailable error




Any help would be appreciated

Avatar
Discard
Best Answer

I Had exactly the same problem,  but chat work fine not using poxy.

I found after much trial an error if I placed the longpolling proxies after the xmlrpc ports in my virtual host it works,


also I did not include /longpolling/ after the server address.



<VirtualHost *:80>

ServerName myserver.com

<Proxy *>

Order deny,allow

Allow from all

</Proxy>

ProxyPreserveHost off

ProxyPass / http://127.0.0.1:8900/

ProxyPassReverse / http://127.0.0.1:8900/

ProxyPass /longpolling/ http://127.0.0.1:8901/

ProxyPassReverse /longpolling/ http://127.0.0.1:8901/


</VirtualHost>

Avatar
Discard
Author

thank you for your answer this got rid of that error but I got the classic error raise Exception("bus.Bus unavailable") Only thing that made it go away was to use the xmlrpc_interface = 127.0.0.1 and netrpc_interface = 127.0.0.1 and have the nginx/apache in the same server as odoo

Author Best Answer

managed to get rid of the error by:

  • changing the order in the proxy configuration as Stephen Levenhagen mesntioned

  • Have the proxy in the same machine as odoo server

  • put xmlrpc_interface and netrpc_interface to 127.0.0.1


    There are no errors now in the odoo log, But Chat is still unresponsive (no AJAX behaviour)

Avatar
Discard
Best Answer

is it ProxyPassReverse /longpolling/ http://127.0.0.1:8901/
or ProxyPassReverse /longpolling/ http://127.0.0.1:8901/longpolling/

Avatar
Discard