Thursday, February 12, 2009

Apache, Rewrites, Double Slash issue

When doing an apache rewrite for say mywebsite.com, and redirecting it to www.mywebsite.com I would have an issue where the new link would be http://www.mywebsite.com// and as such mywebsite.com/schedule.php would become www.mywebsite.com//schedule.php.

Before, the Rewrite was this:

RewriteCond %{HTTP_HOST} ^mywebsite\.com$
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R=301,L]

I changed the rewrite to the following to fix this:

RewriteCond %{HTTP_HOST} ^mywebsite\.com$
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.mywebsite.com/$1$3 [R=301,L]


Now the request mywebsite.com/schedule.php will be redirected to http://www.mywebsite.com/schedule.php

-Dravor

Wednesday, February 11, 2009

Windows cannot open Help and Support because a system service is not running.

When you try to use the Windows Resource kit help feature, or another help feature you see the following:

Windows cannot open Help and Support because a system service is not running. To fix this problem, start the service named Help and Support

To fix this error:

Click Start, click Run, type cmd in the Open box, and then click OK.
At the command prompt, locate the following folder:
type in cd \
type in cd %windir%\PCHealth\HelpCtr\Binaries
type HelpSvc.exe /regserver /svchost netsvcs /RAInstall
type HSCUpd.exe -i hscmui.cab

Tuesday, January 27, 2009

Sendmail fails, NOQUEUE: SYSERR(www): can not chdir(/var/spool/clientmqueue/): Permission denied

So you get the following in /var/adm/maillog: NOQUEUE: SYSERR(www): can not chdir(/var/spool/clientmqueue/): Permission denied


Things to check:

Permissions on /usr/sbin/sendmail
Permissions for /var/spool/clientmqueue/

Ownership for /usr/sbin/sendmail.sendmail

-Dravor

Thursday, January 15, 2009

Shortcut to Opening your Host File

Create a batch file with the following command:
notepad c:\windows\system32\drivers\etc\hosts

then save it as hosts.bat, and toss it in c:\windows\system32\.

Now anytime you need to edit your host file, drop to a command prompt and type hosts.


Tada, ready to edit!

Are you paying for Antivirus?

If so, I only ask why? What does Norton do for you that makes you feel obliged to pay $30-60 a year?

Perhaps you have Norton installed, and you stopped receiving updates months ago, because the subscription ran out. So you are doing daily scans with month old antivirus updates :)

My solution is one I've been using for at least 2-3 years now, and it works great.

Grisoft's Free AVG

This is a free version of software they also sell. If you purchase it you get a firewall and all sorts of other tools most people do not need. It costs you nothing, and even major version upgrades are free.

Anyone I've sold a PC to, or that has had me rebuild their PC knows AVG well :)
-Dravor

Windows, Force Automatic Updates to recheck for Updates

There are cases where a client checks in with either Windows Update or a WSUS server and no updates are available. It only checks in once a day, so if you miss your window, you need to be able to recheck. Simply restarting the Automatic Updates services does not do this. You can run the following by hand, or in a bat file:

net stop "Automatic Updates"
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v NextDetectionTime /f
net start "Automatic Updates"

This should come out as only three lines, edit it in notepad if it doesn't.

-Dravor

Windows, Remote Desktop, Connecting to Console

If you are a Sys Admin for windows hosts, by now most likely at some point the following has happened:

1) Receive the following email "Dear Johnny, I tried logging in to server xyz and was told all the Remote Desktop sessions are in use, can you clear some?"

2) You may try connecting and get the same error. So then you may try logging in via a Dell Remote Access Card or an HP Ilo card to make the change.

Microsoft Remote Desktop services are limited to two connections when used in Remote Administration mode. So once those 2 connections are used, no one else can connect. This becomes troublesome if you do not have a policy to log off disconnected sessions.
Microsoft gives you the ability to connect to a 3rd session, the console session by using remote desktop with a certain switch.

In Windows XP SP2, you run from the command line: mstsc /console
In Windows XP SP3, and Vista you run: mstsc /admin

These commands will bring up a normal Remote Desktop client, but instead of connection to the two typical remote desktop sessions, it will connect to the console. This allows you to clear disconnected sessions. In turn you can also allow others to have this information, so that when they cannot connect, instead of emailing you, they logon to the console session and clear connections themselves.

The nice thing is, if you try to logon the console session, and someone else is already connected, you can force them off :)

-Dravor