Change default port 80

I have xampp installed on my syatem that used port 80 itself,
now i want to install erpnext on my system but the problem is it’s also run on port 80.
so my xampp stoped working after installation of erpnext,

i want to change port for erpnext

please guide me how can i change or assign new port to erpnext.

All suggestions are welcome.

You can assign a port by running:

bench set-nginx-port <sitename> 8090

and then

bench setup nginx

sudo service nginx reload

2 Likes

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/vertax/bench-repo/bench/cli.py”, line 36, in cli
return bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/vertax/bench-repo/bench/cli.py”, line 206, in set_nginx_port
_set_nginx_port(site, port)
File “/home/vertax/bench-repo/bench/utils.py”, line 244, in set_nginx_port
generate_nginx_config()
File “/home/vertax/bench-repo/bench/config.py”, line 62, in generate_nginx_config
with open(“config/nginx.conf”, ‘w’) as f:
IOError: [Errno 13] Permission denied: ‘config/nginx.conf’

show me this error when i run above cmd

Run bench patch fix-perms as root to fix the perms and then try the commands again.

i run this cmd and set port 8765 now when i run

http://localhost:8765/
this url

Unable to connect error coming

1 Like

is this after running sudo service nginx reload? Can you post /etc/nginx/conf.d/frappe.conf?

server_names_hash_bucket_size 64;

upstream frappe {
server 127.0.0.1:8000 fail_timeout=0;
}

server {
listen 9000 ;
client_max_body_size 4G;
server_name vertax_management;
keepalive_timeout 5;
sendfile on;
root /home/vertax/frappe-bench/sites;

    location /private/ {
        internal;
        try_files /$uri =424;
    }

    location /assets {
        try_files $uri =404;
    }

    location / {
        try_files /vertax_management/public/$uri @magic;
    }

    location @magic {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header Host vertax_management;
                    proxy_set_header X-Use-X-Accel-Redirect True;
        proxy_read_timeout 120;
        proxy_redirect off;
        proxy_pass  http://frappe;
    }
}

Looks good to me, did you run sudo service nginx restart?

yes by this cmd

sudo service nginx reload

Is nginx running?
Just try using sudo service nginx restart and the output of curl -I http://localhost:9000

sudo service nginx restart

this shows Restarting nginx: nginx.

root@vertax30:~# curl -I http://localhost:9000
HTTP/1.1 500 Internal Server Error
Server: nginx/1.1.19
Date: Fri, 21 Nov 2014 14:09:20 GMT
Content-Type: text/html
Content-Length: 141
Connection: keep-alive

after curl cmd i got this result

HTTP/1.1 500 Internal Server Error
Server: nginx/1.1.19
Date: Fri, 21 Nov 2014 14:09:20 GMT
Content-Type: text/html
Content-Length: 141
Connection: keep-alive

Can you see the trace?
What is in tail /var/log/ningx/error.log?

error log is empty, no error in this file

Now when i run this url

localhost:9000

Internal Server Error

error coming

Can you try using, bench frappe --serve --port 8090? it wil start a dev server on port 8090. Send request to that and post the exception.

Don not run this command patch fix-perms!! it will delete your doctype permission table and lock you out of you instant.