This question has been flagged
1 Reply
9058 Views

Hy everyone,

I followed some excellent resources here:

  1. https://doc.openerp.com/trunk/server/deployment-mod-wsgi/
  2. https://www.odoo.com/forum/Help-1/question/How-to-install-OpenERP-8-using-mod_wsgi-44186

I'm working with the latest trunk and thanks to this I configured an apache virtual host :

<VirtualHost *:80>
        ServerName openerp.local

        WSGIScriptAlias / /home/openerp/odoo/openerp-wsgi.py
        WSGIDaemonProcess oe user=openerp group=openerp processes=4 python-path=/home/openerp/odoo display-name=apache-openerp
        WSGIProcessGroup oe

        <Directory /home/openerp/odoo/ >
                Options FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

Apache restart gracefully without any issue. Unfortunately when I try to reach the http://openerp.local and whatever I set in the conf['addons_path'] I still having this issue :

[Tue May 27 00:14:03 2014] [error] [client 10.0.130.23] mod_wsgi (pid=3001): Exception occurred processing WSGI script '/home/openerp/odoo/openerp-wsgi.py'.
[Tue May 27 00:14:03 2014] [error] Traceback (most recent call last):
[Tue May 27 00:14:03 2014] [error]   File "/home/openerp/odoo/openerp-wsgi.py", line 15, in <module>
[Tue May 27 00:14:03 2014] [error]     import openerp
[Tue May 27 00:14:03 2014] [error] ImportError: No module named openerp

Here are my tests :

  1. conf['addons_path'] = '../../addons/trunk,../../web/trunk/addons'  => FAILED
  2. conf['addons_path'] = '/home/openerp/odoo/addons,/home/openerp/odoo/openerp/addons' => FAILED
  3. conf['addons_path'] = '../odoo/addons' or conf['addons_path'] = '../../addons' or conf['addons_path'] = '../addons' neither work

Any advice would be appreciated,

regards

Avatar
Discard

Run your server normally as you run in localhost, just use apache2 reverseproxy, make easy this job.

Can you give some reasons why using wsgi is superior to reverseproxy? I have also been successful with the latter, so it would be interesting to know what further benefits wsgi would provide.

Author

I think I have the clue, I'll try it later caus' I don't have access to the server. Anyway, I already succeed in setting a reverse proxy which is most of time efficient but it suppose to maintian 2 services one for apache and the other for openerp thanks. Thanks to wsgi, it could be considered a simple web site in a virtual host. Retsarting apache will simply restart the OpenERP.Much more easier for an admin sys regarding to me.

So you see just one advantage: restarting Apache will also restart Odoo? It hardly seems worth the extra effort.

Author

Well, it's not such an effort, in the past I also struggle with reverse proxy and additionnal parameters, proxy conf in OpenERP, etc... and moreover, reading wsgi Doc and other examples really helps to understand everything. I'll post my tests tonight and you'll see that is not so hard as reverse proxy. Moreover, I already work with stuff like passenger fusion for ruby on rails and it's much easier too deal with as with reverse proxy

I'm looking forward to seeing how it is done. What WSGI doc do you recommend?

Author

Well, I wrote too fast, I tried to adapt the virtual host without success. So I still stucked. I'll let you know

Author

so, the problem doesnt seems to come from this part of the conf. I run mutiple python version and my mod_wsgi probably don't use the correct one. I'll let you know when it's OK

Author Best Answer

Ok, here is the part of the answer :

  1. running on centos 6.5 I didn't have python 2.7
  2. I installed the python 2.7 with SCL : http://wiki.centos.org/AdditionalResources/Repositories/SCL
  3. Then I have to recompile mod_wsgi for python 2.7 thanks to this http://www.fir3net.com/Redhat-/-Fedora/how-do-i-compile-modwgsi-for-python-27.html

Now, I have another expressive error :
[error] No handlers could be found for logger "openerp.addons.website_event.controllers.main"
[Tue May 27 19:33:37 2014] [error] [client 10.0.130.23] mod_wsgi (pid=19271): Exception occurred processing WSGI script '/home/openerp/odoo/openerp-wsgi.py'.
[Tue May 27 19:33:37 2014] [error] [client 10.0.130.23] Traceback (most recent call last):
[Tue May 27 19:33:37 2014] [error] [client 10.0.130.23]   File "/home/openerp/odoo/openerp/service/wsgi_server.py", line 215, in application

Show must go on, let's find the clue!

 

Avatar
Discard
Author

let's have a walk on the git side : https://github.com/odoo/odoo/issues/242

Author

This post is answered. The other problem is either a bug or need another post later on

Author

Very strange, I succeed to make wsgy works on 7.0 but not on nightly build