{"id":21251,"date":"2017-01-11T07:38:03","date_gmt":"2017-01-11T13:38:03","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=21251"},"modified":"2022-06-03T03:42:23","modified_gmt":"2022-06-03T08:42:23","slug":"how-to-install-odoo-10-with-subdomain-filtering","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-odoo-10-with-subdomain-filtering\/","title":{"rendered":"How to Install Odoo 10 with subdomain filtering"},"content":{"rendered":"
<\/p>\n
We’ll show you, How to Install Odoo 10 with subdomain filtering. In this tutorial, we will show you how to install Odoo 10 on an Ubuntu 16.04 VPS<\/a> and configure it to use sub-domain filtering so users can run multiple Odoo instances on different sub-domains (with a different database for each subdomain). Make sure your OS package list and the OS packages are up to date by running the following commands:<\/p>\n Then, start with the Odoo 10 installation. The easiest way to install Odoo 10 on your Linux VPS is to use the Odoo install script available at github.com, so download the script to a directory on your server:<\/p>\n Edit the script and change the Odoo master password. Also, you can change the Odoo username, Odoo install path, Odoo port number, Odoo version (Enterprise, Community) etc.<\/p>\n Replace ‘admin’ with a strong password<\/a>, e.g.:<\/p>\n Make the Odoo install script executable:<\/p>\n Run the Odoo install script and allow some time for the installation process to complete.<\/p>\n Once the Odoo 10 installation is complete, edit the Odoo configuration file (\/etc\/odoo-server.conf) and configure it for subdomain filtering, i.e. add dbfilter = ^%d$ to it:<\/p>\n Do not forget to replace the Odoo master password with the one you set in the Odoo install script. Also if you modified Odoo addons_path, Odoo port number or so, you need to change them to the Odoo configuration too.<\/p>\n Edit the config.py Odoo script:<\/p>\n Change:<\/p>\n to<\/p>\n Then, restart the Odoo server for the changes to take effect:<\/p>\n [ecko_alert color=”blue”]Get an Odoo VPS<\/a><\/strong> from us and our EPIC 24\/7 Support Team will install, configure and optimize Odoo for you, for free.[\/ecko_alert]<\/p>\n Install Apache, pip and mod-wsgi:<\/p>\n Disable the default Apache configuration file:<\/p>\n Create a new Apache configuration file. For example, create a new Apache configuration file named ‘odoo.conf’:<\/p>\n Enable the ‘odoo.conf’ Apache configuration file:<\/p>\n Add the following lines to it: That is it. Odoo 10 is configured to use sub-domain filtering now.<\/p>\n Open http:\/\/subdomain1.your-domain.com:8069 in a web browser, enter the Odoo master password, the database name, email address and password, select a country from the drop-down selection box and click ‘Create database’. Of course, you don\u2019t have to do any of this if you use one of our Odoo VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to install Odoo 10 with subdomain filtering<\/strong> for you. They are available 24×7 and will take care of your request immediately.<\/p>\n
\n<\/p>\nsudo apt-get update\nsudo apt-get upgrade<\/pre>\n
cd \/opt\nwget https:\/\/raw.githubusercontent.com\/Yenthe666\/InstallScript\/10.0\/odoo_install.sh<\/pre>\n
vi odoo_install.sh<\/pre>\n
#set the superadmin password\nOE_SUPERADMIN=\"admin\"<\/pre>\n
OE_SUPERADMIN=\"Adm1NPa55w0^D\"<\/pre>\n
chmod +x odoo_install.sh<\/pre>\n
.\/odoo_install.sh<\/pre>\n
vi \/etc\/odoo-server.conf<\/pre>\n
[options]\n; This is the password that allows database operations:\nadmin_passwd = Adm1NPa55w0^D\ndb_host = False\ndb_port = False\ndb_user = odoo\ndb_password = False\ndbfilter = ^%d$\naddons_path = \/usr\/lib\/python2.7\/dist-packages\/odoo\/addons\n[options]\nlogfile = \/var\/log\/odoo\/odoo-server.log\naddons_path=\/odoo\/odoo-server\/addons,\/odoo\/custom\/addons\nxmlrpc_port = 8069<\/pre>\n
vi \/odoo\/odoo-server\/odoo\/tools\/config.py<\/pre>\n
\"--db-filter\", dest=\"dbfilter\", my_default='.*'<\/pre>\n
\"--db-filter\", dest=\"dbfilter\", my_default='%d'<\/pre>\n
\/etc\/init.d\/odoo-server restart<\/pre>\n
sudo apt-get install python-pip apache2 libapache2-mod-wsgi<\/pre>\n
a2dissite 000-default.conf<\/pre>\n
vi \/etc\/apache2\/sites-available\/odoo.conf<\/pre>\n
a2ensite odoo<\/pre>\n
\n<VirtualHost *:80>
\nServerName your-domain.com
\nServerAlias *.your-domain.com
\nWSGIScriptAlias \/ \/odoo\/odoo-server\/odoo\/service\/wsgi_server.py
\nWSGIDaemonProcess oe user=odoo group=odoo processes=2 python-path=\/odoo\/odoo-server\/ display-name=apache-odoo
\nWSGIProcessGroup oe
\nErrorLog \/var\/log\/odoo\/odoo-error.log
\nCustomLog \/var\/log\/odoo\/odoo-access.log combined
\n<Directory \/opt\/odoo>
\n#Order allow,deny
\n#Allow from all
\nOptions All
\nAllowOverride All
\nRequire all granted
\n<\/Directory>
\n<\/VirtualHost>
\nRestart the Apache web server for the changes to take effect:<\/p>\nservice apache2 restart<\/pre>\n
\nRepeat the same steps for subdomain2.your-domain.com etc., and then you can access each Odoo instance using http:\/\/subdomain1.your-domain.com:8069 , http:\/\/subdomain2.your-domain.com:8069 and so on.<\/p>\n
\n