Thursday, August 18, 2011

Railo 3.2 Site on IIS7

Railo 3.2 Apache, with IIS7 on Windows server 2008 R2.

I had the Apache server.xml set up correctly, as I've done countless times... but the default document wasn't working... and all non .cfm files were pointing to IIS's default site.

Turns out, I hadn't made a website entry in IIS, to parallel the configuration in Apache's server.xml entry.... Its all making sense now. Requests routed to apache knew where they were because of server.xml, but IIS had to have a configuration to set the webroot for all the other file types (such as .html, .css, and .jpeg)

I still can't figure out how to make a site in IIS that isn't inside C:\inetpub\wwwroot\ as the permissions get all screwy... I'll leave that for another day.

Monday, July 18, 2011

Railo DSN with MSSQL2008r2

So today I had a frustrating hour or so trying to add a new SQL Server Authentication Mode login to my SQLExpress 2008R2 instance using management console (for the purpose of connecting with Railo 3.2 ).. which is supposed to be trivial... turns out it is... when you don't have SQL Server Authentication mode shut off, as it was in my installation.

For me, it was Steps 11 and 12 that were key.

http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/

Monday, June 6, 2011

Railo 3.2 on IIS 6.0

For clarity: These notes are for Resin 3.1 and Railo 3.2.0.001 rc to be used with IIS 6.0 as the primary webserver.


1) The installation package contains a setup.exe which configures Caucho-Resin.


1) In the example, resin.conf has an entry added for foo.com in which the root-directory attribute is set to "foo.com", when it should be set to simply "." in the case of Railo 3.x

2) Also, during my multiple attempts at the installation process, I came across other documents saying that an ISAPI filter was required on the "Web Sites" node of IIS... in my case.. it only worked without doing adding an ISAPI filter.

3) adding a /scripts directory? I added a scripts directory, with a copy of isapi_srun.dll into /InetPub/vhosts/

4) The default cflocation in index.cfm to the railo-context admin was driving me crazy... I had no idea where I actually was~!! Without adding an entry to resin.conf, my site was root-pointing to C:\railo\webapps\ROOT and launching index.cfm ... which I discovered later was redirecting via cflocation to the railo-context admin... so it was working... but I didn't know it! So, to save my sanity until I got everything going, I temporarily edited C:\railo\webapps\ROOT\index.cfm to require a manual click (a href=) instead of cflocation to show me where I was, and where I was going.

5) I also now have a new services entry called "Railo 3.1 Server" set as Automatic, which launches:

"C:\railo\httpd.exe" -service -Xms256M -Xmx512M -conf conf/resin.conf -java_home jre/ -java_exe jre/bin/java

Guide for adding Caucho Resin as a windows service if you don't have it already configured for you: http://wiki.caucho.com/Windows_service




Tuesday, March 22, 2011

Railo does Array's By Reference

I'm working away developing an app in Railo, and I just read Ben Nadel's post about how Coldfusion passes Arrays by Value (which is nuts btw, when you think about it) ... and how to pass an array By Reference using java.util.ArrayList directly.

Thankfully, Railo passes Arrays by Reference! ... and since I'm working on a new project there's no reverse compatibility issue moving from Coldfusion.


arrA = ArrayNew();
ArrayAppend(arrA,"Hello World");
arrB = arrA;
ArrayAppend(arrB,"Hello Jello");
writeDump(arrA);
writeDump(arrB);

Array
1
string Hello World
2
string Hello Jello

Array
1
string Hello World
2
string Hello Jello

Monday, October 25, 2010

Railo 3.1 Installation on IIS 6

I've come upon the need for a fast, open-source cfml processor for one of my clients projects.. and it turns out, Railo is fast... very fast, and has a relatively small footprint of ~250Mb of ram when running.

Well, this has been quite the adventure (I prefer my webservers to be already running.. so I can focus on Development) , but it turns out the guide on http://www.railo.ch/blog/index.cfm/2008/4/7/Configuring-IIS6-with-Railo was mostly correct, but required a slight alteration of the railo/conf file.

For clarity: These notes are for Resin 3.1 and Railo 3.2.0.001 rc to be used with IIS 6.0 as the primary webserver.

1) In the example, resin.conf has an entry added for foo.com in which the root-directory attribute is set to "foo.com", when it should be set to simply "." in the case of Railo 3.x

2) Also, during my multiple attempts at the installation process, I came across other documents saying that an ISAPI filter was required on the "Web Sites" node of IIS... in my case.. it only worked without doing adding an ISAPI filter.

3) adding a /scripts directory? I added a scripts directory, with a copy of isapi_srun.dll into /InetPub/vhosts/

4) The default cflocation in index.cfm to the railo-context admin was driving me crazy... I had no idea where I actually was~!! Without adding an entry to resin.conf, my site was root-pointing to C:\railo\webapps\ROOT and launching index.cfm ... which I discovered later was redirecting via cflocation to the railo-context admin... so it was working... but I didn't know it! So, to save my sanity until I got everything going, I temporarily edited C:\railo\webapps\ROOT\index.cfm to require a manual click (a href=) instead of cflocation to show me where I was, and where I was going.

5) I also now have a new services entry called "Railo 3.1 Server" set as Automatic, which launches:

"C:\railo\httpd.exe" -service -Xms256M -Xmx512M -conf conf/resin.conf -java_home jre/ -java_exe jre/bin/java

Guide for adding Caucho Resin as a windows service if you don't have it already configured for you: http://wiki.caucho.com/Windows_service





Tuesday, June 22, 2010

GoDaddy Automated SQL Backups on Shared Hosting

I've been looking for a while to find out how to do automated backups with Go-Daddy's shared hosting, which, as advertised, does not allow automated backups, and Go-Daddy does not provide the service.

To compound the issue, microsoft no longer ships their import/export suite of tools for free, and as a matter of fact, they're not available at all... unless you buy a regular SQL-Server license (or forfeit your left leg)

Introducing Microsoft's "Database Publishing Wizard"

The Database Publishing Wizard is a neat FREE little tool, with both graphical, and command-line interfaces. It uses the power of sql-transact to read your go-daddy (or any SQL datasource) and save it into an sql-transact file which you can use re-create your entire database, simply by executing it as a query.



Which is great... unless you want to automate the process, in which case a GUI is pretty useless.

Introducing the command-line feature of the application:

The following command uses an SQL connect string, to access your database, and dump its entire schema, and database table contents into a giant series of queries in a .sql text file. In this case, I've tacked the additional command:

"> C:\backupJob.log"

To the end of my command, which saves the output of the process to a text file. Very useful if you plan on running this at 3 in the morning, but still need to verify that the job actually occurred.

SqlPubWiz.exe script -C "Data Source=MyGodaddySQLDataSourceURI;Initial Catalog=MyDatabaseName;User Id=MyDSNUserId;Password=MyDSNPass;" C:\backup.sql > C:\backupJob.log

Friday, October 23, 2009

Red5 Live Audio Streaming Delay Solution

Hi.

I finally came across a solution for the Red5 live audio streaming delay problem... turns out, it is simply caused by specifying a buffer on the audio stream of the listening client... which makes sense!

The flash movie connected to the live audio stream will hold back on playing the audio until it has x seconds buffered... it can never get closer to real time than the length of audio buffered.

mediaStreamLive = new NetStream(this.red5Connection);
mediaStreamLive.setBufferTime(0);

So, between having a fast hosting server, and minimal buffer time, we are now achieving near real-time audio transmission rates.