Recent Bloggers

Ankit Prajapati
Posts: 5
Stars: 0
Date: 9/18/17
Chirag Patel
Posts: 4
Stars: 0
Date: 9/15/17
Rahul Joshi
Posts: 5
Stars: 0
Date: 9/15/17
Jiten Vaghela
Posts: 1
Stars: 0
Date: 8/23/17
Kuldeep Acharya
Posts: 1
Stars: 0
Date: 8/16/17
Saurang Suthar
Posts: 5
Stars: 0
Date: 7/5/17
Jyoti Verma
Posts: 3
Stars: 0
Date: 6/29/17
Pankti Patel
Posts: 1
Stars: 0
Date: 5/27/17
Chandrika Baraiya
Posts: 5
Stars: 0
Date: 5/27/17
Atith Patel
Posts: 5
Stars: 0
Date: 5/23/17
« Back

Configure Apache Web Server with Odoo

 
 
Odoo is very well known ERP system today. Odoo 9 provides great features that will help to grow business. By default odoo runs over port 8069. So we are accessing server using domain:8069. What if we need to access server using only domain like a standard website? We can do it by configuring web server with odoo. Here I am going to show you configuration of Apache web server for odoo.
 
Before configuring apache with odoo, first check whether apache web server is installed on your machine or not. If not installed then execute below command to installed it.
 

sudo apt-get update

sudo apt-get install apache2

 
After installing apache on your machine, you need to enable some modes by executing below commands.
 
sudo a2enmod proxy proxy_http
 
Now go to the directory, “/etc/apache2/sites-available” and create a file with <domain-name>.conf.  Here I am going to use “demo.surekhatech.com” domain for my odoo server. So the file name will be “demo.surekhatech.conf”. Add the below content into this file.
 
<VirtualHost *:80>
    ServerName demo.surekhatech.com
    ServerAlias demo.surekhatech.com

    LogLevel warn
    ErrorLog /var/log/apache2/demo.surekhatech.com.error.log
    CustomLog /var/log/apache2/demo.surekhatech.com.access.log combined

    ProxyPass / http://localhost:8069/
    ProxyPassReverse / http://localhost:8069/
</VirtualHost>
 
After adding the virtual host for odoo server, you need to enable site using the following command.
 
sudo a2ensite demo.surekhatech.conf
 
A message will appear showing that site is enabled. After that you need to restart the apache server by executing below command.
 
sudo service apache2 restart
 
Make the host file entry in case you have made the configuration on the local machine. Open the “hosts” file by executing below command:
 
sudo nano /etc/hosts
 
Add the following entry into this file.
 
127.0.0.1 demo.surekhatech.com
 
After completing with above configuration, you can access the odoo server by hitting the “demo.surekhatech.com” in any browser. You can see that the odoo server is running over the “http”. But what if we need to run our odoo server over more secure channel i.e. “https”.
 
For that you need SSL certificate and key. You can buy the certificate from any trusted vendor. You can also generate certificates and used it. Certificate can be generated using the openssl toolkit. For linux machine you can generate certificate by using the following commands.
 
To generate key:
 
openssl genrsa -out demo.surekhatech.com.key 2048
 
To generate Certificate:
 
openssl req -new -x509 -key demo.surekhatech.com.key -out demo.surekhatech.com.cert -days 3650
-subj /CN=demo.surekhatech.com
 
Once you have SSL key and certificate, you need to update the existing virtual host to run odoo server over “https”. Before that first enable the apache SSL mode by executing below command.
 
sudo a2enmod ssl
 
Now open “demo.surekhatech.conf” file from the “/etc/apache2/sites-available” and update the virtual host with the below contents.
 
<VirtualHost *:80>
     ServerName demo.surekhatech.com
     ServerAlias demo.surekhatech.com
     Redirect / https://demo.surekhatech.com/
</VirtualHost>

<VirtualHost *:443>
     ServerName demo.surekhatech.com
     ServerAlias demo.surekhatech.com

     LogLevel warn
     ErrorLog /var/log/apache2/demo.surekhatech.com.error.log
     CustomLog /var/log/apache2/demo.surekhatech.com.access.log combined

     SSLEngine on
     SSLProxyEngine on
     SSLCertificateFile /etc/apache2/ssl/demo.surekhatech.com.cert
     SSLCertificateKeyFile /etc/apache2/ssl/demo.surekhatech.com.key

     ProxyPreserveHost On
     ProxyPass / http://localhost:8069/ retry=0
     ProxyPassReverse / http://localhost:8069/
</VirtualHost>
 
Here we have added the path for the SSL certificate and key file. Create a directory with “ssl” name on “/etc/apache2” location. Copy the SSL certificate and key files into “/etc/apache2/ssl” directory.
 
Now restart the apache web server using the following command. 
 
sudo service apache2 restart
 
Open any browser and hit the url “demo.surekhatech.com”. You can see that it will automatically redirect your odoo server over “https”, a more secure channel. Any request to your odoo server will be serve over the “https”.
 
For more implementation details or support you may contact us at enquiry@surekhatech.com.
 
 
Comments
Trackback URL:

Herzth David
good informative post.
odoo 9 is a powerful tool for creating customized ERP solutions
we are <a href ="http://www.atees.org/>odoo training institute in thrissur</a>
looking forward to your next post
Posted on 8/22/16 6:57 AM.
Nilesh Patel
How can we setup subdomain(By dbfilter) with https on Odoo?
Posted on 2/7/17 2:27 PM in reply to Herzth David.
pat pat
Thank you very much, this is a great tutorial
Posted on 2/22/17 6:03 AM.
palani p
I have configured the odoo with apache
http://www.surekhatech.com/blog/configure-apache-web-server-with-odoo
by using above link..

How can i upload the odoo source code( addons folder) into my website directory (www.xxxxx.tk) ?
Posted on 6/28/17 7:19 AM.

Contact Us

Loading

Get in touch

Headquarter :
302, Landmark,
Nr. Titanium City Center,
Prahlad Nagar Road,
Ahmedabad, India - 380015.