Microsoft Windows Server

Run Apache HTTP Server As A Windows Service

While working with a JDE EnterpriseOne add-on application, I needed to install the Apache HTTP Server as a Windows Service so that it would start automatically when rebooted. The command I used is:

I got it from this Apache HTTP Server documentation:

Using Apache HTTP Server on Microsoft Windows

The relevant test is:

You can install Apache as a Windows NT service as follows from the command prompt at the Apache bin subdirectory:

httpd.exe -k install

If you need to specify the name of the service you want to install, use the following command. You have to do this if you have several different service installations of Apache on your computer. If you specify a name during the install, you have to also specify it during any other -k operation.

httpd.exe -k install -n “MyServiceName”

If you need to have specifically named configuration files for different services, you must use this:

httpd.exe -k install -n “MyServiceName” -f “c:\files\my.conf”

If you use the first command without any special parameters except -k install, the service will be called Apache2.4 and the configuration will be assumed to be conf\httpd.conf.

Restore SQL Server Database On A Schedule

Keep Calm and AutomateOne of our companies has a training environment in addition to the standard PS,DV, PY & PD environments. They have been working very hard refining their Procure-To-Process (P2P). Now that they know how they would like to handle this process, they need to train the users. That’s where the P2P Training (PTR) environment comes in.

We setup the environment and have had everything running smoothly for the last few months. However, last week we received a request to backup the data in that environment and then restore that backup copy every morning for the next 2 weeks.

It’s a really simple process, but kind of a pain that I had to manually do the restore.

Well, if you’ve been reading this blog for very long, you know that I can’t stand doing things more than once. A trained monkey, I am not. If it can be automated, I do it and it usually makes sense to do so. This was definitely one of those times.

What I ended up doing was making 2 files:

  1. A bat file to call the sql file
  2. The sql file

Then, I just added a scheduled task that fired off the bat file every morning.

Note: When creating the scheduled task, you will need to fill in a value for the “Start in” option. I’m not sure why but it only works if you fill that in. I was using Windows Server 2008 R2 so your mileage may vary.

Scheduled Task Start In Option

Recover Lost Disk Space

We currently share development clients and so there can be many people that use each one. Several times some of those clients have filled their C: drives and I have been unable to find where it went. I checked user desktops, downloads, etc. However, I was unable to find anything.

Then, I ran across a simple command that can empty the recycle bins of every user on the PC and help you recover your lost disk space:

Hopefully, writing this little tip here will help me remember and maybe help someone else that has lost disk space and doesn’t know where it went.

Check Windows Service Status And Restart If Necessary

Lately we have been noticing an issue where the Print Spooler service stops for some reason and users are unable to print UBE results through EnterpriseOne.  So far, we have been unable to narrow down a cause for the Spooler service to stop.

So, like any good CNC Admin, I put a band-aid on it.  I found a bat file script that I could use to check the status of the service and then restart the service it it wasn’t running. I then setup a scheduled task to run every 5 minutes.

Do you have any band-aids that you use to mitigate issues?