This question has been flagged
4 Replies
72416 Views

Hello...

I connect currently to my ERP server by using port 8069, this way: http://myserver:8069.

Since Apache is listening in port 80, and OpenERP server is in port 8069, I cannot make OpenERP to listen in port 80.

Is there a way to configure Apache so that when received the request, it load the content of port 8069? maybe by mean of a Proxy in virtual host definition, but I don't know how. Also, I tried to use .htaccess but a redirection occurs instead, and what I want is not to show the port number.

Any help will be appreciated,

regards, Jaime

Avatar
Discard
Best Answer

Yes, add a virtual host with Proxy to your apache config:

<virtualhost *:80=""> ServerName myserver ServerAdmin webclient@localhost

  <Proxy>
       Order deny,allow
       Allow from all
  </Proxy>

  ProxyRequests Off

  ProxyPass / http://127.0.0.1:8069/
  ProxyPassReverse / http://127.0.0.1:8069/

  # Fix IE problem (http error 408/409)
  SetEnv proxy-nokeepalive 1
  ErrorLog /var/log/apache2/webclient-error.log
  CustomLog /var/log/apache2/webclient-access.log combined

</virtualhost>

And then add the --proxy-mode option to openerp-server

This works with 6.1 and 7.0

Avatar
Discard
Author

Thanks a lot... it worked, but I got an undesiderable behavior. I configured OpenERP with multiple databases, so that the chosen database will be given by the hostname. So by using 127.0.0.1 OpenERP are not able to choose the database. I changed proxy settings to be http://database.mydomain.com:8069, but Apache get stuck not actually getting the login page. If I use directly http://database.mydomain.com:8069 in browser URL, it works. Is there a way to solve this? Thanks.

Author

I have finally used:

ProxyPass / http://127.0.0.1:8069/ ProxyPassReverse / http://database.mydomain.com:8069/

and it works.. I don't know the real meaning of that. Do you know the explanation?

Thanks Jaime

I looked up --proxy-mode, and found some info at server/openerp/service/wsgi_server.py L421 and werkzeug.pocoo.org/docs/contrib/fixers/?highlight=proxyfix#werkzeug.contrib.fixers.ProxyFix

Best Answer

Not the answer to your question, but other people might like to know that you don't need a web server, such Apache or Nginx, to make OpenERP available on port 80.

Just start the OpenERP server with option --xmlrpc-port=80.

Avatar
Discard
Author

what makes you think I am using Apache in order to make OpenERP available?

You say "Since Apache is listening in port 80". If you don't have a good reason to add Apache to your stack, throw it away: OpenERP has it's own web server and can work standalone.

Author

So, what makes you think I don't have any other websites? I host several domains in the machine (belonging to a lot of customers), all of them with websites, including access to cPanel, WHM, phpMyAdmin, phpPgAdmin, and so on..... I don't even want to imagine what will happen if I throw Apache away. Regards.

Author

By the way.. I have solved the problem with ProxyReverse feature of apache :-)

don't use --xmlrpc-port=80 because it is a privileged port and openerp does not run as root. maybe you can use 80 with the help of setcap stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-1024-on-l

Best Answer

You can use reverse proxy server. We are using Nginx. Search google "reverse proxy" for instructions.

Avatar
Discard
Best Answer

See help.openerp.com/question/28288/how-does-proxy-mode-help/

Avatar
Discard