centos7 : inotify inotifywait convmv Hint

# yum install inotify # yum install convmv test.sh --------------------------- #!/bin/sh # /root/bin/inotifywaitWP.sh /home/*/*/wordpress/wp-content/uploads EVENTS="CREATE,MOVED_TO" if [ -z "$1" ]; then     echo "Usage: $0 cmd ..."     exit -1; fi inotifywait -e "$EVENTS" -mrq --format '%w%f' $1 | (         while read FILE;         do   […]

Read More

Centos7 : apache MPM Hint

# httpd -V | grep MPM Server MPM:     prefork CentOS provide 3 way modules, need to select only one. prefork => default worker event Change prefork to worker # vi /etc/httpd/conf.modules.d/00-mpm.conf #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so LoadModule mpm_worker_module modules/mod_mpm_worker.so #vi /etc/httpd/conf.modules.d/10-php.conf <IfModule prefork.c>   LoadModule php5_module modules/libphp5.so </IfModule> <IfModule worker.c>   LoadModule php5_module modules/libphp5-zts.so </IfModule> […]

Read More

cenos7 : firewall-cmd, Lockdown, fail2ban-firewalld Hint

masquerade firewall-cmd --zone=external --query-masquerade firewall-cmd --zone=external --add-masquerade external port forward firewall-cmd --zone=external --list-all firewall-cmd --zone=external --add-forward-port=port=22:proto=tcp:toport=2222:toaddr=192.168.0.11 Lockdown # vi /etc/firewalld/firewalld.conf Lockdown=yes # firewall-cmd --reload # firewall-cmd --query-lockdown # firewall-cmd --lockdown-on # firewall-cmd --lockdown-off Block IP # firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="192.168.0.41" accept' # firewall-cmd --list-all # firewall-cmd --zone=public --remove-rich-rule='rule family="ipv4" source address="192.168.0.41" accept' # […]

Read More

centos7 : logtop hint

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm rpm -ivh epel-release-7-5.noarch.rpm yum install git ncurses-devel uthash-devel git clone https://github.com/JulienPalard/logtop.git cd logtop make make install tail -f /var/log/httpd/access_log | awk {'print $1; fflush();'} | logtop

Read More