Mysql – repair/check all tables in all databases
The below command will go through all tables in all database databases to do a repair check. mysqlcheck -uroot -p -A –auto-repairRead More →
The below command will go through all tables in all database databases to do a repair check. mysqlcheck -uroot -p -A –auto-repairRead More →
You got error ” too many connections” when connecting to database, when you check the server “show processlist” you see a lot of process having “sleep” status. Here is the fix: change wait_timeout in /etc/mysql/my.cnf: wait_timeout = 600 # if this number is too low , you will get Lost Connection error when doing query then rebootRead More →
You try to increase your connections to 1000 by editing /etc/mysql/my.cnf (change max_connections=1000) , but when you login to your database, you can only see your mysql only accept upto 214 connections? It’s because the open_files_limit in Ubuntu system, here is the fix: Edit nano /lib/systemd/system/mysql.service And add this line to the end: LimitNOFILE=8192 Then run the 2 below commands or reboot the server systemctl daemon-reload systemctl restart mysql.serviceRead More →
List all php packages installed: dpkg -l | grep php| awk ‘{print $2}’ |tr “\n” ” ” Remove all php package: sudo aptitude purge dpkg -l | grep php| awk '{print $2}' |tr "\n" " "
Add PPA sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php5.6 You can install php5.6 modules too for example sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml Verify your version sudo php -vRead More →
Edit file: /etc/rc.local This file will auto run at startup. This file is a bash file, it might be run when all the services is not ready yet, such as the internet is not ready. If you run immediately, there might be some problems such as the database connection is not ready yet, you wont be able to connect to database server. It’s better to let this script to sleep for a while, then start the job. This is my file: #!/bin/bash sleep 100 # wait for 100 seconds php /www/jobs/update_records.php Read More →
Our servers recently were crashed due to a large number connections to web (apache) services, we didn’t see anything abnormal on the web. The server will crash when there are over 150 connections, these connections could just come from one IP. After a long investigation, we realize that the attacker attack us by sending a lot of connections, but somehow they put all the TCP status in CLOSE_WAIT status, apache can’t release this. The solution is , we write this script to kill all httpd process having CLOSE_WAIT status. This seems fixing our problems.Read More →
#View Raid Status cat /proc/mdstat #View the member of a raid mdadm /dev/md1 #View Hard disk info – such as serial hdparm -i #List all hard disks detected by the OS lshw -class disk -short Read More →
Run this script to see your SSL Version If you want to check your open SSL version? OpenSSL 1.0.1 and later supportĀ TLS v1.1 and TLS v1.2 If you see your OpenSSL version from 1.0.1, then it will support TLS V1.1 and TLS V1.2Read More →
Designed using Responsive Brix. Powered by WordPress.