Nginx default page displayed instead of ERPNext

Using Centos 7, The easy install method creates an ERPNext website on port:8000 of my server IP address.
On my default server IP address the default nginx page is still displayed .
How do I get rid of the nginx default page and display the ERPNext instance instead?

Thanks

1 Like

did you pass --setup-production?

No because I was having issues upgrading to v5 from production install. Is it possible (or advisable) to change the nginx.conf or some other file to point to port:80 rather than port:8000? If so how and where would I do this? And in what account would I do this from root or frappe?
Maybe I should just wait until v5 moves over to Master as it sounds simpler. :smile:

Thanks

If you don’t want to use bench start, and run it like production. Stop your bench start and as root, run

bench setup production {username}

username is the bench user, in most cases it’s frappe.

Hi @pdvyas,
I’m having this issue with the bench setup production
I get that error.

    franky1@capfresh:~/frappe-bench$ sudo bench setup production franky1
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/franky1/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/franky1/bench-repo/bench/cli.py", line 456, in setup_production
    _setup_production(user=user)
  File "/home/franky1/bench-repo/bench/production_setup.py", line 65, in setup_production
    os.symlink(os.path.abspath(os.path.join(bench, 'config', 'nginx.conf')), '/etc/nginx/conf.d/frappe.conf')
OSError: [Errno 17] File exists

What am I missing?

Thanks

François

The symlink already exists, are you running the command second time?

Yes, second and third and fourth times …
But I am not yet in production. How can I switch to production then.
Then reason I am asking is because I’d like to link the public IP with public domain name. I am not on multi-tenants.

Check, the symlink in nginx conf.d dir and supervisor,
Check if supervisor and nginx are running

Thanks Pratik,
Which commands should I use to check that both are running?
Best,
François

What’s the output of the following?

sudo supervisorctl status
service nginx status

Nothing on the first one
and *nginx is running
for the second one

franky1@capfresh:~$ sudo supervisorctl status
franky1@capfresh:~$ service nginx status
 * nginx is running

Run,

unlink /etc/nginx/conf.d/frappe.conf

and run the setup-production command again and share the output

Thanks Pratyk,

I first unlink (with sudo)
then (same errors)

franky1@capfresh:~$ sudo bench setup production franky1
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/franky1/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/franky1/bench-repo/bench/cli.py", line 456, in setup_production
    _setup_production(user=user)
  File "/home/franky1/bench-repo/bench/production_setup.py", line 64, in setup_production
    os.symlink(os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf')), os.path.join(get_supervisor_confdir(), supervisor_conf_filename))
OSError: [Errno 17] File exists
franky1@capfresh:~$

Refer this video and subscribe for more erpnext related videos

simply remove default website by running this 2 commands.

Remove enabled sites

rm -f /etc/nginx/sites-enabled/*

Remove default available site
    
rm /etc/nginx/sites-available/default