Archive for Fix

.htaccess SSL rewrite not working – DocumentRoot in Apache Config – WordPress Multi-site

I wasted a good couple of hours on this one, please learn from my fail.

I had just set up SSL on our WordPress Sites and that was working as expected, what was not working as expected was the rewrite from HTTP to HTTPS where a directory or path was involved.

So http://mysite.com/thispath would end up going to: https://mysite.comthispath

The slash separating the domain and directory\path would be taken out, so any existing Google links would also be very broken.

After much trial and error with various plugins and variations of the rewrite rules in the .htaccess file, I had a lightbulb moment when I was checking my Apache config.

I had set up the VirtualHost for port 80 traffic(HTTP) without a DocumentRoot, so when I would come in on http://mysite.com it could not find the .htaccess file to properly process the rewrite rules.  As far as Apache knew, there were no rewrite rules to process.  Which still begs the question, why does it remove the slash between the domain and the directory\path, that I don’t know….

What I do know: Make sure you specify a DocumentRoot in your Apache config, under VirtualHost in my case, for the type of traffic you want to process any rewrite rules for!

Otherwise, you’re gonna have a bad time… I had not seen any comments around this in my searches, so here it is, I hope it saves someone some pain.

Windows Event Log Service – Error 13: The data is invalid

For me, I had run through a series of hardening of the server and I found that the Windows Event Log service would no longer start.

After trying a series of other attempted fixes, like clearing out the existing logs from: %SystemRoot%\System32\Winevt\Logs, as well as making sure the permissions on the folder were ok.

There was a suggestion to use Process Monitor(procmon), so I tried starting the service, worked out what PID it was then filtered the view by that PID.  I saw the PID was attempting to traverse a set of Registry Keys which were showing as NOT FOUND.

The full key was: HKLM\SOFTWARE\Policies\Microsoft\Windows\EventLog

I checked the registry and this contained a set of Keys for Application, Security and System. For me these then only contained an entry for Retention.

Which got me thinking, does this even need to be here?

I deleted the Key: HKLM\SOFTWARE\Policies\Microsoft\Windows\EventLog then tried to start the Windows Event Log service and BAM! worked straight up 🙂

SQL2012\2014 Management Studio – Cannot find one or more components. Please reinstall the application

Struck an issue with a Windows 2012 Server with VS2012 installed trying to open SQL 2012 Management Studio giving the error:

“Cannot find one or more components.  Please reinstall the application”

After having tried a heap of combination of things, installing SQL 2014 Management Studio, uninstalling, reinstalling… Then repairing VS2012, installing SQL 2014 Management Studio again. All to no avail.

What finally got me over the line was to uninstall the Visual Studio 2010 Shell, this was done by downloading the installer from this link: http://www.microsoft.com/en-us/download/details.aspx?id=1366

Once downloaded, run the installer and remove the VS2010 Shell component. Once done, run the SQL 2014 Management Studio installer or do a repair on your existing installation, this will itself reinstall the VS2010 Shell components.

Then bam, it finally opened for me.