Try ERPNext Buy Support Partners Foundation

ERPNext from installation to multi-tenancy configuration on Ubuntu 18/CentOs 7

I tested the process in ubuntu 18 & centos 7, I wanted to share if anyone need.

1. Install python-minimal
apt-get install python-minimal

2. Install some dependencies
apt-get install build-essential python-setuptools

3. Download the script
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

4. Create a new user & add to sudoer group
adduser frappe
usermod -aG sudo frappe

5. Run the script
sudo python install.py --production --user frappe

if your installation failed please retry for second time will pass.

6. Change site1.local to your company name
[frappe@erpnext ~]$ cd frappe-bench
[frappe@erpnext frappe-bench]$ mv sites/site1.local sites/erp.example1.com

7. Create 2 more sites
bench new-site erp.example2.com
bench new-site erp.example3.com

8. Install application to your specific sites
bench --site erp.example2.com install-app erpnext
bench --site erp.example3.com install-app erpnext

Setup DNS based multitenancy

9. Enable multitenancy mode
[frappe@erpnext frappe-bench]$ bench config dns_multitenant on

10. Setup domains
[frappe@erpnext frappe-bench]$ bench setup add-domain erp.example1.com --site erp.example1.com
[frappe@erpnext frappe-bench]$ bench setup add-domain erp.example2.com --site erp.example2.com
[frappe@erpnext frappe-bench]$ bench setup add-domain erp.example3.com --site erp.example3.com

11. Edit your host file & assign your ip to your domain name
[frappe@erpnext frappe-bench]$ sudo vim /etc/hosts

host file looks like this
127.0.0.1 localhost
192.168.1.15 erp.mediamark.com
192.168.1.15 erp.shahrmedia.com
192.168.1.15 erp.techmark.com

12. Regenerate nginx config & restart
[frappe@erpnext frappe-bench]$ bench setup nginx
[frappe@erpnext frappe-bench]$ sudo service nginx restart

13. Now in your browser you can access each site by their domain name like erp.example1.com, erp.example2.com & erp.example3.com, the ip address wouldn’t work once multitenant is enabled.

Thats all. :stuck_out_tongue_winking_eye:

4 Likes

Do you need to update the host file records for every new site created?

I did, but it might work too if u don’t add each one.

1 Like

Im using windows how do i go about this. where do i input all the above

Hello and welcome allanball1

I am not a Windows user but maybe install Ubuntu 16 with these notes https://docs.microsoft.com/en-us/windows/wsl/install-win10

Then try the easy install method https://github.com/frappe/bench

We all get stuck but this forum is full of pointers if you need clues

it keeps telling me connection refused. im using puTTY

My guess is you are trying to run a network connection from Windows to Ubuntu.

Your problem is on the Ubuntu end, either

  1. the ssh service is not running or listening on the IP:Port you are trying to connect to, 2. the port is blocked by a firewall.

A web search like ‘windows putty ssh connection refused’ will advise you how to troubleshoot.