Koken – API Error. The theme is not able to make contact with your Koken installation.

I ran Koken as a photo gallery for my personal website under a Godaddy hosting.  Worked well.  But at some point I decided I needed my own “external” server for troubleshooting purposes, to help with my day-to-day System Admin job. Something outside of our corporate network so I can see if things are accessible from the outside. So I got myself a VPS from 1and1, running Windows 2008 R2.  With that I figured I move this blog, my business webpage, as well as my personal webpage to the VPS.  I’m running the webpages on IIS.

So I recreated my personal webpage and reinstalled the Koken. The install to Koken went swimmingly. No problem connecting to the database. The admin page launches with no issues.  However, when I try to visit the page, I get the dreaded “API Error. The theme is not able to make contact with your Koken installation. Contact your host to see if they are blocking loopback connections.”

Now I’m not a coding expert so I’m not sure where to look. But I started from scratch and checked the Koken requirements.  I did notice that I did not have the iMagick module so I got that to work first by following the entry by FDIM here.  After that, the iMagick module showed up under phpinfo(). But that did not help my API Error.

After alot of trial an error, I hit upon this post within Koken’s help itself.  There, the user Pascal talks about what is going on with the backend requests and it gave me the idea to simply modify the whole ” curl_setopt($curl, CURLOPT_URL, self::$protocol . ‘://’ . $host . self::$location[‘real_root_folder’] . ‘/api.php?’ . $url);”  section in koken.php. Rather than have the function try to determine where the api.php is, I hardcoded it:

curl_setopt($curl, CURLOPT_URL, ‘http://www.domain-name.com/koken/api.php?’ . $url);

Where www.domain-name.com is replaced with your own domain name. This assumes you have Koken installed in a koken subfolder off of root and the api.php is located there. (The koken.php is located in the koken\app\site\ folder – make a copy of the file before you begin editing, just in case).

Save that modified file and bingo! That’s it!  No more API Error.

I was racking my brain for two days on this.  Hopefully it will save someone else some time and trouble.

Increase the Max_Input_Vars in PHP For IIS WordPress Install

Installed WordPress for a client, they wanted a particular theme. The theme has some sort of Server Health page which showed the Max_Input_Vars was set to 1000 and it was recommending to go higher. I searched hi and lo for  how to change it. All the websites I hit said add a php.ini with the settings you want or update the .htaccess file.  Neither worked.  But what did work was this (if you’re running wordpress on IIS):

  • Open up Internet Information Services (IIS) Manager
  • Select the server name in the left side Connections pane
  • In the Features View, select PHP Manager

  • Click on Manage all settings

  • In the Filter box type max_input_vars and hit Go

  • Right-click the max_input_vars and select Edit
  • Change the value to whatever you want (I set it to 3000), then hit OK.

That’s it!  You can verify by creating a test.php file with the following line:

<?php phpinfo(); ?>

Open up that test.php page in a browser. There, search for the max_input_vars and it should show you the updated value.

Email Attachments Coming In As .Bin Files

Problem:

Had a user who was sending attachments (in this case they were MS Word documents with a .doc extension) through Outlook 2010. Some (not all) external recipients who were on Outlook Office 365 were receiving the attachments as .BIN files:bin

Solution:

On the Exchange server, for Remote Domains, tell it never to use RTF:

exchange

Batch Copy Logs From Server At Multiple Intervals Using Task Scheduler

I came across a situation where a vendor wanted logs files from a server at around 2am in the morning to troubleshoot why an application wasn’t sending a specific email at that time. Problem was, I wasn’t planning on being up at that early in the morning to grab log files and I didn’t know exactly what time it was supposed to send it. The time was usually around 1:30am but sometimes, when it worked, I’ve seen it sent at 4:30am.

So the plan was to come up with a simple batch file to handle the copying of the logs at every hour between 11PM and 5AM to my local Win 7 desktop,

This required a few things:

  1. A batch file that would a) make a directory based on the current time b) copy the files into that directory
  2. A task to run the batch file, triggered at every hour between 11pm and 5am.
  3. Access to the server where the logs are kept

 

Batch File

My batch file consisted of  the following:

@echo off
SET datestmp=%date:~-4,4%%date:~-10,2%%date:~-7,2%
SET HOUR= %time:~-11,2%
CALL :TRIM %HOUR%
SET timestmp=%HOUR%_%time:~-8,2%
MKDIR logs\servername\%datestmp%_%timestmp%
@echo on
COPY \\servername\logs\email.log  logs\servername\%datestmp%_%timestmp%\ @echo off
GOTO EOF
:TRIM
SET HOUR=%*
:EOF

 

