ColdFusion SHA512 vs. SHA-512
To cut to the chase.
ColdFusion 8 Standard “SHA-512″.
ColdFusion 8 Enterprise and ColdFusion 8 Developer “SHA512 & SHA-512″.
I was lazy and didn’t bother checking the manual for the exactly hash algorithm name used by ColdFusion. So I guessed as “SHA512″ and it worked correctly. The problem came when the web application using this code was installed on ColdFusion 8 Standard and it didn’t like “SHA512″ at all.
This probably applies to “SHA-1, SHA-224, SHA-256, SHA-384″ as well.
It’s worth keeping in mind that the developer edition of ColdFusion contains the enterprise features and loads an addition Cryptography provider which added the no-dash “SHA512″ support. It’d be nice if CF didn’t allow the no-dash versions no matter what, but I guess I should just check the manual next time.
Here’s an entry from the server log, showing the extra provider being loaded and the hashes it implements:
Installed JSafe JCE provider: Version 3.6 RSA Security Inc. Crypto-J JCE Security Provider (implements RSA, DSA, Diffie-Hellman, AES, DES, Triple DES, DESX, RC2, RC4, RC5, PBE, MD2, MD5, RIPEMD160, SHA1, SHA224, SHA256, SHA384, SHA512, HMAC-MD5, HMAC-RIPEMD160, HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384, HMAC-SHA512)
Stranded 2 Guide Update
Just a brief post to mention that I’ve made some updates to the Stranded 2 guide. I’ve started to include some maps of the islands and been working on a walk through of island 1 at the moment.
Xbox Live Avatar Image URLs
I’ve always liked using my Xbox Live Avatar for sites on the internet and attaching it to various profiles and sites of mine. I used to clip the image from my gamercard (see the right column), save it and upload it again. Today, after listening to the Major Nelson Xbox 360 podcast, I discovered the following URLs that’ll serve me the images I’m usually after.
This is really useful for me with one of the best using being that my avatar image at the top right of this site will be kept up to date automatically from now on
Simply use the following URL’s, replacing “misterdai” with your gamertag.
- Small head shot

http://avatar.xboxlive.com/avatar/misterdai/avatarpic-s.png - Large head shot

http://avatar.xboxlive.com/avatar/misterdai/avatarpic-l.png - Full body shot

http://avatar.xboxlive.com/avatar/misterdai/avatar-body.png
Nginx Windows Service
Introduction
Nginx is a web server. It’s an alternative to the big beasts of Apache/IIS and is similar to Lighttpd, built for speed and good handling of heavy loads. It comes from the world of Linux but it does run on Windows as well (built natively). The only problem is it does support Windows Services.
Maybe you didn’t even realise that WordPress is a Nginx user with it serving a lot of their static content and load balancing requests out to it’s other servers. If you want to find out more about Nginx take a look at the links at the bottom of this post.
Nginx Vs. Windows Services
Nginx is easy to install… you unzip it. Now I won’t go into configuration settings etc… because there’s a fantastic wiki full of information for the server (see links below). The default configuration will be suitable for now as it’ll serve on port 80 the html folder contained within the nginx directory.
To get it up and running you simply execute nginx.exe. The problem comes to when you need to stop it. You’ll need to execute the command:
nginx.exe -s stop
While this is reasonably simple, it would be nicer if it worked as a service, like apache or IIS. This would allow us to set nginx to automatic and start when the computer boots and give us easy ways to start, stop or restart the service, set recovery options, dependant services etc…
Why not just use instsrv/servany, FireDaemon or others?
There is already a howto for using nginx with FireDaemon but it suffers from one very important issue. When nginx is started, it creates a secondary process. So you’ll have two nginx.exe’s running. There’s probably a very sensible reason for this, but it’s better to ask why in the nginx forum
The way instsrv/srvany (Microsofts way of making something a service) or FireDaemon work, is to start the program and when you want to stop it, it’ll close the process. But neither is capable of closing the extra nginx.exe. So each time you stop/start/restart you’re creating an extra nginx.exe process each time. Not good!
Setting up as a service (a better way)
Thanks to a small project called “Windows Service Wrapper” we have a way of properly starting and stopping nginx. First you’ll need to download the program from http://maven.dyndns.org/2/com/sun/winsw/ you just need the latest exe (which was “winsw-1.8-bin.exe” at the time of writing).
- Retrieve latest “exe” of “Windows Service Wrapper”.
- Place this in your nginx folder and rename it to myapp.exe.
We then need tell WinSw what we want it to do. This will be via an XML config file where we’ll state that nginx needs a shutdown command.
- Create a file called myapp.xml containing the following:
<service> <id>nginx</id> <name>nginx</name> <description>nginx</description> <executable>c:\nginx\nginx.exe</executable> <logpath>c:\nginx\</logpath> <logmode>roll</logmode> <depend></depend> <startargument>-p c:\nginx</startargument> <stopargument>-p c:\nginx -s stop</stopargument> </service>
Obviously you should change the file slightly, depending on your folder locations. For those more technician people out there, you can also set a service that nginx depends on.
Finally we need to install the service, to do this simply execute the following command and you’ll then see the “Nginx” service in you’ve services list.
- Exectue the command “c:\nginx\myapp.exe install”.
That’s it!
Conclusion
From my experience so far this has worked perfectly. You get Windows Service support and no orphaned “nginx.exe”’s hanging around from service restarts. Best of both worlds.
It’d be great if nginx could do this itself, but the author is focusing on other more important developments at the moment. I’m sure there are people out there with enough programming knowledge to contribute the required code, so if you are such a person, please try and help.
Ideas
Here is a small list of what Nginx can be useful for, due to it’s high performance nature.
- Serve static content directly and proxy dynamic content from a backend server (Apache/IIS).
- Load balancing proxy to share the load between servers.
- SSL Accelerator, take the load of SSL off the application server.
- Sit infront of application servers such as Jrun/Jetty (ColdFusion / Rail).
- Or just become your full web server as it’ll run PHP and other languages.
Links
S2 Guide update
It looks like a lot of people are coming here for more than just a basic item guide. So I’ve taken the step of added some pages for completing the adventure islands. At the moment they’re all empty but I’ll start working through all the comments of the main guide page itself to fill those out a bit. Plus if anyone feels like they’d like to add something, just drop a comment on the relevant island page.
Recent Comments