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 →

If you can’t start Junier SSL VPN and got the error below in system viewer: taskhost (2940) WebCacheLocal: Database recovery/restore failed with unexpected error -1032 Here is the fix: Delete this file: “C:\Users\username\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat” Wecache is a hidden folder, make sure you change the option to see it.Read 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. <? //Some apache process are in close_wait $cmd=”netstat -ntp | grepRead More →

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # server info and status RewriteRule ^(server-info|server-status) – [L] # RewriteCond %{REQUEST_URI} !=/server-status # /server info and status RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_FILENAME} -d RewriteRule . index.php [L] </IfModule> # END WordPressRead More →

Run this script to see your SSL Version <?php $ch = curl_init(‘https://www.howsmyssl.com/a/check’); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); $json = json_decode($data); echo $json->tls_version; ?>   If you want to check your open SSL version? <?php $curl_info = curl_version(); echo $curl_info[‘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 →