• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
WebSetNet

WebSetNet

Technology News

  • Technology News
    • Mobile
    • Games
  • Internet Marketing
  • System Admin
    • Windows 11
    • Linux
    • Mac & Apple
    • Website Scripts
      • Wordpress
You are here: Home / source / How to Install and Configure Odoo with mod_wsgi

How to Install and Configure Odoo with mod_wsgi

August 5, 2020 by Martin6

 

unnamed-file-113-4528757

In this tutorial, we will show you how to install Odoo 10 on an Ubuntu 16.04 VPS with Apache2 and mod_wsgi which is an Apache module that implements a WSGI compliant interface for hosting Python based web applications such as Odoo on top of the Apache web server. There are multiple ways to install Odoo, but in this tutorial, we will install the latest Odoo 10 from the source using a python virtual environment. This guide should work on other Linux VPS systems as well but was tested and written for an Ubuntu 16.04 VPS.

Update the system and install necessary packages

sudo apt update 
apt -y upgrade
sudo apt-get install git python-pip python-dev 
    python-virtualenv libevent-dev gcc libjpeg-dev libxml2-dev 
    libssl-dev libsasl2-dev node-less libldap2-dev libxslt-dev

Install PostgreSQL

Installing PostgreSQL with apt is a quick and easy process.

sudo apt install postgresql-9.5 postgresql-server-dev-9.5
sudo systemctl enable postgresql.service
sudo systemctl start postgresql.service

Create Odoo user

Create an odoo system user with the following command:

sudo adduser --system --group odoo --home /opt/odoo

Create PostgreSQL database user with the following command:

su - postgres -c "createuser --createdb --username postgres --no-createrole --no-superuser --no-password odoo"

Install Odoo

Switch to user odoo and clone the Odoo 10.0 branch from GitHub:

sudo su - odoo -s /bin/bash
git clone https://www.github.com/odoo/odoo --depth 1 --branch 10.0 --single-branch /opt/odoo

Create python virtual environment and install all requirements:

cd /opt/odoo
virtualenv ./venv
source ./venv/bin/activate
pip install -r requirements.txt

When the installation is complete switch back your sudo user:

exit

Create a configuration file by copying the default odoo-wsgi.example.py file:

sudo cp /opt/odoo/setup/odoo-wsgi.example.py /opt/odoo/setup/odoo-wsgi.py

Open the configuration file

sudo nano /opt/odoo/setup/odoo-wsgi.py

change the addon path to:

conf['addons_path'] = 'addons'

and set the master admin password:

conf['admin_passwd'] = 'my_secret_password'

If you want to print PDF reports in Odoo, you need to install the Wkhtmltopdf package:

sudo apt -y install wkhtmltopdf

Install Apache and mod_wsgi

If you don’t have Apache installed on your system, install it with the following command:

sudo apt update
sudo apt install apache2

To install and enable the mod_wsgi, run the following commands:

sudo apt install libapache2-mod-wsgi
sudo a2enmod wsgi

Create an Apache virtual host directive for your domain:

sudo nano /etc/apache2/sites-available/odoo.conf
<VirtualHost *:80>
    ServerName my-odoo-domain.com
    ServerAlias  www.my-odoo-domain.com

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

    <Directory /opt/odoo/setup>
        <Files odoo-wsgi.py>
            Require all granted
        </Files>
    </Directory>

    WSGIDaemonProcess odoo user=odoo group=odoo python-home=/opt/odoo/venv/ python-path=/opt/odoo
    WSGIProcessGroup odoo
    WSGIScriptAlias / /opt/odoo/setup/odoo-wsgi.py

</VirtualHost *:80 >

Activate the virtual host by creating a symbolic link and restart Apache.

sudo a2ensite odoo
sudo systemctl restart apache2

That’s it. You have successfully installed Odoo with Apache2 and mod_wsgi on your Ubuntu 16.04 VPS. Now open your browser, type the address of your website and create a database and admin user.
For more information about how to manage your Odoo installation, please refer to the Odoo documentation.

 

Source

Related posts:

  1. How to Install Odoo 10 on an Ubuntu 16.04 VPS
  2. How to Install Odoo 12 on Debian 10 with Nginx as a Reverse Proxy
  3. How to Install Odoo 12 on CentOS 7
  4. How to Install Odoo 13 on CentOS 8
  5. How to Install Odoo 12 on Ubuntu 18.04 with Apache as a Reverse Proxy
  6. How to Install Odoo 12 on Ubuntu 16.04
  7. How to Install Odoo 10 with subdomain filtering
  8. How to Install Odoo 11 on Ubuntu 16.04 with Nginx as a Reverse Proxy
  9. Install multiple Odoo instances on a single machine
  10. How to run Python Scripts with Apache and mod_wsgi on Ubuntu 18.04

Filed Under: source Tagged With: configure, install, mod_wsgi, odoo, with

Primary Sidebar

Popular posts

  • 5 Ways to Fix “Your SIM sent a Text Message” Issue on iPhone
  • 3 Ways to Disable GetApps on Xiaomi, Redmi, and Poco Phones Running MIUI
  • GeForce Experience not finding games? Fix it fast
  • How To Extract & Install tar.gz Files In Ubuntu
  • How to Highlight Duplicates in Google Sheets
  • Discord Stream Has No Sound? 6 Ways to Fix
  • How to check if your Android device supports Widevine DRM
  • Exclamation Mark on Network Signal, Mobile Data Not Working? 8 Ways to Fix
  • How to find a lost Apple Pencil using your iPad (1st and 2nd gen)
  • 8 Best Sites to Read Manga Online for Free
  • 3 Ways to Hide Tabs in Google Chrome
  • How to Fix YouTube Server Connection Error [400] on Android
  • How to Track a Stolen or Lost Nintendo Switch
  • How To Search On Google Using Image or Video
  • How To Calculate CAGR in Excel
  • Microsoft Edge's newest feature? Shopping in Microsoft Edge
  • How to Change the Last Modified Date, Creation Date, and Last Accessed Date for Files and Folders

Footer

Tags

Amazon android Apple Asus available download: edge feature features first free from galaxy Game games gaming gets google install Intel iPhone launches linux Microsoft more OnePlus phone release released review: samsung series support this Ubuntu update using video watch what will windows with xbox your

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org