proxy
proxy copied to clipboard
Proxy can't be installed properly
Hi I tried to install whatsapp proxy on my vps but i couldn't. My vps includes apache and nginx webservers and i installed Debian 11 along with hestia panel on it. I did steps below :
I executed last command
docker run -it -p 80:80 -p 443:443 -p 5222:5222 -p 8080:8080 -p 8443:8443 -p 8222:8222 -p 8199:8199 whatsapp_proxy:1.0
and i got this error
"docker: Error response from daemon: driver failed programming external connectivity on endpoint blissful_bell (09046329ee9a28cdc4a5919a23e851bdcee9b96d794484555a7c485a500b4d39): Error starting userland proxy: listen tcp4 0.0.0.0:8443: bind: address already in use."
also for ports 8080,443 and 80 this message was showed
so i changed my server's ports to 2803,2804,2805 and 2806 and i ran following command
docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 whatsapp_proxy:1.0
then another error arised : "[ALERT] (25) : Binding [/usr/local/etc/haproxy/haproxy.cfg:60] for frontend haproxy_v4_http: cannot bind socket (Permission denied) for [0.0.0.0:80] [ALERT] (25) : Binding [/usr/local/etc/haproxy/haproxy.cfg:69] for frontend haproxy_v4_https: cannot bind socket (Permission denied) for [0.0.0.0:443] [ALERT] (25) : [haproxy.main()] Some protocols failed to start their listeners! Exiting."
To solve the problem above i tried several solutions but non of them worked :
- I cleaned cloned repository and all docker images and containers then i did all steps in order again
- I changed my server's OS to ubuntu 18.0.4 but nothing solved.
- For the last solution i tried https://github.com/docker-library/haproxy/issues/160 and i ran command below:
docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 --sysctl net.ipv4.ip_unprivileged_port_start=0 whatsapp_proxy:1.0
then i faced another error : docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /proc/sys/net/ipv4/ip_unprivileged_port_start: no such file or directory: unknown.
How can i fix it?
Hi I tried to install whatsapp proxy on my vps but i couldn't. My vps includes apache and nginx webservers and i installed Debian 11 along with hestia panel on it. I did steps below :
I executed last command
docker run -it -p 80:80 -p 443:443 -p 5222:5222 -p 8080:8080 -p 8443:8443 -p 8222:8222 -p 8199:8199 whatsapp_proxy:1.0
and i got this error "docker: Error response from daemon: driver failed programming external connectivity on endpoint blissful_bell (09046329ee9a28cdc4a5919a23e851bdcee9b96d794484555a7c485a500b4d39): Error starting userland proxy: listen tcp4 0.0.0.0:8443: bind: address already in use."also for ports 8080,443 and 80 this message was showed
so i changed my server's ports to 2803,2804,2805 and 2806 and i ran following command
docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 whatsapp_proxy:1.0
then another error arised : "[ALERT] (25) : Binding [/usr/local/etc/haproxy/haproxy.cfg:60] for frontend haproxy_v4_http: cannot bind socket (Permission denied) for [0.0.0.0:80] [ALERT] (25) : Binding [/usr/local/etc/haproxy/haproxy.cfg:69] for frontend haproxy_v4_https: cannot bind socket (Permission denied) for [0.0.0.0:443] [ALERT] (25) : [haproxy.main()] Some protocols failed to start their listeners! Exiting."
To solve the problem above i tried several solutions but non of them worked :
- I cleaned cloned repository and all docker images and containers then i did all steps in order again
- I changed my server's OS to ubuntu 18.0.4 but nothing solved.
- For the last solution i tried Running as the haproxy user in 2.4 leaved haproxy unable to start - cannot bind socket (Permission denied) [0.0.0.0:80] docker-library/haproxy#160 and i ran command below:
docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 --sysctl net.ipv4.ip_unprivileged_port_start=0 whatsapp_proxy:1.0
then i faced another error : docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /proc/sys/net/ipv4/ip_unprivileged_port_start: no such file or directory: unknown.
How can i fix it?
Hi @hamed-sharafdoost . The latest error is related to the missing file or directory /proc/sys/net/ipv4/ip_unprivileged_port_start
. To fix this, you could try setting the sysctl
value to 1
instead of 0
. You can run the command:
docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 --sysctl net.ipv4.ip_unprivileged_port_start=1 whatsapp_proxy:1.0
This should allow the container to start successfully.
Thanks @aria1991 but it doesn't work unfortunately. Same error is showed :
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /proc/sys/net/ipv4/ip_unprivileged_port_start: no such file or directory: unknown.
@hamed-sharafdoost No worries. hmm, let's try sth else. Could you please verify whether the file system is mounted on your machine? mount | grep proc
. In case it is not , do sudo mount -t proc proc /proc
( I assume you have root access)
Then could you please check the output of the command sysctl net.ipv4.ip_unprivileged_port_start
? If it is not do sudo sysctl -w net.ipv4.ip_unprivileged_port_start=1
. I hope it would fix your issue , if not try sudo service docker restart
after applying those changes. Let me know if you were able to solve the issue.
Output of mount | grep proc
is :
proc on /proc type proc (rw,relatime,hidepid=2) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pipe_ino=3288410318,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=3288410318)
None of these commands didn't work :
-
sysctl net.ipv4.ip_unprivileged_port_start
-
sudo sysctl -w net.ipv4.ip_unprivileged_port_start=1
We have the same errors again :
sysctl: cannot stat /proc/sys/net/ipv4/ip_unprivileged_port_start: No such file or directory
I tried sudo service docker restart
and did all previous steps but nothing changed.
@hamed-sharafdoost. Could you tell me what is the output of ls /proc/sys/net/ipv4/
?
@aria1991
Ouput of ls /proc/sys/net/ipv4/
:
- conf
- ip_forward
- tcp_fastopen
- fwmark_reflect
- ip_forward_use_pmtu
- tcp_keepalive_intvl
- icmp_echo_ignore_all
- ip_local_port_range
- tcp_keepalive_probes
- icmp_echo_ignore_broadcasts
- ip_no_pmtu_disc
- tcp_keepalive_time
- icmp_errors_use_inbound_ifaddr
- ip_nonlocal_bind
- tcp_mem
- icmp_ignore_bogus_error_responses
- neigh
- tcp_min_snd_mss
- icmp_ratelimit
- ping_group_range
- vs
- icmp_ratemask
- route
- xfrm4_gc_thresh
- ip_default_ttl
- tcp_ecn
@hamed-sharafdoost Seems you don't have ip_unprivileged_port_start
file. So let's make it manually by executing the command below:
sudo sh -c 'echo "1024" > /proc/sys/net/ipv4/ip_unprivileged_port_start'
This will set the starting port number to 1024
, which is the default value for most Linux systems. You can change this value to any other port number that you prefer. After setting this parameter, you may need to restart any services that rely on it, such as Docker or other network-related applications, for the changes to take effect.
Sorry for late reply @aria1991 That's unbelievable.I faced another error and i was struggling to fix it but i could not.
Here is :
sh: 1: cannot create /proc/sys/net/ipv4/ip_unprivileged_port_start: Directory nonexistent
Also i used cat and touch commands but i can't even create a simple txt file. May it relates to my vps configuration?
@hamed-sharafdoost if you have root access, and you are not able to do that, it's better to contact your VPS provider
on synology NAS there is an older Kernel version installed. I cannot get it working either