Setup WebDAV in Apache2 on SuSE Linux to Support Windows (XP/Vista/7) Clients
Earlier today, a colleague told me that she doesn't like using my servers because I don't have FTP setup thus, she couldn't map my server as a drive. Well, I showed her. I stand firmly against using FTP as any type of web-related solution and thus, decided on WebDAV to address my colleague's demanding needs.
Initially, I set the virtual host up for Basic Authentication but was unable to get Windows 7 and Windows XP to map the drive. Windows complained that "The network path could not be found." I tried mapping the drive from both the command line and from Windows Explorer with no luck. Then I read that theWindows webDAV client does not support Basic Authentication. If this server were on my domain, I'd use Kerberos without a second thought, but it's an Internet web server so that is out of the question. Digest Authentication it is.
I went enable mod_dav, mod_dav_fs, and mod_auth_digest in YaST under Network Services >> HTTP Server >> Server Modules and I restarted the service. I then created the folder /var/davlock, gave it the proper permissions and added the following to httpd.conf
<Ifmodule mod_dav.c>
DAVLockDB /var/davlock/DAVlock
</IfModule>
Then I added the new host, sample.acme.com to my vhosts.conf file and restarted the service.
<VirtualHost *:80>
ServerAdmin nobody@localhost
ServerName sample.acme.com
DocumentRoot /www/wordpress/solardb
ErrorLog /var/log/apache2/sample-error_log
CustomLog /var/log/apache2/sample-access_log combined
UseCanonicalName Off
<Directory "/www/wordpress/sample">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DAV On
#Auth in the house
AuthType Digest
AuthName "sample"
AuthDigestAlgorithm MD5
AuthDigestDomain http://sample.acme.com
AuthDigestNcCheck Off
AuthDigestNonceLifetime 0
AuthDigestQop auth
AuthDigestProvider file
AuthUserFile /etc/apache2/.htdigest
AuthGroupFile /dev/null
<LimitExcept GET HEAD OPTIONS POST>
require valid-user
</LimitExcept>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Notice AuthUserFile /etc/apache2/.htdigest. That file was created using htdigest2 (or on most other systems, htdigest).
htdigest2 -c /etc/apache2/.htdigest sample acmeuser
The -c switch creates the file, "sample" correlates with the AuthName directive and acmeuser is the username of my demanding colleague. Also take note that the way I used LimitExcept allows all non-webDAV users to have anonymous access to the site, while any webDAV activity requires a username and password.
Next, I mapped a drive in Windows with the two methods I am familiar with. First, via the command line
W:\>net use * http://sample.acme.com
Enter the user name for 'sample.acme.com': acmeuser
Enter the password for sample.acme.com:
Drive X: is now connected to http://sample.acme.com.
And then via Windows Explorer (My Computer >> Map Network Drive [be sure to click "Connect Using Different Credentials"]). Both worked flawlessly. And of course, this is all better if you can do it over HTTPS, which I plan to setup when I have time. But for now, my servers are totally in style and ready for use by people who aren't fans of vi
.
Solved: Missing Hard Drive Space in Windows Server 2008
Tonight, I uninstalled Exchange Server 2007 from a development server and was surprised to see that, after the uninstall was complete (and not without a few workarounds), only 50GB of an 80GB hard drive remained. Explorer showed 25GB free, but only 25GB had been used. Where was the remaining 30GB? Poking around the net didn't help -- most of other people's issues revolved around System Restore and Volume Shadowing but I had disabled all of that.
Ultimately, I used a free tool called windirstat not only to find the missing space, but to delete the offending files as well. As I suspected, there were some super hidden files @ C:\Program Files\Microsoft\Exchange Server that took up nearly 30GB. I tried deleting them in Explorer (which showed me that the Exchange folder was 0kb in size) which resulted in FAIL. Windirstat, however, allowed me to right click and quickly delete the multitude of large log files.
Exchange was my issue, but your server may have another -- some people mentioned anti-viruses causing issues. In any case, using windirstat will shed some light on where to find missing drive space.
Phewf! Now to install SQL Server 2008 R2 on that server...
Windows 7: Setup was unable to create a system partition or locate an existing partition.
Over the past week, I've installed Windows 7 and OS X more times than I can count. In attempting to figure out the easiest way to dual boot Windows 7 and OS X, I've also partitioned my drive a good 30+ times. So.. after messing up with an EFI bootloader, I was suddenly unable to re-install Windows 7. I encountered the error: Setup was unable to create a system partition or locate an existing partition. I also ran into the error: Windows cannot be installed on disk 0 partition 1.
I used Gparted to repartition my drive, and even used Disk Utility but repeatedly encountered the above errors.
As it turns out, I had another System disk attached (OS X on a USB drive) to my laptop and once I unplugged it, I was able to successfully install Windows 7.
Windows 7: Disable Unnecessary Services on a Domain Workstation
I finally took the plunge and installed Windows 7 on my Dell Netbook (Inspiron mini iM10-008B). I originally bought the Dell to make it into a Hackbook but after I realized how time-intensive the initial setup may be, I looked to installing Win 7 for instant newness gratification.
Initially, I was going to install the Enterprise version of Win 7 like I had done with Vista, but I decided on Ultimate since Ultimate is essentially the "Enterprise version for consumers" and I didn't have to have a local Key server around to validate my install.
The Netbook I purchased came with only 1GB RAM so it's especially important that I keep it running as efficiently as possible. I performed the basic tweak of setting Win 7 for Best Performance and then began checking out which services I could disable. I found Black Viper's Service Configurations page and used that as a guide to modifying my own services. His recommendations appeared more geared towards machines that are not on a domain, so my setup is a bit different from his. I have a Windows 2008-based domain and, while I know it offers a lot of Vista/7 specific features, I don't have time to explore them right all so my setup is geared towards a basic domain membership.
Ultimately, I was able to reduce initial memory usage to 480 MB. That's a lot, but better than the ~600MB or so used by default. There are 144 services that I reviewed, including the AVG firewall service. So without further ado...
MS Defender Error: “Mallware Signeture Download” Appears Legitimate (Unfortunately).
Ow, the other day I was infected by the the Vundo trojan. I believe the trojan came in through an infected webpage and attacked a Java vulnerability on my machine. During the cleanup, I installed a variety of anti-malware software, including Microsoft Windows Defender. Although I don't believe things can be 100% clean after such an infection, I *really* don't want to reformat that workstation. That said, I was extremely suspicious today when a Dr. Watson/Microsoft Error Reporting error pops up with obvious misspellings (picture taken after report submission):

