Try ERPNext Buy Support Partners Foundation

Setting up a domain name

Hi guys!

Im really confuse about how to set my domain name on my server…
right now im accessing my server via ip address plus the port i set…Now i want to access my server in the web by a domain name…
Ex:
IP Address:192.168.89.255:8080
Change to: mydomain.com
How can i set my servers domain name…

Thanks guys!

Hi, you can use bench to setup domain

bench setup add-domain mydomain.com --site [site]
bench config dns_multitenant on
bench setup nginx
sudo service nginx restart
1 Like

I have another question .
if i can setup my domain name on my server the port is included right… im very new at this , can you help figuring out?

Hi

I think you just follow these step. anything error pls post here.

got this error
bench setup add-domain qwerty.com --site site1.local
is it correct?

can you list your site?
run
ls sites/

i got
apps.txt assets comon_site_config.json currentsite.txt erpnext.vm

try this command but with --site erpnext.vm

it works … but i cant access my domain through my browser…

you must edit your hosts file for that

Hey,
Having a similar issue.
After doing the steps outlined above I keep getting the Sorry We’ll Be Back Soon page on the IP address not the domain name that was set up.
Bear in mind that the domain name continues to change to the IP address. The only difference is that I can no longer log in.

What could be causing this and how to fix?
Thanks

Once you turned on the dns multitenant mode, you wont be able to access it using IP address.
You may revert it using this:

bench config dns_multitenant off
bench setup nginx
sudo service nginx restart

I understand that however when the domain name is entered, it changes to the IP address.

Also changing dns_multitenant to off did not make a difference.

I have also tried editing my hosts file to no avail.

May you share your nginx.conf on frappe-bench/config ?

  server_name
            nhs
            site1.local
            catalyst.northgateglobal.com
            ;

    root /home/catalyst/frappe-bench/sites;





    location /assets {
            try_files $uri =404;
    }

    location ~ ^/protected/(.*) {
            internal;
            try_files /$site_name_zokxlpa/$1 =404;
    }

    location /socket.io {
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header X-Frappe-Site-Name $site_name_zokxlpa;
            proxy_set_header Origin $scheme://$http_host;
            proxy_set_header Host $host;

            proxy_pass http://frappe-bench-socketio-server;
    }

    location / {
            try_files /$site_name_zokxlpa/public/$uri @webserver;
    }

    location @webserver {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Frappe-Site-Name $site_name_zokxlpa;
            proxy_set_header Host $host;
            proxy_set_header X-Use-X-Accel-Redirect True;
            proxy_read_timeout 120;                                                                 
            proxy_redirect off;                                                                     
                                                                                                    
            proxy_pass  http://frappe-bench-frappe;                                                 
    }                                                                                               
                                                                                                    
    # error pages                                                                                   
    error_page 502 /502.html;                                                                       
    location /502.html {                                                                            
            root /home/catalyst/.bench/bench/config/templates;                                      
            internal;                                                                               
    }                                                                                               
                                                                                                    
    # optimizations                                                                                 
    sendfile on;                                                                                    
    keepalive_timeout 15;                                                                           
    client_max_body_size 50m;                                                                       
    client_body_buffer_size 16K;                                                                    
    client_header_buffer_size 1k;                                                                   
                                                                                                    
    # enable gzip compresion                                                                        
    # based on https://mattstauffer.co/blog/enabling-gzip-on-nginx-servers-including-laravel-forge  
  
    gzip on;                                                                                    
    gzip_http_version 1.1;                                                                      
    gzip_comp_level 5;                                                                          
    gzip_min_length 256;                                                                        
    gzip_proxied any;                                                                           
    gzip_vary on;                                                                               
    gzip_types                                                                                  
            application/atom+xml                                                                
            application/javascript                                                              
            application/json                                                                    
            application/rss+xml                                                                 
            application/vnd.ms-fontobject                                                       
            application/x-font-ttf                                                              
            application/font-woff                                                               
            application/x-web-app-manifest+json                                                 
            application/xhtml+xml                                                               
            application/xml                                                                     
            font/opentype                                                                       
            image/svg+xml                                                                       
            image/x-icon                                                                        
            text/css                                                                            
            text/plain

Thank you very much, this was the final step on creating a second ERPNEXT site on the same Google Cloud VM.