Monthly Archives: October 2020

ngxtop


yum install python-pip
pip install ngxtop

ngxtop parses your nginx access log and outputs useful, top-like, metrics of your nginx server. So you can tell what is happening with your server in real-time

ngxtop
running for 411 seconds, 64332 records processed: 156.60 req/sec

Summary:
| count | avg_bytes_sent | 2xx | 3xx | 4xx | 5xx |
|---------+------------------+-------+-------+-------+-------|
| 64332 | 2775.251 | 61262 | 2994 | 71 | 5 |

SYSERR(autoresponse): Too many hops 27 (25 max): from mailer-daemon via localhost, to


autoresponse[66556]: Unauthenticated attempt to set autoresponse message for mailer-daemon from 127.0.0.1!
Authentication-Warning: autoresponse set sender to mailer-daemon using -f

SYSERR(autoresponse): Too many hops 27 (25 max): from mailer-daemon via localhost, to
DSN: Too many hops 27 (25 max): from mailer-daemon via localhost, to
relay=autoresponder, delay=0.18, delays=0.06/0/0/0.13, dsn=5.3.0, status=bounced (service unavailable)

yum remove sendmail
service postfix restart

VsFTPD virtual host ubuntu


vsftpd read only user
apt-get update
apt-get install vsftpd libpam-pwdfile

cp -v /etc/vsftpd.conf /etc/vsftpd.conf.bak
vi /etc/vsftpd.conf

anonymous_enable=NO
local_enable=YES
chroot_local_user=YES
user_config_dir=/etc/vsftpd/vsftpd-virtual-user/
virtual_use_local_privs=YES
dual_log_enable=YES
connect_from_port_20=YES
listen=YES
pam_service_name=ftp
tcp_wrappers=YES
allow_writeable_chroot=YES

service vsftpd restart

mkdir -p -v /etc/vsftpd/vsftpd-virtual-user/
cp -v /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bak

session optional pam_keyinit.so force revoke
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
session include system-auth
session required pam_loginuid.so

useradd --home /home/user --gid nogroup -m --shell /bin/false user
passwd user

echo user >> /etc/vsftpd/vsftpd-virtual-user
vi /etc/vsftpd/vsftpd-virtual-user/user

local_root=/home/USERNAME
cmds_allowed=USER,PASS,SYST,FEAT,OPTS,PWD,TYPE,PASV,LIST,STOR,CWD,MKD,SIZE,MDTM,CDUP,RETR,RNFR,RNTO,QUIT
local_umask=022
write_enable=YES

To allow delete add DELE

Other options:
cmds_allowed=ABOR,CWD,LIST,MDTM,MKD,NLST, PASS,PASV,PORT,PWD,QUIT,RETR,RMD,RNFR, RNTO,SITE,SIZE,STOR,TYPE,USER,ACCT, APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST

Allow another user write STOR files: usermod -a -G user another_user

dpkg: error processing package redis (–configure)

dpkg: error processing package redis-server (–configure):
installed redis-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of redis:
redis depends on redis-server (<< 5:4.0.9-1ubuntu0.2.1~); however: Package redis-server is not configured yet. redis depends on redis-server (>= 5:4.0.9-1ubuntu0.2); however:
Package redis-server is not configured yet.

dpkg: error processing package redis (–configure):
dependency problems – leaving unconfigured
Processing triggers for libc-bin (2.27-3ubuntu1.2) …
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (237-3ubuntu10.42) …

vi /etc/redis/redis.conf
bind 127.0.0.1
supervised systemd

Again:
apt install redis-server

pecl another php version

pecl multiple php version
pecl install mcrypt
pecl/mcrypt is already installed and is the same as the released version 1.0.3
install failed

update-alternatives –config=php
update-alternatives –config=php-config
update-alternatives –config=phpize

pecl install -f pecl

Also can help config-set:
pecl config-set ext_dir /usr/lib/php/20201226
pecl config-set php_bin /usr/bin/php7.4
pecl config-set php_ini /etc/php/7.4/cli/php.ini
pear config-set ext_dir /usr/lib/php/20201226
pear config-set php_bin /usr/bin/php7.4

varnish can not change port

If you want to change to 8888:

grep -R 'ExecStart=/usr/sbin/varnishd' /etc/
/etc/systemd/system/multi-user.target.wants/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :8888 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m

systemctl daemon-reload
systemctl restart varnish.service