Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

OpenERP 7 (package openerp ubuntu) on Subdomain

By
Suresh Bhandari
on 6/12/14, 1:31 AM 1,718 views

I have a ubuntu 12.04 precise server where I installed openerp package using apt-get install. No installation problems reported.

My domain is hosted on the server, and I want to use openerp on subdomain, say, erp.example.com.

I created one more virtualhost on the beginning of the apache config file as below (obviously replacing example by my domain):

<VirtualHost *:80>
       ServerName erp.example.com
       DocumentRoot /usr/lib/pymodules/python2.7/openerp/
       <Directory /usr/lib/pymodules/python2.7/openerp/>
                Options FollowSymLinks MultiViews Includes 
                AllowOverride All
                Require all granted
                Order Allow,Deny
                Allow from All
        </Directory>
        ErrorLog /var/log/openerp-server.log
</VirtualHost>

So, here are my scenarios:

1. When I access the IP:8069 I get the default index file from /var/www. I am not sure why this is happening, I expect to recieve openerp default login page.

If it would have worked, I would used :8069 instead of :80.

2. When I use the directory location elsewhere with ownership of www-data:www-data on it, it opens successfully. This clears that the subdomain is working. 

3. When I check the subdomain, I get "Forbidden" error which is okay, as there is no matching directoryindex, as listed in the error log:

[Thu Jun 12 07:04:11.890152 2014] [autoindex:error] [pid 20586] [client 27.34.95.76:50274] AH01276: Cannot serve directory /usr/lib/pymodules/python2.7/openerp/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
 
4. After searching for a few hour, I found that python requires "ExecCGI" option set, with "AddHandler cgi-script .py", so I set the VirtualHost as below, to execute __init__.py:

<VirtualHost *:80>
       ServerName erp.example.com
       DocumentRoot /usr/lib/pymodules/python2.7/openerp/
       DirectoryIndex __init__.py
       <Directory /usr/lib/pymodules/python2.7/openerp/>
                Options FollowSymLinks MultiViews Includes ExecCGI
                AddHandler cgi-script .py
                AllowOverride All
                Require all granted
                Order Allow,Deny
                Allow from All
        </Directory>
        ErrorLog /var/log/openerp-server.log
</VirtualHost>

Now when I access the same subdomain, I recieve "500 Internal Server Error".

The error log is:
[Thu Jun 12 07:15:23.763765 2014] [cgi:error] [pid 20814] [client 27.34.95.76:10411] AH01215: (13)Permission denied: exec of '/usr/lib/pymodules/python2.7/openerp/__init__.py' failed
[Thu Jun 12 07:15:23.765572 2014] [cgi:error] [pid 20814] [client 27.34.95.76:10411] End of script output before headers: __init__.py

With these tasks done, I have a few questions:

1. A similar installation on my local virtual machine is working fine with IP:8069. Did you find anything missing with the installation on this server? Why IP:8069 not working?
2. Is the directory I used with VirtualHost Direcotry correct for OpenERP web?
3. What is the index file that needs to be read/load for OpenERP? (__init__.py is used because of its name)

Thanks in advance,

0
Antonio M. Vigliotti
On 6/12/14, 3:39 AM

Hi,

you should no access to OpenERP directly via http 80 port, instead you should create a proxy entry.

 How hide port 8069 in subdomain.

Sorry, it is in italian but you should copy "Uso Proxy" section as is, replacing erp.server-openerp.it with you real domain.

Please, use proxy carefully. If you open proxy to the world, you could receive a lot of spam traffic, so look at my code carefully.

Hope thie help

 

Antonio Maria Vigliotti

0
Suresh Bhandari
On 6/26/14, 3:56 AM

Hello Antonio,

I checked your referenced website, and Google is there to translate it, so no problem with the language.

I must appreciate your work, but I tried mod_wsgi method as proposed by OpenSourceHolic here [http://opensourceholic.com/2014/05/30/how-to-deploy-odoo-openerp-8-with-mod_wsgi-on-ubuntu-linux-servers/]  by tweaking some parameters, and I got working environment in my test box. Now, I will try it in production environment and let you know.

Thanks for your efforts, though.

Suresh.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/12/14, 1:31 AM
Seen: 1718 times
Last updated: 3/16/15, 8:10 AM