Skip to Content
Menu
This question has been flagged
2 Replies
4594 Views

Good day for the past two days ive been trying to figure out what im doing wrong
i want to run this instance of odoo locally of my host machine. so people can access it in the office
before moving it to a dedicated vm but i have no idea what i am doing wrong. need help to specify which errors

odoo has rwx on the folders. 
im using ubuntu 18.04 and odoo v 13


here is the odoo.conf


<VirtualHost *:80>
ServerName eformtest.com
ServerAlias www.eformtest.com

ErrorLog ${APACHE_LOG_DIR}/odoo-error.log
CustomLog ${APACHE_LOG_DIR}/odoo-access.log combined

<Directory /home/dfevrier/Documents>
Require all granted
</Directory>
<Directory /home/dfevrier/Documents/Projects/E-Forms/odoo/setup>
<Files odoo-wsgi.py>
Require all granted
</Files>
</Directory>

WSGIDaemonProcess odoo user=odoo group=odoo python-home=/home/dfevrier/Documents/Venv/odoovenv/bin python-path=/home/dfevrier/Documents/Projects/E-Forms/odoo/
WSGIProcessGroup odoo
WSGIScriptAlias / /home/dfevrier/Documents/Projects/E-Forms/odoo/setup/odoo-wsgi.py

</VirtualHost>​


and here is the odoo-wsgi.py

# WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --http :9090 --pythonpath . --wsgi-file openerp-wsgi.py
#
# For gunicorn additional globals need to be defined in the Gunicorn section.
# Then the following command should run:
# $ gunicorn odoo:service.wsgi_server.application -c openerp-wsgi.py

import odoo

#----------------------------------------------------------
# Common
#----------------------------------------------------------
odoo.multi_process = True # Nah!
# Equivalent of --load command-line option
odoo.conf.server_wide_modules = ['base','web']
conf = odoo.tools.config
# Path to the OpenERP Addons repository (comma-separated for
# multiple locations)
conf['addons_path'] = 'addons'
# Optional database config if not using local socket
conf['db_name'] = 'EForm'
conf['db_host'] = 'localhost'
conf['db_user'] = 'odoo'
conf['db_port'] = 5432
conf['db_password'] = 'password'
#----------------------------------------------------------
# Generic WSGI handlers application
#----------------------------------------------------------
application = odoo.service.wsgi_server.application

odoo.service.server.load_server_wide_modules()
#----------------------------------------------------------
# Gunicorn
#----------------------------------------------------------
# Standard OpenERP XML-RPC port is 8069
bind = '127.0.0.1:80'
pidfile = '.gunicorn.pid'
workers = 4
timeout = 1200
max_requests = 1000


and the error the apache2 odoo-error.log gives is this

[Mon Nov 18 13:56:06.946819 2019] [wsgi:error] [pid 24019:tid 139899566130944] [client 127.0.0.1:54678] Truncated or oversized response headers received from daemon process 'odoo': /home/dfevrier/Documents/Projects/E-Forms/odoo/setup/odoo-wsgi.py

[EDIT]
changing the loglevel to info i get this now 
Current thread 0x00007f844ee23bc0 (most recent call first):
[Tue Nov 19 09:45:07.055801 2019] [core:notice] [pid 20088:tid 140206235859904] AH00051: child pid 20502 exit signal Aborted (6), possible coredump in /etc/apache2
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'​

Avatar
Discard
Author Best Answer

thanks @Marcelo Lima but i dont know nginx
and  i was able to find the solution 

for one this line

 python-home=/home/dfevrier/Documents/Venv/odoovenv/bin


should be


 python-home=/home/dfevrier/Documents/Venv/odoovenv/



esure your mod_wsgi is the same python version as your virtual env (python 3.6)
update all local apt packages relating to odoo ( apache2, python3,etc)

make rwx permission are assigned to the hosting directory and its sub directories 

its not advised to give write permission but this is internal not internet facing 

Avatar
Discard
Best Answer

Hi, did you try install nginx instead of apache?


sudo nano /etc/nginx/sites-enabled/odoo.example.com


upstream odoo {
 server 127.0.0.1:8069;
}

upstream odoo-chat {
 server 127.0.0.1:8072;
}

server {
    server_name odoo.example.com;
    return 301 https://odoo.example.com$request_uri;
}

server {
   listen 443 ssl http2;
   server_name odoo.example.com;

   ssl_certificate /path/to/signed_cert_plus_intermediates;
   ssl_certificate_key /path/to/private_key;
   ssl_session_timeout 1d;
   ssl_session_cache shared:SSL:50m;
   ssl_session_tickets off;

   ssl_dhparam /path/to/dhparam.pem;

   ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
   ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
   ssl_prefer_server_ciphers on;

   add_header Strict-Transport-Security max-age=15768000;

   ssl_stapling on;
   ssl_stapling_verify on;
   ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;
   resolver 8.8.8.8 8.8.4.4;

   access_log /var/log/nginx/odoo.access.log;
   error_log /var/log/nginx/odoo.error.log;

   proxy_read_timeout 720s;
   proxy_connect_timeout 720s;
   proxy_send_timeout 720s;
   proxy_set_header X-Forwarded-Host $host;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header X-Real-IP $remote_addr;

   location / {
     proxy_redirect off;
     proxy_pass http://odoo;
   }

   location /longpolling {
       proxy_pass http://odoo-chat;
   }

   location ~* /web/static/ {
       proxy_cache_valid 200 90m;
       proxy_buffering    on;
       expires 864000;
       proxy_pass http://odoo;
  }

  # gzip
  gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
  gzip on;
}
sudo systemctl restart nginx 
in your .conf:
xmlrpc_interface = 127.0.0.1
netrpc_interface = 127.0.0.1
systemctl restart odoo








Avatar
Discard
Related Posts Replies Views Activity
1
Apr 19
2662
1
Mar 15
9217
1
Nov 24
94
1
Jul 24
916
1
Jul 24
383