find / -ianme nginxinstaller
./nginxinstaller uninstall
service httpd restart
Monthly Archives: August 2014
unknown variable ‘default-character-set=utf8’
Fix.
Remove default-character-set=utf8 from /etc/my.cnf
which partition belongs directory
df -T /some_directory_name
/usr/sbin/mysqld: Can’t create/write to file ‘/tmp/ibCuoEqk’ (Errcode: 2)
Fix.
mkdir /tmp
chmod 1777 /tmp
service mysqld start
tar extract files and skip structure
cd destination/
tar xzf backup_files.tar.gz –transform=’s/.*\///’
It works like charm.
kill user by pts number
skill -KILL -v pts/1
skill -KILL -u vitalijus
skill -STOP -u vitalijus or skill -CONT -u vitalijus (stops/resumes)
bash: monitor server free disk space
vi /etc/cron.hourly/hdd_space.sh
#!/bin/sh
# Monitoring server free disk space by Vitalijus Ryzakovas
email=”[email protected]”
proc=85
df -H | grep -vE ‘^Filesystem|tmpfs|cdrom’ | awk ‘{ print $5 ” ” $1 }’ | while read output;
do
usep=$(echo $output | awk ‘{ print $1}’ | cut -d’%’ -f1 )
partition=$(echo $output | awk ‘{ print $2 }’ )
if [ $usep -ge $proc ]; then
echo “Your are running out of disk space \”$partition ($usep%)\” $(hostname) on date $(date)” |
mail -s “Importnat! Server disk space $usep” $mail
fi
done
centos 7 missing /var/log/secure
Yes its systemd world, so you need just look there:
journalctl -u sshd | tail -n 100
hosts.allow vs hosts.deny
# /etc/hosts.allow
sshd: 192.168.0.100/255.255.255.255
# /etc/hosts.deny
sshd: ALL
update ssh fingerprint
ssh-keyscan IP_ADDR >> ~/.ssh/known_hosts
apache disable website
order deny, allow
deny from all
allow from xx.xx.xx.xx
centos – msg: error: tty device is not owned by group tty
This error message you can face in single user mode when you are running Centos OS, so you should switch to multiuser mode.
disable cphulk over ssh
/usr/local/cpanel/etc/init/stopcphulkd stop
mysql cphulkd
delete from brutes;
delete from logins;
sudo: sorry, you must have a tty to run sudo
visudo
#Defaults requiretty
error in ifcfg-eth0-range0: IPADDR_START and IPADDR_END don’t agree
You should check if IPADDR_START or IPADDR_END syntax is correct maybe its misplaced.