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,