Apache 2.2 on Windows Server: won't start after attempting to change drive letter of all data and logs
The next day, within the allocated time slot for disabling the server's primary functionality, I went to try something new and had a new thought that ended up resolving the problem! The details are as follows, in the context of the steps I took.
I started out by repeating the second approach from the original question. I stopped the services, re-copied all the files (to catch modifications in the last day), and edited the Apache and MySQL configuration files to point to the new drive (F:). I confirmed that Apache was producing the same error. Since I already had the config files open, I decided to try what I didn't try initially (and really should have):
- I reset the config files so they were back to original state, pointing to the old drive (D:).
- I updated only the references to log files to the new drive (F:) and tested the Apache service -- same error as before.
- I returned the log file references to D: and updated the data references to F: -- IT WORKED! Again, I really should have tried this yesterday. What I learned from this step was that it was the log files that were the problem.
- Since there were only two files (
access.log
anderror.log
), I forced the permission changes: added/removed readonly (just in case), ensured the apache user had recursive write access through the directories, and to the files themselves. - Updated log file references to F: -- same error as before.
- On a hunch, I renamed the two log files (a common technique for rotating log files) and attempt to start the service, expecting that new versions of the original file names would appear -- they did! The service started successfully! Victory!!
What I learned: actually, I'm not entirely sure. If I hadn't been so thorough with various steps of my investigation, I would suspect problematic file handles or something, but I can't see how that would be possible past a reboot. However, I have confirmed the value of not too quickly dismissing possibilities while troubleshooting a problem. As I mentioned in the question, I didn't think today's line of inquiry was likely to make a difference, and I still don't know why it did! But you can't argue with results.
Conclusion: my problem has been resolved but I don't know why. If anyone has a theory, please share it!
I have no idea why changing the drive letter causes the issue. But the error The service terminated with service-specific error Incorrect function
in Windows Services is usually due to shortage in physical RAM.
Check the Minimum System Requirements on Apache docs and, if needed, try to close unnecessary programs.