A few months back I wrote a post on how to install FileMaker Server 15 on Windows Server 2012 while “offline” (e.g. your server is not connected to the Internet). Well, the issues I described in that post are not relevant in FileMaker Server 16 as FileMaker Inc. has included Application Request Routing (ARR) with the installer (finally)!
Hope to have a few new posts up in the coming weeks…
In my last post I mentioned that servers at my work are typically scoped to the local LAN and have no access to the Internet. This can cause problems with software that needs to download pre-requisites during installation.
If you try to install FileMaker Server on Windows while disconnected from the Internet, you’ll get a message like the one below:
You might wonder what is ARR and why do I need it for FileMaker Server? According to Microsoft:
Microsoft Application Request Routing (ARR) 3 for IIS is a proxy based routing module that forwards HTTP requests to application servers based on HTTP headers and server variables, and load balance algorithms .
This allows IIS to forward requests to Apache Tomcat which is used to run the Admin Console as well as WebDirect and Custom Web Publishing.
In order to fix this issue, we’ll have to install ARR manually. There are a few ways to obtain the ARR install package and pre-requisites. All of these require a computer that is connected to the Internet. Once you have the files however, you can just copy them to your server.
You can run the FileMaker Server installer on a computer that IS connected to the Internet and copy the installers out of the directory where FileMaker downloads them, which is C:\Users\\AppData\Local\Microsoft\Web Platform Installer\installers
Because ARR is intended to be used with IIS, we need to make sure that IIS is installed before running the ARR installer.
To install IIS we need to use the Add Roles and Features Wizard. The wizard can be launched from the Server Manager by going to Manage -> Add Roles and Features, or from the Programs and Features Control Panel Applet by clicking on Turn Windows features on or off as shown below:
The first dialog you will encounter will look like the one below:
You can just click on the Next button until you arrive at the Server Roles screen:
We want to install Web Server (IIS) so check the box next to the entry in the list. When you check the Web Server (IIS) box you’ll be see a prompt like the one below, just click on Add Features.
To continue, click on the Next button. Continue clicking past the Features screen (you don’t need to change anything here) and Web Server Role (IIS) screen until you come to the Role Services screen.
I’m going to set up IIS the same way the FileMaker Server installer would if it had access to download ARR. It’s up to you if you want to add extra Role services, but you should at least include the ones checked in the images below:
For reference, here is what you should check:
Under Web Server – Common HTTP Features
Under Web Server – Application Development
Under Management Tools
IIS Management Console
After you’ve checked all the options you’d like to check, click Next and you should be at the screen below:
Click Install to begin the installation.
Before we can install ARR we’ll need to stop the IIS service. Open up an elevated command prompt (find Command Prompt on your computer, right-click and choose Run as administrator) and type the following command:
net stop was /y
Your screen should look similar to the screen below:
Once you’ve stopped the IIS services, you’re ready to install ARR!
Browse to where you’ve placed the ARR install file(s). I placed mine in C:\FMS_Install:
If you downloaded the ARR 3.0 Stand-alone package (IExpress) x64 installer, double-click the file to launch it. If you’ve downloaded the pieces separately or got them from a different FileMaker Server install you’ll need to run them in a certain order. You can view that order on Erez’s IIS Blog.
This is what you should see in Programs and Features after ARR is installed:
If you don’t see IIS URL Rewrite Module 2, Microsoft Application Request Routing 3.0 and Microsoft External Cache installed, then something went wrong. Most likely you did not have IIS installed before running the ARR installer.
At this point in the process I usually reboot the server, but you could also just restart the IIS services using either the Services Control Panel Applet or the IIS Management console.
Now that IIS and ARR are installed, we can install FileMaker Server!
I find the FileMaker Server installer runs best if it is stored on the C:\ drive and if you right-click and choose “Run as administrator” even if you are already logged on as a member of the Administrators group.
From this point on the process is the same as any other FileMaker Server install so I’m not going to go through every screen, but here are a few where you might want to make changes.
We’re doing a single Machine install, but if you were doing a Multiple machine install you’d want to do all of the steps above on the Worker Machine first, and then the Master Machine.
Changing this next section is optional. We usually leave it just using the Local System account. One reason you might want to run as a specific user is to give FileMaker Server the ability to read from or write to shared network storage or a mapped network drive. The Local System account will only have access to read from and write to local drives.
Starting with FileMaker Server 14 you have the ability to change the ports used by the Web Server for web connections. If you want to use IIS to run other websites you can either change the ports FileMaker Server uses, or change the ports your other websites use. Since FileMaker recommends that you run FileMaker Server on a dedicated server, I’d recommend leaving the defaults here.
Since we have IIS setup to already use ports 80 and 443, you’ll see the dialog below pop-up. Just click on Disable Websites.
The next item we’re concerned about is Bonjour for Windows. I’m sure many IT professionals have an opinion about Bonjour and whether it is necessary or if it is a security risk and you can Google that to read all about it. Bonjour is Apple’s multicast DNS protocol (mDNS) which allows FileMaker Server to broadcast its presence across your network for clients to pick up on. This is how the Local Hosts feature of FileMaker Pro works. Since we don’t want users to be able to discover our FileMaker Server but also don’t want FileMaker Server to log an error message and send us an email every time it starts up complaining about Bonjour not being installed, I’m going to install Bonjour and then later disable the Windows Firewall rules that apply to it.
After the Bonjour install you’ll pretty much be finished. The only thing left is to run the Deployment Wizard, which I’m not going to go through here.
And that’s all there is to it! Let me know in the comments below if you have any questions!
I was recently asked for some assistance in troubleshooting a FileMaker Server 15 installation issue where the user could connect to the FMServer_Sample file, but was not able to use the FileMaker client to upload databases.
They received a generic “Connection failed.” error as shown below:
The user had set up a Windows firewall exception for their own IP address that allowed all traffic through and we were able to use Wireshark to view that traffic was indeed reaching the FileMaker Server. We tried placing a file directly into the Databases folder on the server and were able to open and connect to that file just fine.
We were connected to the Admin Console on the server itself, so on a whim I asked, “Can you connect to the Admin Console from your workstation?” Turns out the answer was no, we received a 404 error trying to connect! I thought that was a bit odd so we took a look at IIS Manager and I noticed something right away — there was no sign of the URL Rewrite Module in IIS! I knew FileMaker Server used the rewrite rules for the Admin Console and a few other things like WebDirect, but wasn’t sure if it was used by the client itself (hint: it is). We installed the IIS URL Rewrite Module, try to “repair” the install and run the deployment wizard again, but were not able to get FileMaker to create the rewrite rules. I suggested the user uninstall and reinstall FileMaker Server, but that would have to wait until the next day.
In the meantime I fired up my Dev copy of FileMaker Server to test a few things out. I started by disabling all of the rewrite rules created by FileMaker and then re-enabling them one-by-one to try and figure out which rule was used to upload files. It didn’t take long until I found the offending rule; the “fmws” rule, as it turns out, is used to rewrite incoming database upload requests to the proper location.
Without this rule in place, the server didn’t know what to do with the request and simply rejected it. Now, some of you may be wondering why the IIS URL Rewrite Module wasn’t installed; doesn’t FileMaker Server install this during installation? Normally, yes, it does. In our environment however, servers rarely have access to the Internet, so the FileMaker Server installation is not able to download and install the ARR package, we have to do that manually. The user had installed ARR, but not the URL Rewrite module. I’ll have a post up in the next few days to detail installing FileMaker Server while being disconnected from the Internet.
At work we use the very handy FX.php library to develop sites in PHP with FileMaker as the backend. Due to an upcoming change in the way course numbers are represented in our student information system, I needed to ‘extend’ a found set in one of my models. From reading the FX.php documentation, I got the impression that it wasn’t possible to do using FX.php. So, I took a look at the official FileMaker documentation on Custom Web Publishing with XML to see if this was a limitation of FileMaker server, or just something that hadn’t made it into FX.php. What I came across was the ‘-findquery’ and ‘-query’ parameters which allow you to do a “compound find request” (so it is supported!). I couldn’t find anything about how to do this in the FX.php documentation, so I decided that I would take a look at the source code to see if it was there, and if not, make an attempt at adding it.
Turns out there is a function called FMFindQuery that is not in the FXFunctions documentation. It took some trial and error, but I was able to figure out how it worked and wanted to share what I learned. Here is a simple example of the use of FMFindQuery that is analogous to what I was trying to accomplish. According to the official CWP documentation, the ‘-query’ parameter is where you provide the query names and search criteria for your request. Each search request (or set of search requests) should be enclosed in parentheses. AND search requests should be separated by a comma (make sure there are no spaces between your commas, or it won’t work!). OR search requests are separated by semi-colons. You can perform an OMIT request by prefixing your request with an exclamation point like so !(q3). Here is an example:
This request would find all Pets where ‘PetName’ is ‘Spot’ AND ‘Breed’ is ‘Shiba Inu’ OR ‘PetName’ is ‘Spot’ AND ‘Breed’ is ‘Corgi’.
After figuring out how it all worked, I decided to fork the FX.php project on Github and add a section to the FXFunctions.rtf file about FMFindQuery(). Today, I got an email that my change had been merged back into the main FX.php repo. A small contribution, but it is my first contribution to open source software on Github!
Disclaimer: All of the links below are Amazon Affiliate links. If you are going to purchase any of the books, it would be much appreciated if you used the links in the post!
Pretty early on in my programming career I found that out that most programming books were not really geared towards my learning style. I tend to learn better when a book follows a single large project (or maybe several smaller projects) to completion, rather than one-off samples of how to do specific things. So far, I’ve found about four books that I really like and have learned tremendously from. The first book is Michael Hartl’s Ruby on Rails 3 Tutorial: Learn Rails by Example (Addison-Wesley Professional Ruby Series). This is probably the best programming book I have ever read. It walks you through the whole process of creating a twitter clone in Rails 3 and even though I don’t do any Ruby/Rails programming right now, it was still a great read and learning resource. I’ve often thought about doing a similar style book/tutorial in django. The next book is Kurt Jaegers’ XNA 4.0 Game Development by Example: Beginner’s Guide. This book takes you through four smaller projects in two chapter chunks. While the games are pretty basic, each chapter builds upon the previous one and you come away from the book having coded four games in XNA (I actually did my games using MonoGame)! The last two books are by Al Sweigart: Invent Your Own Computer Games with Python, 2nd Edition and Making Games with Python & Pygame. Each book walks you through several complete games.
One other great thing about all of these books is that all of the source code is contained in each book! There is no “here’s a snippet of the code, now go to my website and download the rest”. All of the code is on the pages and you can follow (and type) along without needing to download anything extra, code wise at least, the XNA 4.0 and Python/Pygame books have some sprites/graphics/images/fonts/etc. that you will need to download.
I’ve never been to California before, so I’m excited to get the chance to travel there. And…it will be a great networking and professional development opportunity ;). Hopefully I’ll have some things to share on the blog when I get back!
Yes, I do realize that writing and editing a book is a large undertaking, and very few (if any) books make it to print with zero errors in them. In fact, many make it to print with code that simply does not work. I have tons of old VB6 and VB.NET code littered with button1, label1, textbox1, and generically named functions; PHP and Python code with foo, bar, a, b, c, x, y, etc. as variables. Most of us probably start out with these bad habits, among others, but eventually we learn that the time saved typing $a instead of $sortParams is lost when we (or someone else) has to actually read and understand our code. When writing a book on the topic of programming, it’s probably a good idea to have an editor who is somewhat familiar with the subject. Leaving something like “Class1” in your sample code does not inspire confidence in the content of your book.
So, the discussion about djcelery integration into rpgmaker.net never quite came…I’ll get back to that one in the future. In the meantime, lets talk PHP!
Over the weekend of March 2nd – 3rd I attended my first conference as an actual employed developer! Along with a co-worker, I traveled to the University of Minnesota to take part in the first (annual?) MidWest PHP conference. It was definitely an interesting experience. I attended talks on using Backbone.js, Websockets, enterprise PHP architecture, Symfony2, Laravel, Drupal (gross), and building testable PHP applications. My favorite talk was, by far, the opening keynote by Joel Clermont titled, “Learning how to Learn”. It was a bit of a meta talk about how to approach learning as a developer and I hope to apply some of the things Joel went over in my personal and professional life. You can view the slides here: Learning How to Learn on Speaker Deck. After that talk, my next favorite would have had to been the “Building Testable PHP Applications” talk by Chris Hartjes. Chris is a very passionate guy and that really came across in his talk. I’ll definitely be putting some of the best practices and methods he talked about into practice the next time I write pure OOP PHP. You can view the slides for Chris’ talk here: Building Testable PHP Applications on Speaker Deck.
Overall the conference was a great learning experience and I hope to attend again next year if possible.
I’ve been itching to write an app using the Dropbox API for quite a while and I’ve had an idea bouncing around in my head for well over a year. I started a new job back in February of 2010 and didn’t have Dropbox setup on my work computer (and I wasn’t sure I wanted to set it up) but there was a file I wanted to upload. I could have just downloaded it locally and then uploaded it using the Dropbox website, but then I thought to myself, Why can’t I just enter the path of the file into the Dropbox website and have Dropbox download it for me? In my typical OCD fashion I spent months coming up with a good name and design before ever working on a single line of code. As I started to actually work on it, I ran into a few hurdles which made me think it wasn’t such a good idea after all.
The first problem I ran into was that not every site sends the same HTTP headers with their file downloads. This made it difficult to be able to consistently get the information I wanted to store about the download. I ended up using PHP’s get_headers function to retrieve the file headers and parse out the filename, direct download link, file size, content type, etc. This seemed to work for most downloads, and for those that did not send a Content-Disposition header, I was able to extract the filename from the URL easily enough.
Then I tried to use a file download from MediaFire. None of the workarounds I had in place worked. I found a few posts on Stackoverflow about parsing the HTML/JS to get the direct download link, but even when I had the link I still wasn’t able to get the file correctly. Then I thought, does MediaFire have an API? Yes, yes they do. Great! I can parse the URL to look for MediaFire files and use their API to download them. But then what about all the other file hosting services? I haven’t done any testing with Rapidshare or other services, but I’ll admit, just the thought of having to develop a customized solution for each host makes me cringe.
I haven’t even touched on the logistics of queueing up downloads and sending them to Dropbox for however many people might find this useful. Then I have to consider the storage space required to host the downloads (or the memory to stream them) and the bandwidth to send them to Dropbox. If I were to continue with the project I would probably use Amazon’s cloud services to host the site. It would be a good learning opportunity as I’ve never worked with any of Amazon’s services before and I feel that this idea is perfect for AWS/S3 (or EB)/SWF/SQS.
Next up, my itch to use the Dropbox API in something pushes me to integrate it into rpgmaker.net using django-celery!
Starting a blog is something I tell myself I’m going to do every year. It always starts with, ‘Should I use or write something myself’? I usually like to have as much control over the design/layout and code of the projects I work on as is possible. This is especially true with personal projects. So begins the spiral: what language should I write the blog in? what it should look like? should I use a pre-made solution such as WordPress or Mezzanine, a framework like Django or CodeIgniter?
As you can see, I finally decided to just use WordPress with a very simple theme (Manifest). What I write is much more important than what language I use, or how fancy the site looks. I do plan on adding a few customizations to the theme, but not to get carried away by over designing and under utilizing.