How to start the system?

I have installed the latest build of ERPNext system.

But I just knew how to start from the command line:
./lib/wnf.py --serve

However, I want the system automatically starts once the OS is turned on / by command.
May anyone can help me? Thanks!~



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.

On Wed, Nov 6, 2013 at 10:18 PM, Kenneth K ke...@yahoo.com.hk wrote:

I have installed the latest build of ERPNext system.

But I just knew how to start from the command line:
./lib/wnf.py --serve

However, I want the system automatically starts once the OS is turned on /
by command.
May anyone can help me? Thanks!~


Note:

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much
    information as you can. Please see it from the point of view of the person
    receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send
    only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do
    not send images as attachments. Links are good. Same goes for any file you
    are going to send.

End of Note

You received this message because you are subscribed to the Google Groups
“ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to erpnext-developer-forum+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Kenneth,
Please follow the instructions here,

Gunicorn is a production ready webserver.
Supervisor is for process management (making sure that the wsgi server is up).
nginx for proxying + serving static to port 80.

Thanks,

Pratik
ERPNext

For the following procedures, I cannot find the directory but I can find /etc/supervisord.conf
So I cannot add a file gunicorn.conf to /etc/supervisor/conf.d/
Are they same?

Also for nginx.. My configuration file is as follows:
But the results show 502 Bad Gateway

# For more information on configuration, see:

#   * Official English Documentation: http://nginx.org/en/docs/

#   * Official Russian Documentation: http://nginx.org/ru/docs/


user              nginx;

worker_processes  1;


error_log  /var/log/nginx/error.log;

#error_log  /var/log/nginx/error.log  notice;

#error_log  /var/log/nginx/error.log  info;


#pid        /var/run/nginx.pid;



events {

    worker_connections  1024;

        accept_mutex off;

}



http {

    include       mime.types;

    default_type  application/octet-stream;


    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

                      '$status $body_bytes_sent "$http_referer" '

                      '"$http_user_agent" "$http_x_forwarded_for"';


    access_log  /var/log/nginx/access.log  combined;


    sendfile        on;

    #tcp_nopush     on;


    #keepalive_timeout  0;

    keepalive_timeout  65;


    #gzip  on;


    # Load config files from the /etc/nginx/conf.d directory

    # The default server is in conf.d/default.conf

    #include /etc/nginx/conf.d/*.conf;


    types_hash_max_size 2048;


    upstream erpnext {

                server 127.0.0.1:8000 fail_timeout=0;

    }



         server {

                listen 80 default;

                client_max_body_size 4G;

                server_name localhost;

                keepalive_timeout 5;

                root /var/www/html/public;


                location / {

                        try_files $uri @magic;

                }


                location @magic {

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_set_header Host $http_host;

                proxy_redirect off;

                        proxy_pass  http://127.0.0.1:8000;

                }



         }

}




Thanks,
Kenneth



On Thursday, 7 November 2013 01:46:36 UTC+8, pdvyas wrote:
On Wed, Nov 6, 2013 at 10:18 PM, Kenneth K <ke...@yahoo.com.hk> wrote:
> I have installed the latest build of ERPNext system.
>
> But I just knew how to start from the command line:
> ./lib/wnf.py --serve
>
> However, I want the system automatically starts once the OS is turned on /
> by command.
> May anyone can help me? Thanks!~
>
> --
> Note:
>
> If you are posting an issue,
> 1. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 2. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 3. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer-forum+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Hi Kenneth,
Please follow the instructions here,
https://github.com/webnotes/erpnext/wiki/WSGI-Production-Deployment

Gunicorn is a production ready webserver.
Supervisor is for process management (making sure that the wsgi server is up).
nginx for proxying + serving static to port 80.

Thanks,
--
Pratik
ERPNext



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.

On Wed, Nov 6, 2013 at 11:21 PM, Kenneth K ke...@yahoo.com.hk wrote:

For the following procedures, I cannot find the directory but I can find
/etc/supervisord.conf
So I cannot add a file gunicorn.conf to /etc/supervisor/conf.d/
Are they same?

What version of supervisor are you running, try installing supervisor 3+.

Also for nginx… My configuration file is as follows:
But the results show 502 Bad Gateway

It will give 502 because the wsgi server is not running at
http://127.0.0.1:8000/
You can try running gunicorn in daemon mode (without supervisor) for
the time being

cd /path/to/erpnext
gunicorn -b 127.0.0.1:8000 -w 2 lib.webnotes.app:application
cd /path/to/erpnext
gunicorn -b 127.0.0.1:8000 -w 2 lib.webnotes.app:application

Sorry, the above command doesn’t start in daemon mode, the following one does

cd /path/to/erpnext
gunicorn lib.webnotes.app:application -b localhost:8000 -D
Pratik,

Thanks for your big help.
I was so confused as before.
Enjoying the system with new bases!

Cheers,
Kenneth

On Thursday, 7 November 2013 02:03:55 UTC+8, Pratik Vyas wrote:
> ```
> cd /path/to/erpnext
> gunicorn -b 127.0.0.1:8000 -w 2 lib.webnotes.app:application
> ```

Sorry, the above command doesn't start in daemon mode, the following one does

```
cd /path/to/erpnext
gunicorn lib.webnotes.app:application -b localhost:8000 -D
```



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.

On Thu, Nov 7, 2013 at 11:57 PM, Kenneth K ke...@yahoo.com.hk wrote:

Pratik,

Thanks for your big help.
I was so confused as before.
Enjoying the system with new bases!

Glad to know :slight_smile:

Cheers,
Kenneth