Hy everyone,
I followed some excellent resources here:
- https://doc.openerp.com/trunk/server/deployment-mod-wsgi/
- 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 :
- conf['addons_path'] = '../../addons/trunk,../../web/trunk/addons' => FAILED
- conf['addons_path'] = '/home/openerp/odoo/addons,/home/openerp/odoo/openerp/addons' => FAILED
- conf['addons_path'] = '../odoo/addons' or conf['addons_path'] = '../../addons' or conf['addons_path'] = '../addons' neither work
Any advice would be appreciated,
regards
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.
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.
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?
Well, I wrote too fast, I tried to adapt the virtual host without success. So I still stucked. I'll let you know
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