Showing posts from December, 2015

How to Optimize WordPress for Better Performance

Lean how to speed-up your WordPress website
In this tutorial we will give you some tips on how to improve the speed of your WordPress website. Having a fast site is essential if you want to provide your visitors with great user experience and rank well in the search engines like Google and Bing which take the loading speed of your pages into consideration. This tutorial covers the following topics:Enable Dynamic CachingEnable gZIP compressionUse a CDNOptimize your ImagesMinify your JavaScript and CSS filesLeverage browser cachingOptimize your WordPress Database Enable Dynamic Caching Adding properly configured Dynamic caching to your WordPress site will have great effect on its speed. There are many services like Varnish and APC that can be used but all of them require a lot of server configuration and tweaking of your application to work correctly. This is why, we at Navicosoft have created a tool called the SuperCacher. With it, all you need to do is install a small plugin and enabl…

maldet quarantined all js, css, mysql and even some PHP Files - Solved

I installed Linux Malware Detect v1.5 (LMD) on one of our newly installed cpanel servers with CloudLinux and KernelCare. Configured it and ran on the whole of the server.What I found is that maldet detected even .js, .css, mysql and even some PHP files as threats so I wrote on git and all developer forums but never got any solution.I then found the value scan_max_depth to be a higher value so edited it to get rid of this issue. The ideal configuration file maldet conf.maldet for a cpanel server should have the following values to run smoothly:## # Linux Malware Detect v1.5 # (C) 2002-2015, R-fx Networks <> # (C) 2015, Ryan MacDonald <> # This program may be freely redistributed under the terms of the GNU GPL v2 ## # ## # [ General Options ] ## # Enable or disable e-mail alerts, this includes application version # alerts as well as automated/manual scan reports. On-demand reports # can still be sent using '--report SCAN…

SoftException in Application.cpp:604: after re arrange in cpanel

ear all, 
Today I noticed a specific bug that caused me a lot of trouble. 
I had to move a client from one home to another, after that with cagefs enabled the client got Internal Server Error 

[Wed Sep 30 17:15:15 2015] [error] [client] SoftException in Application.cpp:604: Could not execute script "/home2/xxxx/forum/download/file.php"
[Wed Sep 30 17:15:15 2015] [error] [client] Caused by SystemException in API_Linux.cpp:465: chdir() failed: No such file or directory
[Wed Sep 30 17:15:15 2015] [error] [client] Premature end of script headers: file.php
[Wed Sep 30 17:15:15 2015] [error] [client] File does not exist: /home2/xxxx/forum/500.shtml

I soved it by doing reenabling of cagefs for this user. 
Probably its a bug.

How to chmod all directories except files (recursively) SSH

441down voteaccepted To recursively give directories read&execute privileges: find /path/to/base/dir -type d -exec chmod 755 {} + To recursively give files read privileges: find /path/to/base/dir -type f -exec chmod 644 {} + Or, if there are many objects to process: chmod 755 $(find /path/to/base/dir -type d) chmod 644 $(find /path/to/base/dir -type f) Or, to reduce chmod spawning: find /path/to/base/dir -type d -print0 | xargs -0 chmod 755 find /path/to/base/dir -type f -print0 | xargs -0 chmod 644

IP Tables Trick to Route Traffic To new Server - CPanel Transfer

8down voteaccepted Here's the method that worked for me: 1) Sync the files and databases with the new server. 2) Perform a re-sync just before cut-off. 3) Change the DNS to point to the new server. 4) Forward the request coming to the old ip to the new server until DNS propagation completes. Here's how I would do the step 4: We will configure IPTables on a Linux server to redirect all the traffic coming on port 80, (which is the default web server port), to a server with the IP The first step is to set your Linux box to allow this kind of forwarding to take place. Open a terminal window, log in as root user and run the following command: # echo 1 >/proc/sys/net/ipv4/ip_forward The next step is to tell IPTables to redirect the traffic to the new server: # iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination Here’s where the IPTables magic happens. With the third and final step we tell IPTables to rewrite the origin of connec…

Order a List by a arbitrary sort expression?


 The type arguments for method 'System.Linq.Queryable.OrderBy<TSource,TKey>(System.Linq.IQueryable<TSource>, System.Linq.Expressions.Expression<System.Func<TSource,TKey>>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

Note: This requires reference to: Dynamic.dll (not System.Dynamic.dll) as well as usingSystem.Linq.Dynamic; If you don't reference Dynamic.dll, or don't declare the using directive, you'll get an error on AsQueryable().