The above batch file first gets the date and time, formats it, and creates a directory with the date/time as part of the directory name. So if the date and time was 6/09/15 and the time was 2am, the directory would be called “20150609_2_00”

Then it takes the email.log file from the \\servername\logs\ folder and copies it to a local folder on my machine called logs\servername\20150609_2_00\, which would be relative to where the batch file is run from.

I named the above batch file copylogs.bat and saved it on my local desktop under the C:\temp folder.

I ran the batch file to make sure it works and instead it failed! The reason being, the batch file ran under my desktop login account. I have a separate admin login for the server. So I mapped to the server using my admin login first. With that connection being made, I reran the batch file, and sure enough, it worked.

Next up was creating the tasks to run the batch at certain intervals…

Task Scheduler

1. Start by Creating a Basic Task:

basic task

2. Give the task a name:

task name

3. Set your trigger. In my case I’m setting to “One time” and will give it a specific time to start (probably about 20 minutes into the future so that I can test to see if it will run properly). Later, I will schedule it to run at particular times throughout the night.

trigger

4. Set your action. In My case I’m starting a program (my batch file):

action

5. Here’s where things start to get tricky.

Since it’s a batch file, the Program/script I’m running is cmd (command prompt). The Additional arguments will be:

/k start “” “c:\temp\copylogs.bat”

And it’s starting in c:\temp (no quotes).

start

6. After saving the task, one last thing I had to do was go back, edit it, and Change User or Group, so that it ran under my server admin account, and Run whether I was logged in or not, saving my password.

final

After I finished, and tested it successfully, I went back and edited the task, adding more Triggers:

more triggers

That’s it! Hopefully someone else will find this useful.

 

 

Internet Explorer 8 Crashes on Manage Add-Ons

Problem: In IE8, when you click to Tools –> Manage Add-Ons, Internet Explorer crashes with a Data Execution Prevention error.

Symptoms: Application Event Logs show Event ID 1000 – Faulting Application iexplore.exe

I tried reinstalling IE8, but that did not help

Solution: For me, the problem was due to a faulty ActiveX control or Java applet. Go to C:\WINDOWS\Downloaded Program Files and check the status of the controls There, I found one add-on that had a status of “Damaged”. Some were also “Unknown”. Others were “Installed”. You can right-click on the add-on and select “Remove”. I actually removed them all, then reinstalled my Java.

Internet Explorer 8 – Does Not Remember Password

Problem: Internet Explorer 8 won’t remember the user’s password information for a website

Symptoms:

User starts IE8, types in “salesforce” in the address bar, which automatically brings him to to Salesforce.com. He clicks on the Login link, enters his Username and Password, checks off the box that says “Remember User Name”, and goes about his work. Afterwards, he closes out IE8 and then reopens it later on. He proceeds to Salesforce.com again, but it takes him to the login page and prompts for the password (User Name field is already populated). It should remember his password and log him in automatically.

Solution:

I added salesforce.com to the list of websites to be always allowed to use cookies (in the Per Site Privacy Actions in the Privacy tab of Internet Options). The change did not work. Next, I tried deleting all browsing history and made sure the “Preserve Favorites website data” was checked off (Press the Delete button under Internet Options –> General Tab –> Browsing history) and the “Delete browsing history on exit” option was NOT checked off . This too, did not work.

What did work was deleting all the salesforce.com bookmarks from the user’s Favorites!

Firefox 3.6.16 Back Button Not Working

McAfee Site Advisor Add-On broke my back button in Firefox!

Everything was fine and dandy until, my Firefox was updated to 3.6.16.  All of a sudden, the back button wasn’t working. Sooo, if I searched for something via Google, and clicked on a found link, I couldn’t go back to the search results page if I wanted to because the back button was grayed out!

As usual with these sort of updates, some other third-party extension broke this functionality.

I went through my Add-Ons list:

  1. AdBlock Plus
  2. AddThis
  3. Evernote
  4. Garmin Communicator
  5. Google Toolbar
  6. Java
  7. McAfee SiteAdvisor
  8. Microsoft .Net
  9. NoScript
  10. Nuke Anything
  11. ShortenURL
  12. WOT
  13. XMarks

I disabled all the add-ons and one-by-one re-enabled them, restarting my Firefox each time. to see which add-on broke the back-button.

Turns out, it was McAfee SiteAdvisor. I compared it with another user who posted a list of add-ons he had, and who also lost the back button function. He too had McAfee SiteAdvisor.

