Testing Odoo 11 on port 80 with multi website on windows server
Odoo give its best with Linux and usually i use that on production environments.
But i was just curious to try the latest Odoo 11 version and try to apply few tricks i get from this two articles:
https://stackoverflow.com/questions/37543602/how-to-change-odoo-default-port-on-windows
https://www.odoo.com/it_IT/forum/help-1/question/fixed-v10-multiple-domains-with-one-odoo-install-117372
So:
Here is how to change Odoo 11 port on 80 with multi website on windows server(as explained in the post):
- Install Odoo as you normally would.
- Using iptables (“iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8069”) point 8069 to 80 (if you are using UFW – make sure to open both ports! – “ufw allow 8069”, and add the iptables line to /etc/rc.local to make it stick around after a reboot)
- Create the databases for your domains, but the database name *has* to take the form of “<domainname>_<TLD>”, for example “yourdomain.com” should have a database named “yourdomain_com” with an underscore between the domain name and TLD. If you try to use a dash instead of an underline, Odoo says it is not an allowed character, which must have been a change with v10 because everywhere else said use a dash.
- Then edit “/etc/odoo/odoo.conf” and add “dbfilter = %h” (I did it before the addons_path, but I don’t think it matters) There is endless documentation for using “%d” for subdomains, but very little for domains.
- Restart Odoo (“service odoo restart”)
- Point your domain A records at Odoo and each site will then pick up it’s respective database.
Finally, after taking the last nightly build from:
https://nightly.odoo.com/11.0/nightly/exe/
And installed it on windows server on an AWS instance (remember to set the window firewall and security group).
I’ve tried to change to the default ports and set dbfilter as explained in the articles.
It works!
Consider db and attached site is matched exactly so mydomain.com have to match with db mydomain_com.
So then you can make a redirect to reach from www.mydomain.com
So the steps working for me are:
1)
Name your databases as: mydomain_com (replace dot with underscore).
2)
change this line in C:\Program Files (x86)\Odoo 11.0\server\odoo\tools\config.py
from
group.add_option(“-p”, “–http-port”, dest=”http_port”, my_default=8069,
to
group.add_option(“-p”, “–http-port”, dest=”http_port”, my_default=80,
3)
change this lines in C:\Program Files (x86)\Odoo 11.0\server\odoo.conf
dbfilter = %h
http_port = 80
4) Restart odoo service
5) Point your record A to ip of your odoo site
The same steps should work (changing paths) on linux configuration.
[themoneytizer id=26103-16]
Hi,
very good article.
how about subdomain name
Hi,I’ve not tested yet i’ve read something about it on odoo forums.