More information :
Command :
bench start
Result :
yawar-frappe@yict:~/frappe-bench$ bench start
23:41:58 system | redis_queue.1 started (pid=11593)
23:41:58 system | redis_cache.1 started (pid=11598)
23:41:58 redis_queue.1 | 11596:C 01 Feb 2024 23:41:58.405 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
23:41:58 redis_queue.1 | 11596:C 01 Feb 2024 23:41:58.405 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=11596, just started
23:41:58 redis_queue.1 | 11596:C 01 Feb 2024 23:41:58.405 # Configuration loaded
23:41:58 redis_queue.1 | 11596:M 01 Feb 2024 23:41:58.406 * Increased maximum number of open files to 10032 (it was originally set to 1024).
23:41:58 system | worker.1 started (pid=11602)
23:41:58 redis_queue.1 | 11596:M 01 Feb 2024 23:41:58.407 # Could not create server TCP listening socket 127.0.0.1:11000: bind: Address already in use
23:41:58 system | redis_queue.1 stopped (rc=1)
23:41:58 redis_cache.1 | 11601:C 01 Feb 2024 23:41:58.410 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
23:41:58 redis_cache.1 | 11601:C 01 Feb 2024 23:41:58.410 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=11601, just started
23:41:58 redis_cache.1 | 11601:C 01 Feb 2024 23:41:58.410 # Configuration loaded
23:41:58 redis_cache.1 | 11601:M 01 Feb 2024 23:41:58.410 * Increased maximum number of open files to 10032 (it was originally set to 1024).
23:41:58 redis_cache.1 | 11601:M 01 Feb 2024 23:41:58.411 # Could not create server TCP listening socket 127.0.0.1:13000: bind: Address already in use
23:41:58 system | redis_cache.1 stopped (rc=1)
23:41:58 system | watch.1 started (pid=11606)
23:41:58 system | web.1 started (pid=11608)
23:41:58 system | socketio.1 started (pid=11607)
23:41:58 system | schedule.1 started (pid=11603)
23:41:58 system | sending SIGTERM to web.1 (pid 11608)
23:41:58 system | sending SIGTERM to socketio.1 (pid 11607)
23:41:58 system | sending SIGTERM to watch.1 (pid 11606)
23:41:58 system | sending SIGTERM to schedule.1 (pid 11603)
23:41:58 system | sending SIGTERM to worker.1 (pid 11602)
23:41:58 system | web.1 stopped (rc=-15)
23:41:58 system | watch.1 stopped (rc=-15)
23:41:58 system | schedule.1 stopped (rc=-15)
23:41:58 system | socketio.1 stopped (rc=-15)
23:41:58 system | worker.1 stopped (rc=-15)
Command :
python3 stop.py
Result :
yawar-frappe@yict:~/frappe-bench$ sudo python3 stop.py
11000/tcp: 11665
Port 12000 already closed
13000/tcp: 11687
9000/tcp: 11688
8000/tcp: 610 674 746 825 857 882 884 887 888 889 890 891
bench stopped
yawar-frappe@yict:~/frappe-bench$ python3 stop.py
11000/tcp: 11752
Port 12000 already closed
13000/tcp: 11772
9000/tcp: 11773
8000/tcp: 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734
bench stopped
yawar-frappe@yict:~/frappe-bench$ python stop.py
11000/tcp: 11836
Port 12000 already closed
13000/tcp: 11854
9000/tcp: 11859
8000/tcp: 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828
bench stopped
yawar-frappe@yict:~/frappe-bench$ python3 stop.py
11000/tcp: 11911
Port 12000 already closed
13000/tcp: 11931
9000/tcp: 11936
8000/tcp: 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905
bench stopped
yawar-frappe@yict:~/frappe-bench$
Command :
bench start
yawar-frappe@yict:~/frappe-bench$ bench start
23:47:36 system | redis_cache.1 started (pid=12006)
23:47:36 system | redis_queue.1 started (pid=12010)
23:47:36 system | web.1 started (pid=12012)
23:47:36 redis_cache.1 | 12011:C 01 Feb 2024 23:47:36.582 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
23:47:36 redis_cache.1 | 12011:C 01 Feb 2024 23:47:36.582 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=12011, just started
23:47:36 redis_cache.1 | 12011:C 01 Feb 2024 23:47:36.582 # Configuration loaded
23:47:36 redis_queue.1 | 12016:C 01 Feb 2024 23:47:36.583 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
23:47:36 redis_queue.1 | 12016:C 01 Feb 2024 23:47:36.583 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=12016, just started
23:47:36 redis_queue.1 | 12016:C 01 Feb 2024 23:47:36.583 # Configuration loaded
23:47:36 redis_cache.1 | 12011:M 01 Feb 2024 23:47:36.583 * Increased maximum number of open files to 10032 (it was originally set to 1024).
23:47:36 redis_cache.1 | 12011:M 01 Feb 2024 23:47:36.583 # Could not create server TCP listening socket 127.0.0.1:13000: bind: Address already in use
23:47:36 redis_queue.1 | 12016:M 01 Feb 2024 23:47:36.584 * Increased maximum number of open files to 10032 (it was originally set to 1024).
23:47:36 redis_queue.1 | 12016:M 01 Feb 2024 23:47:36.584 # Could not create server TCP listening socket 127.0.0.1:11000: bind: Address already in use
23:47:36 system | redis_cache.1 stopped (rc=1)
23:47:36 system | redis_queue.1 stopped (rc=1)
23:47:36 system | watch.1 started (pid=12021)
23:47:36 system | socketio.1 started (pid=12024)
23:47:36 system | worker.1 started (pid=12019)
23:47:36 system | schedule.1 started (pid=12020)
23:47:36 system | sending SIGTERM to web.1 (pid 12012)
23:47:36 system | sending SIGTERM to socketio.1 (pid 12024)
23:47:36 system | sending SIGTERM to watch.1 (pid 12021)
23:47:36 system | sending SIGTERM to schedule.1 (pid 12020)
23:47:36 system | sending SIGTERM to worker.1 (pid 12019)
23:47:36 system | worker.1 stopped (rc=-15)
23:47:36 system | socketio.1 stopped (rc=-15)
23:47:36 system | web.1 stopped (rc=-15)
23:47:36 system | schedule.1 stopped (rc=-15)
23:47:36 system | watch.1 stopped (rc=-15)
yawar-frappe@yict:~/frappe-bench$
File : nginx.conf
yawar-frappe@yict:~/frappe-bench/config$ cat nginx.conf
upstream frappe-bench-frappe {
server 127.0.0.1:8000 fail_timeout=0;
}
upstream frappe-bench-socketio-server {
server 127.0.0.1:9000 fail_timeout=0;
}
# setup maps
# server blocks
server {
listen 8000;
listen [::]:8000;
server_name
yawarerp.com
;
root /home/yawar-frappe/frappe-bench/sites;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
add_header X-Frame-Options "SAMEORIGIN";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy "same-origin, strict-origin-when-cross-origin";
location /assets {
try_files $uri =404;
add_header Cache-Control "max-age=31536000";
}
location ~ ^/protected/(.*) {
internal;
try_files /yawarerp.com/$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 yawarerp.com;
proxy_set_header Origin $scheme://$http_host;
proxy_set_header Host $host;
proxy_pass http://frappe-bench-socketio-server;
}
location / {
rewrite ^(.+)/$ $1 permanent;
rewrite ^(.+)/index\.html$ $1 permanent;
rewrite ^(.+)\.html$ $1 permanent;
location ~* ^/files/.*.(htm|html|svg|xml) {
add_header Content-disposition "attachment";
try_files /yawarerp.com/public/$uri @webserver;
}
try_files /yawarerp.com/public/$uri @webserver;
}
location @webserver {
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frappe-Site-Name yawarerp.com;
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/yawar-frappe/.local/lib/python3.10/site-packages/bench/config/templates;
internal;
}
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
# 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
text/x-component
;
# text/html is always compressed by HttpGzipModule
}
File :redis_cache.conf
dbfilename redis_cache.rdb
dir /home/yawar-frappe/frappe-bench/config/pids
pidfile /home/yawar-frappe/frappe-bench/config/pids/redis_cache.pid
bind 127.0.0.1
port 13000
maxmemory 307mb
maxmemory-policy allkeys-lru
appendonly no
save ""
aclfile /home/yawar-frappe/frappe-bench/config/redis_cache.acl
File :redis_queue.conf
dbfilename redis_queue.rdb
dir /home/yawar-frappe/frappe-bench/config/pids
pidfile /home/yawar-frappe/frappe-bench/config/pids/redis_queue.pid
bind 127.0.0.1
port 11000
aclfile /home/yawar-frappe/frappe-bench/config/redis_queue.acl
File : /frappe-bench/Procfile
redis_cache: redis-server config/redis_cache.conf
redis_queue: redis-server config/redis_queue.conf
web: bench serve --port 8000
socketio: /home/yawar-frappe/.nvm/versions/node/v18.19.0/bin/node apps/frappe/socketio.js
watch: bench watch
schedule: bench schedule
worker: bench worker 1>> logs/worker.log 2>> logs/worker.error.log
File : /frappe-bench/sites$ cat common_site_config.json
{
"background_workers": 1,
"default_site": "yawarerp.com",
"file_watcher_port": 6787,
"frappe_user": "yawar-frappe",
"gunicorn_workers": 11,
"live_reload": true,
"maintenance_mode": 0,
"pause_scheduler": 0,
"rebase_on_pull": false,
"redis_cache": "redis://127.0.0.1:13000",
"redis_queue": "redis://127.0.0.1:11000",
"redis_socketio": "redis://127.0.0.1:13000",
"restart_systemd_on_update": false,
"serve_default_site": true,
"shallow_clone": true,
"socketio_port": 9000,
"use_redis_auth": false,
"webserver_port": 8000