Apache or Nginx on debian

2023-05-29 Thread Tom Reed
Hello list, Though the question is not directly related to debian. But since most of you are sysadmin expects, may I ask that for running a simple web service, should I choose nginx or apache, and why? The service is combined by some php and python scripts, with redis as backend DB. Thanks. Tom

Re: netmask question

2023-05-22 Thread Tom Reed
> On Tue, May 23, 2023 at 08:24:10AM +0800, Tom Reed wrote: >> Sorry for my newbie question too. >> >> If I know the network addr: 192.168.1.0 >> And know the broadcast addr: 192.168.1.255 >> Then I should have the possibility to cal the netmask a

Re: netmask question

2023-05-22 Thread Tom Reed
> Tom Reed wrote: >> >> > >> > That's right, but then they go 0 .. 2^8 - 1. 2^8 is still 256, Tim >> does >> > have a point there :-) >> > >> >> For a given ipv4, if I know net addr and broadcast addr, how will I >> calculate

Re: netmask question

2023-05-22 Thread Tom Reed
> > That's right, but then they go 0 .. 2^8 - 1. 2^8 is still 256, Tim does > have a point there :-) > For a given ipv4, if I know net addr and broadcast addr, how will I calculate the netmask? -- sent from https://dkinbox.com/

Re: iptables reject with TCP RST

2023-05-14 Thread Tom Reed
> Hello, > > On Mon, May 15, 2023 at 09:10:24AM +0800, Tom Reed wrote: >> If I clean iptables in the destination host, this telnet will get >> success >> at once. >> >> Any hints? > > Why have you not used "iptables -vL" to show the

Re: iptables reject with TCP RST

2023-05-14 Thread Tom Reed
> > so whatever your 193.106.250.x host is, maybe it did indeed block > the packets itself, but would be good to verify. > Hello I have checked for details but didn't get the luck. My destination host does have the rules: REJECT tcp -- 0.0.0.0/00.0.0.0/0tcp

Re: shell script run in backend

2023-05-14 Thread Tom Reed
stem service as Jeremy Ardley suggests in a different reply. > > Exactly: > > script > /tmp/script.log 2>&1 & > > (adjust paths to taste). For good measure, and if your shell > has job control, it will output the job number and PID, like > so: > > [1] 15211 > > (1 is the job number, 15211 is

shell script run in backend

2023-05-14 Thread Tom Reed
Hello list I have a long run shell script with similar content, #!/bin/bash while [ 1 ];do func1() func2() sleep 5 done Currently the script is running in front-end in shell. How can I run it with the backend way? can I register it as a system service? Thanks

Re: iptables reject with TCP RST

2023-05-13 Thread Tom Reed
> On Sun, May 14, 2023 at 08:36:38AM +0800, Tom Reed wrote: >> tcp0 0 0.0.0.0:587 0.0.0.0:* >> LISTEN >> 32157/master >> >> >> And the telnet results: >> >> $ telnet 193.106.250.xx 587 >> Trying 193.106.250.xx..

Re: iptables reject with TCP RST

2023-05-13 Thread Tom Reed
> > On 14/5/23 08:28, Tom Reed wrote: >> I telnet to host:587 not the port 23. >> And port 587 already reject access with tcp rst. > -- > > check if you are listening on port 587 > > netstat -tulpnW | grep 587 > > yes it does. tcp0

Re: iptables reject with TCP RST

2023-05-13 Thread Tom Reed
> > On 14/5/23 08:14, Tom Reed wrote: >> /usr/sbin/iptables -A INPUT -p tcp --dport 143 -j REJECT --reject-with >> tcp-reset >> /usr/sbin/iptables -A INPUT -p tcp --dport 587 -j REJECT --reject-with >> tcp-reset >> >> When I telnet from another h

iptables reject with TCP RST

2023-05-13 Thread Tom Reed
Hello I have these iptables rules which reject tcp connections with tcp rst. /usr/sbin/iptables -A INPUT -p tcp --dport 143 -j REJECT --reject-with tcp-reset /usr/sbin/iptables -A INPUT -p tcp --dport 587 -j REJECT --reject-with tcp-reset When I telnet from another host to the protected port,

Re: iptables and system reboot

2023-05-13 Thread Tom Reed
> > On 13/5/23 18:56, Tom Reed wrote: >> for iptables-save, after system rebooting, does it know where to locate >> the file? > > Yes. That's all taken care of by the iptables-persistent package > > Also I made a typo. correction; > > sudo nano /etc/iptables/

Re: iptables and system reboot

2023-05-13 Thread Tom Reed
> > On 13/5/23 18:48, Tom Reed wrote: >> How to recovery iptable rules after system rebooting? >> I know I can put a @reboot crontab for this but there is maybe the >> better >> way. > > > sudo apt install iptables-persistent > > sudo iptables-save >

iptables and system reboot

2023-05-13 Thread Tom Reed
Hello How to recovery iptable rules after system rebooting? I know I can put a @reboot crontab for this but there is maybe the better way. Thanks

Re: sudoers question

2023-05-12 Thread Tom Reed
> Tom Reed (12023-05-12): >> otherwise every time i have to input password for sudo. > > Yes, that is the point. > > If “every time” is a lot for you, maybe your use habits need to be > reviewed. > that's normal. for example, I have to check every kind of logs (m

Re: sudoers question

2023-05-12 Thread Tom Reed
> On Fri, May 12, 2023 at 07:27:25PM +0800, Tom Reed wrote: >> what's the right way to add an user to run sudo without password? >> I have to edit /etc/sudoers by manual. But I don't think it's a grace >> way. > > *Without password*?? Yes, that

sudoers question

2023-05-12 Thread Tom Reed
Hello what's the right way to add an user to run sudo without password? I have to edit /etc/sudoers by manual. But I don't think it's a grace way. Thanks. Tom