In this article, let us review how to generate private key file (server.key), certificate signing request file (server.csr) and webserver certificate file (server.crt) that can be used on Apache server with mod_ssl.

Source: How To Generate SSL Key, CSR and Self Signed Certificate For Apache

 

The above linked article is an excellent overview that is right to the point for generating SSL keys on a linux server. The instructions include generating a CSR (certificate signing request) that can be sent to a third-party cert authority to get yourself a full-fledged certificate file in addition to instructions on generating a self-signed certificate (often used for testing but handy for a myriad of other things…)

 

I would also recommend you take a look at this link if you need to generate a key without a passphrase: http://serverfault.com/questions/366372/is-it-possible-to-generate-rsa-key-without-pass-phrase

Enjoy!

This is redacted version of a powershell script I had to come up with recently to fix an issue with a web application in our environment.

$hostsPath = "$env:windir\System32\drivers\etc\hosts"
$ip = ipconfig | findstr /i IPv4 |Out-string
$ip = $ip.TrimStart("IPv4 Address. . . . . . . . . . . : ")
$ip = $ip.TrimEnd("`n")
$ip = $ip.TrimEnd("`r")
Clear-Content $hostsPath
ipconfig /flushdns
Add-Content $hostsPath "$ip siteurl.com"

I will walk through what is going on here…
(more…)

One of the things that is often handy to know is when a server was last rebooted. This is nice to know for things like patching, registry updates, etc… stuff that requires a reboot to take affect.

I came across a quick article that explains a very quick way to get an answer.

Open up a command prompt and use the following command:

systeminfo | find "Time:"

A few seconds later you will get a response telling you when the last system boot was. Very handy!

References:

http://www.fieldbrook.net/TechTips/Windows/Uptime.asp

I have been having issues I can’t narrow down that have been causing Apache to go into a conniption and the websites on my server to go down. The quick duct tape fix has been to login ot the server and restart Apache. This is a manual process though and the site could be down for a while before I get in to do the restart.

There are tons of website monitoring services out there, some free, that can alert you to such a failure. The “free” ones I have found though don’t allow you to do more frequent checking without upgrading to a paid plan. Furthermore, most are only “alert” services and cannot actually intervene and do anything.

I thought there must be a way to do this via a script and a cron job. After some digging around I wasn’t able to find a simple script that would do exactly what I wanted. However I found enough bits and pieces to cobble this together and after some testing it seems to work well. (more…)