Sooo, if your back button stops working, and you have McAfee SiteAdvisor, disable it and try it out.  If you don’t have that add-on, try the method of disabling all your add-ons and re-enabling them, one-by-one, to isolate the culprit:

  1. From the menu bar go to Tools–> Add-ons [to open the Add-ons window]
  2. Select Extensions on top
  3. Click on the Add-on
  4. Click “Disable” then “Close”
  5. Restart Firefox

Problem Connecting To Shared Network Drive

Problem: Mapped shared network folder would intermittently disconnect itself, and user could not remap it.  When trying to remap it, user would get one of the following errors messages:

“Local device name is already in use”

“The drive could not be mapped because no network was found”

“The [\\Server Name\Folder] is not accessible. You might not have permission to use this network resource.”

Rebooting would fix the issue temporarily, but the disconnect would reoccur within an hour or so.

His colleagues did not have this problem, nor did the user have problems getting to other servers, the Internet, email application. He could ping the server by name, but could not map to the shared folder, by name or IP.

Microsoft’s KB890413 says the following:

This issue may occur if you log on to the Windows XP-based client by using a different connection type than you use to connect to the file server. If you created the network drive through a local area network (LAN) with your current user credentials, the mapping information does not contain any user information. When you log on to the computer, the operating system establishes only a partial connection to the share, and the network drive is considered used. Later, when you access the network drive, the connection is fully restored.

If you use another connection type such as Remote Access Service (RAS) to connect to the file server, the logon credentials used are different from the credentials that you used to create the network mapping. When you try to access the network drive to restore the connection, the operating system tries to use the logon credentials of the RAS connection. If the file share server does not accept the logon credentials of the RAS connection, the operating system cannot access the share. Then, the operation system tries to re-create the mapping to the already-used network drive, and the error occurs.

And their solution to this problem is to remove the existing network mapping and to remap the network drive. This did not work in my case, instead resulting in the error messages mentioned above.

I thought it might be the Symantec Protection Agent that was installed, so I uninstalled that, but the problem persisted. Tried putting the user on another switch port and VLAN (thus different subnet/IP), but that did not help either. The Windows Firewall was not being used.

I tried mapping the drive with my credentials, but I had trouble as well. I tried mapping by IP, no worky. I deleted all temporary files, cookies, and made sure there were no saved passwords under his profile (check that in Control Panel –> User Accounts, Advanced tab –> Manage Passwords):

The problem persisted. I then remoted into my desktop from the user’s laptop, and had the user map to the network drive using his credentials. That worked! So the problem was definitely with his laptop, and not an authorization/account issue.

I was about to rebuild a laptop for the user when I thought I should check one more thing.

Solution: I checked the local host file (C:\Windows\system32\drivers\etc\hosts) on the user’s laptop and he had an entry for the server name pointing to an old IP address. Even though the IP address listed was alive (it was being used by another server), which is why I was able to ping it, as soon as I removed the entry and pinged the server by name, it came back with a totally different IP address. Tried mapping to the shared folder again, and it worked!

I don’t know why the user had entries in his host file, but he’s an application developer, so that partially answers the question 🙂 .

Note: User’s machine running Windows XP Professional w/ Service Pack 3

Google Sees Fake AV Threat — InformationWeek

Something I’ve been seeing alot of lately, Fake AVs

Fake anti-virus software is on the rise and currently accounts for about 15% of all malware detected, according to a forthcoming report from Google.Fake anti-virus software purports to be software than can find and remove malware. But in fact it’s malware, the very thing it’s supposed to eliminate.

Fake AV software typically pretends to scan the victim’s computer and to find some form of malware, at which point it seeks payment from the victim to remove the non-existent malware.

Whether or not there’s a payment, the fake AV software may install more malware.

Google Sees Fake AV Threat — InformationWeek.

Potent malware link infects almost 300,000 webpages • The Register

Make sure your IE has the up-to-date patches (or switch to Firefox) and update to the latest Adobe Flash

Potent malware link infects almost 300,000 webpages • The Register.

A security researcher has identified a new attack that has infected almost 300,000 webpages with links that direct visitors to a potent cocktail of malicious exploits.

People who visit infected pages receive an invisible link that pulls code from a series of sites tied to 318x .com. The code looks for insecure versions of Adobe Flash, Internet Explorer, and several other Microsoft applications, and when they are detected it exploits them to surreptitiously install malware known as Backdoor.Win3.Buzus.croo. The rootkit-enabled program logs banking credentials and may do other nefarious bidding, Landesman said.

Another program which can help determine if you have all the latest updates and patches for your installed applications is Secunia PSI.