Refresh cached pages in NGINX

Here’s a quick tidbit for forcing individual pages to refresh on an nginx reverse caching server.

In your SERVER block put:


if ($request_uri ~* "^/cache-refresh/(.*)") {
set $cache_bypass 1;
rewrite ^(/cache-refresh/)(.*)$ /$2 last;
}

and in your LOCATION block(s), add:


location / {
proxy_cache_bypass $cache_bypass; # Do not serve response from cache.
proxy_cache staticfilecache;
proxy_pass http://backendsite;
}

There are numerous other helpful directives as well. But if you’re looking for a way to refresh your cached pages individually, this should be enough to help you in the right direction.

Contacts in Android not Saving or Syncing Properly

I recently had difficulty syncronizing my contacts between Google and my Android tablet. The symptoms were actually pretty strange. I could change contacts, I could add them in Google and they would show up on my tablet. But, contacts created on the tablet would not only never make it to Google, but they wouldn’t even save on the tablet.

After some work and searching around, I found the solution was to reset the Android contact database.

WARNING!!!! YOU MUST DELETE YOUR CONTACTS FROM YOUR ANDROID TO RESET THE DATABASE. MAKE SURE TO BACK YOUR CONTACTS UP TO REMOVABLE STORAGE (SD Card) BEFORE BEGINNING THIS PROCESS!

After backing up your contacts to a removable storage device, follow this procedure:

From your main Android apps screen, click your menu button and select “settings”.

Click on “Accounts & sync” and uncheck “background sync”.

Return to your “settings” page (click the back key) and click “Applications”.

Select “Manage Applications” then choose “ALL”.

Find the “Contacts Storage” application and open it.

Click the “clear data” button.

Return to the main Android apps screen, click “menu” then select “settings” again.

Click on “Accounts & sync” and recheck “background sync”.

Then reload contacts from backup and select Google to syncronize with.

This resolved my issues, hopefully it may help someone else as well! Comments or questions? List them below!

Minecraft ModLoader Install in Linux

Being a computer geek is kind of fun… unless it’s a holiday weekend and family members continually use you for free technical support.  Of course, when it’s your son, it’s hard to say, “No!”  Besides, I live for technical challenges that need solving with very scant information.

So, on New Years Day, my son was attempting to install ModLoader for Minecraft.  When he had asked, he had already struggled to follow the instructions for some time, and things were NOT going well.

Anyway, it appears that the way that some of the “make-it-easy-to-do-stuff” tools don’t actually do everything right.  Specifically, using “Archive Manager” in Ubuntu Linux to add files to a Java .jar file doesn’t properly work.

So, if you’re trying to follow the install instructions for ModLoader on Linux and your program freezes on the Mojang splash-screen, the .jar file it is likely that your jar file is somehow corrupted.  The best way to add the appropriate files to your minecraft.jar file is to create a new directory and unzip the minecraft.jar file into that directory.  Add the appropriate files.  Zip up the directory again and rename it minecraft.jar.

Make sure to use the -r (recurse subdirectories) when zipping up the jar file again.  Otherwise, the .jar file will still be incomplete.

Here’s a quick transcript of what we did to recreate the minecraft.jar file with the proper files from ModLoader 1.0.0:

A couple of notes – ModLoader.zip was placed in the .minecraft/Downloads directory (a directory specifically created to store minecraft download files like mods and others).

#cd ~/.minecraft/Downloads
#mkdir ModLoader
#cd ModLoader
#cp ../ModLoader.zip .
#unzip ModLoader.zip
#cd ~/.minecraft/bin
#cp minecraft.jar minecraft.orig.jar               #NOTE: Make a backup copy – just in case
#mkdir modloader-workdir
#cd modloader-workdir
#cp ../minecraft.jar .
#unzip minecraft.jar
#rm minecraft.jar
#cp ../../Downloads/ModLoader/* .
#rm -r META-INF #NOTE: This REQUIRED STEP missed in original posting
#zip -r minecraft.zip *
#mv minecraft.zip ../minecraft.jar
#cd ..
#rm -rf modloader-workdir

That will create a new minecraft.jar file with the ModLoader classfiles.  NOTE: You will need to follow these instructions any time MineCraft updates (even if it’s a forced update) – so make sure to keep the ModLoader.zip file around.

Hopefully this will help others, but more importantly, it’ll help me remember what the heck I did when Minecraft gets updated and I need to redo this.

LINKS:

MOD_FCGID ignores directives in VirtualHost block

Hopefully the following will help some people from wasting a lot of time chasing their tail.

There are many “How-To” documents describing how to use mod_fcgid in Apache with PHP and almost all of them are absolutely WRONG!

If you run across a document which directs you to place process limiting directives for mod_fcgid in the <VirtualHost> block, don’t listen to it. Although the documentation for mod_fcgid says you can place these directives there (up until version 2.3.2), you need to be aware that they will be ignored!

Here’s a note from the latest and greatest readme:

Some directives which could be placed inside <VirtualHost> but were
ignored before now result in configuration errors. As before, these
directives must be set at global scope to have the desired effect.
(emphasis added)

If you are attempting to use any of these directives, you MUST use them in a global scope (which means they can NOT be set per virtual host even though the documentation says they are allowable in that context).

The following is a list of previously ignored – now causing an error if placed in VirtualHost – directives for mod_fcgid:

FcgidBusyScanInterval, FcgidBusyTimeout, FcgidMaxProcessesPerClass, FcgidDefaultMinProcessCount, FcgidErrorScanInterval, FcgidIdleScanInterval, FcgidIdleTimeout, FcgidMaxProcesses, FcgidFixPathinfo, FcgidProcessLifetime, FcgidProcessTableFile, FcgidIPCDir, FcgidSpawnScore, FcgidSpawnScoreUpLimit, FcgidTerminationScore, FcgidTimeScore, and FcgidZombieScanInterval

If you are having trouble with your MaxProcesses, ProcessLifetime, MaxProcessesPerClass or MinProcessCount being ignored, try moving them to the global context.

Google Blacklisting WordPress Websites over Old Vulnerability

Keeping your software updated is part of keeping your website secure. Most sites are hacked using old vulnerabilities that simply haven’t been fixed yet.

The recent spike in malware (bad software) infecting thousands of WordPress websites is a case in point.

The fix has been out for some time, but many website owners have not made the required changes.

If your site has been blocked – or if your site has not YET been blocked and you would like to keep it that way, email us. We offer affordable rates for WordPress Support to deal with your WordPress problems.

Sites who have not been compromised can be innoculated for as little as $50! That’s a small price to pay for a little peace of mind. If your WordPress site uses TimThumb, email us or call us at (586)779-3242 about making sure it is up to date so you don’t find your site blacklisted by Google!