"Mallware Signeture Download"
I immediately went to Google and found that other people experienced the error and were also suspicious of the spelling errors, since such errors are common in actual malware. Feeling adventurous, I decided to allow the software to send the reports that I didn't bother looking at because if it's malware, it would be a setup anyway, right? Immediately after the data submission, I brought up a command window and typed netstat -b which listed the following:
Active Connections
Proto Local Address Foreign Address State PID
TCP MYWORKSTATION:1332 watson.microsoft.com:http ESTABLISHED 2728
[DW20.EXE]After going to http://watson.microsoft.com and receiving a Directory Listing Denied error, I pinged watson.microsoft.com and noted the IP resolved to 65.55.22.252. Using Sam Spade, I then asked ARIN who owns that IP block and sure enough, the IP is owned by Microsoft.
12/14/08 15:35:18 IP block 65.55.22.252
Trying 65.55.22.252 at ARIN
Trying 65.55.22 at ARIN
OrgName: Microsoft Corp
OrgID: MSFT
Address: One Microsoft Way
City: Redmond
StateProv: WA
PostalCode: 98052
Country: US
NetRange: 65.52.0.0 - 65.55.255.255 Now, I was pretty confident that the pop-up was indeed legitimate. But I became completely convinced after I found a posting by "Dude" on pcreview.co.uk that shows the string can be found within the program files, themselves.
$ cd "$PROGRAMFILES/Windows Defender"
$ for file in *; do strings -t x -e l $file | grep Mallware | grep Signeture
&& echo $file ; done
10cdc Mallware Signeture Download
MSASCui.exe
26fc Mallware Signeture Download
MpSigDwn.dllHaving such spelling errors in an anti-virus program is unacceptable. Hopefully Microsoft will address it soon so that IT pros can stop wasting their time researching its legitimacy. However, seeing that the problem has been around since at least 11/2006, a fix doesn't really seem likely.
Vista: Net Send is Gone; Use msg console Instead.
Update: If you receive "access denied" when attempting to use msg, do the following: Terminal Services Configuration (tscc.msc) -> Open up the properties of the RDP-TCP connection object -> Permissions tab -> Advanced -> Edit the entry you are interested in changing. Thanks to TP at winserverkb.com for that info.
Update 2:Check out Adriano's comment below, it's pretty thorough. Thanks Adriano!
Today, I needed to net send a message to myself, but soon realized that it disappeared and is no longer supported in Vista. Then I found a a post on MSDN tipped me off to use msg instead. Msg is usually used for sending messages to terminal services users but, remembering that the console session has an ID of 1, I decided to try sending a message to the console user. As it turns out, msg 1 test worked both locally and remotely in Vista.
Then, I tried running the command on an XP machine, only to realize that XP's terminal services console ID was 0 and not 1. In order to msg the console in XP, I had to run msg 0 test. So what is session 0 in Vista? Well, according to the query session command, "services" use the ID of 0 in terminal services. Whoops. It appears that the best way for this to work across XP and Vista machines would be to use "msg console test" or "msg * test" or "msg username test". If you'd like to message remote machines, you can do so by pointing to a file that contains the names of multiple machines or by using the /SERVER switch ie. msg /SERVER:computername console "Message goes here".
If you need additional options or help, check out the TechNet article for more information.
Update: For those of you receiving the error message "error 5 getting session names", this appears to be a permissions error. Unlike "net send," you must be on the same Windows domain to send msgs to other computers. This is a good thing -- it means that msg is not prone to being abused by spammers.
Scheduling Tasks from a Command Line in Windows Vista and XP
I'd like to start this post with a warning: I'm only 29 years old but already have permanent damage to my shoulder caused by overusage while working/playing on the computer. Two years ago, I had to claim workman's comp because I was disabled for a few weeks, barely being able to even stand because of an excruciating pain in my shoulder - even gravity put too much pressure on it. I didn't know what was happening at first, I thought it just needed to "pop" but as it turned out, I had tendonitis/bursitis from repetitive mouse/keyboard usage. While the damage was permanent, the pain went away after a terribly painful cortisone shot was injected right into my shoulder. By that time, calcium had built up and I heard the needle crush right through it. Ugh, even with lots of Vicodin and some other topical pain killer, it was still unbelievably painful.
To stop the problem from recurring, I had my desk evaluated by an ergonomic specialist and ended up buying a new chair and a new keyboard tray. I also moved my mouse in closer to my body so that I wouldn't have to reach so far out. I got tips on how to sit, stretch, mouse, etc. I suggest that if you haven't had an ergo eval recently, ask your company to schedule one with a professional. The time I've invested at physical therapy, at the doctor's office, icing my shoulder, figuring out how to clean/cook with a bum shoulder, buying new backpacks, etc could have been avoided if I got into a healthy posture habit when I first started working on computers. So now.. I ice, take lots of ibuprofin and perform stretches.
Everyone, not just fools like me with bum shoulders, should stretch at least once an hour while on their computer. I'm pretty forgetful but even if I wasn't, I don't think its possible to remember to stretch every hour on the hour without some help. And this is where the command line task scheduling fun comes in.
Often times, I've scheduled tasks in both Windows and Unix from the command line using at. Today while researching creating a stretch task, I learned that Microsoft replaced at with schtasks and Apple replaced at with launchd. Works for me, Windows' at doesn't really support hourly tasks while schtasks does. Below is a scheduled task that I'm running in order to prevent further injury to my shoulder:
schtasks /create /tn StretchReminder /tr "msg console Stretch!" /sc HOURLY
Using this command, I've created a task to run once an hour which sends me a simple message that reads "Stretch!" You may wonder why I'm not using net send. The reason is that net send is no longer supported in Vista and msg is supported in both XP and Vista.
Here's hoping my shoulder gets better and yours never starts acting up.
WSUS 3.0 Now Available for Download
Microsoft Windows Server Update Services 3.0 is now available for download.
I updated 4 of my servers from WSUS 2.0 to 3.0 today with no apparent problems - the install was very smooth. The biggest difference so far is the move from WSUS Administration being web-based to being an MMC 3.0 snap-in.
If you'd like to administer your WSUS 3.0 install from a workstation, just double click WSUS3Setupx86.exe and select Administration Console Only when prompted. Once installed, the snap-in can be found under Administrative Tools -> Microsoft Windows Server Update Services 3.0. I thought of just yanking the wsus.msc module itself but it seems the Console_install switch installs not only that file but also 230+ of its friends. According to the Microsoft employee who left a comment below, you must install the entire package for the msc to work.
TechNet also added a section for Server-Side management on Windows Update Server. The current scripts include:
- Delete Empty Target Groups
- Re-index the WSUS 3.0 Database
- Server Status for Approved Updates
- Server Status Summary for All Computers and Updates
- Start Server Synchronization
WSUS 3.0 also allows administration from the command line using both wsutil and Powershell via the WSUS 3.0 API.
5 Ways To Stop Windows Vista/XP/2003 From Beeping
This came up twice in the past week at work so I decided to post it. Here's a few ways to disable the annoying beep in Windows. Works especially well to hush Terminal Services Beeping. I ran this on the clients but it may work for the server as well.
| 1. | local machine: sc stop beep && sc config beep start= disabled |
| 2. | remote machine: sc \remoteMachine stop beep && sc \remoteMachine config beep start= disabled |
| 3. | requires reboot: Device Manager -> View -> Show Hidden Devices -> Non Plug and Play -> Beep -> Disable |
| 4. | requires reboot: net stop beep |
| 5. | use TweakUI: General > Settings -> Uncheck the Beep on Errors |
Sources: tech-recipes, sonhaysytem.com and JSI FAQ.
Installing Longhorn x64 on VMWare ESX Server 3.0.x
I recently attended a Longhorn Roadshow in Santa Clara and learned quite a bit about Microsoft's emphasis on virtualization in Longhorn. A lot of companies are going towards virutalizing servers, even those still running NT or Exchange 5.5. The main reasons seem to be saving rackspace and saving electricity (fewer machines, less A/C) which both translate to saving money. Fortunately, my employer now has the infrastructure setup and virtualization on a mass scale seems like a possiblity. After a quick evaluation, I don't have much faith in Microsoft's current Virtual Server product but an evaluation of ESX Server 3.0 has proven impressive. VMWare has it together and it is likely the solution I'll be recommending in '08 when we're ready to move forward.
That said, it's been tough installing Longhorn x64 on VMWare ESX server. It should be expected, though; the support for Longhorn x64 isn't even experimental yet -- it's non-existent. I had to select Vista 64-bit Experimental as my base VM and hope for the best. What I've experienced is almost as painful as installing Windows 2003 R2 on a Macbook
Most of the frustration revolves around the CD-ROM drivers. The initial install of Longhorn on ESX is so promising but then a message pops up that says: "A required CD/DVD drive device driver is missing." At first, I thought this was because I was using an external USB DVD-R drive but that turned out not to be the case. I figured that gem out only after going through all these steps:
- I installed some dumb .flp that never loaded the CD-ROM drivers as promised
- I asked a friend to bring me an internal CDROM only to find out it's EIDE and my server doesn't support it
- I took my work workstation's IDE CD-ROM and hooked it half-up to my server (the IDE cable) and half-up to a workstation (the power cable because my server didn't have any free power cables left).
- Enabled IDE in the BIOS and finally had ESX recognize the drive
- Still had the same problem
So then I got creative and decided to create the Longhorn image on another workstation. Doh! The workstation's CPU was not 64-bit enabled. So then I tried it on my laptop.. doh! It's 64-bit enabled but doesn't have some special VT chip that's often times not found in laptops. This is why I hate hardware.
So I gave in and ..
- Wiped ESX and reinstalled Longhorn 64-bit.
- Installed the free VMware server, created a Longhorn Virtual Machine and installed Longhorn
- Once the install was complete, I backed up the vmdk to another machine
- I then wiped Longhorn on the server, resinstalled ESX and copied the vmdk to /vmfs/volumes/storage1/longhorn
- Next, I ran vmkfstools -i longhorn-64ws.vmdk longhorn-64esx.vmdk
- Once that was done, I created a new Virtual Machine within ESX and selected Custom then used the new image longhorn-64esx.vmdk
Ahhh, that worked! But now VMWare tools was giving me trouble. The CD-ROM still didn't work (the CD-ROM, listed as NECVMWar VMWare IDE CDR00 ATA Device, gives the status of "The Device Cannot Start" (Code 10)) so I had to figure out another way around the problem. I copied the windows.iso from /vmimages/tools-isoimages to my workstation using Veeam FastSCP, mounted the ISO, saved the files as a zip under my web root then used IE on the Longhorn server to fetch the zip. Installed and voila, it works!


