E-commerce is a sales platform for gaining popularity in the marketing world. This is the online method to reach out to more customers. Odoo provides so many features like building blocks, and we can make our website more attractive using these features. We can design our website with a website configurator, beautiful gradients, etc. Odoo provides many other features like blog articles, multi languages, etc.
Similarly, Odoo provides one of the best features of a multi-website. We can run multiple websites on the same database and share the website products between these two websites.
We can run multiple websites in a single database with multiple domains. In this case, we can use subdomains. So here, we can create two websites and two subdomains. We can create two websites: information technology and shop. For that, we have to select from the website -> configuration -> settings-> create a new website.
The above image can see the website creation form, and we have to add the website name. Next, we have to add a domain. The domain will be used to link this website. With this domain, we can directly redirect to the website. Here we can add a subdomain. For e.g.: For information technology websites, we can use information.odoo-website.com, and for a shop, we can use shop.odoo-website.com
We can see how to add the domain in the form, when we add the domain in the form, we don’t have to add the www or http or https and exclude the slashes also.
In settings, we have more options for making a more attractive website. We can select the theme for the website, and we can add features, Also can select the language.
For shop websites, also we have to do the same method.
Next, we have to set up the domain in DNS. When we configure the DNS, the user will enter the URL that we added to the domain on the website. Then the web browser server will connect the corresponding data. We can log in to the portal of DNS, which is the hosting provider, and we can add our new record to DNS, which connects the URL with the server's IP. We can add our subdomains, and it will connect to the IP. Then, when we start searching the URL, which will redirect to the corresponding website.
Next, we have to add the SSL certificate for the subdomains. In this case, we can use a wildcard certificate, which can be used for all subdomains. In this case, we can use NGINX configuration, which will be pointing to our domain. Here we can use the wildcard certificate to make our website more secure. Normally we can use subdomain certificates also, but here we have two subdomains, so we have to use a single wildcard certificate for two subdomains. First, we have to add the certificate to the server, then we add the path in NGINX configuration, when we add the domain also have to add both subdomains, so we can add like *.odoo-website.com
NGINX configuration can be seen below
server {
listen 80;
listen [::]:80;
server_name *.odoo-website.com;
rewrite ^(.*) https://$host$1 permanent;
}
server {
server_name *.odoo-website.com;
listen 443 ssl;
access_log /var/log/nginx/testing-access.log;
error_log /var/log/nginx/testing-error.log;
location /longpolling {
proxy_connect_timeout 3600;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
send_timeout 3600;
proxy_pass http://127.0.0.1:8072;
}
location / {
proxy_connect_timeout 3600;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
send_timeout 3600;
proxy_redirect off;
proxy_pass http://127.0.0.1:8069/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
ssl on;
ssl_certificate /etc/nginx/certificate.crt;
ssl_certificate_key /etc/nginx/certificate.key;
ssl_session_timeout 30m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RS$';
ssl_prefer_server_ciphers on;
gzip on;
gzip_min_length 1000;
}
upstream odoo {
server 127.0.0.1:8069 weight=1 fail_timeout=0;
}
upstream odoo-im {
server 127.0.0.1:8072 weight=1 fail_timeout=0;
}
We have to add crt files and key files to the server, then we can add the corresponding path to the SSL certificate and SSL cerficate_key, here we added the location is /etc/nginx, and we have to add the port number also.
Multi website features can be used for multiple websites in a single database. When using multiple websites, we try to log in to multiple websites, which is very difficult. It will always be redirected to the default website. So if we want to enter each website through login, we must set the domain for each website. For security purposes, we can use the SSL certificate also.