All posts tagged server

Mac_OSX

One of the very nice things about working with multiple platforms and technologies, not to mention just having longevity in the business (which is a nice way of saying I’m old!), is that you get exposed to a lot of different ways of solving problems.  “Oh, I’ve seen that before.  Back in the DOS days we used to…”

Administering FTP services on Mac OSX server has always left me wanting something better.   The built-in services work, but they have a few drawbacks:

1. I don’t like having to bounce around multiple places to administer things.  Over to the User section of the System Settings to add users.  Back over to the Server Admin to manage FTP Server settings, etc.  I always liked the all-in-one console approach with things like FileZilla on Windows servers.

2. I don’t like having to create real, actual user accounts in the system for FTP users.  I have multiple web hosting clients who need access, each to their own specific web site directories.  I don’t like creating “real” user accounts on the machine for them.  Partially a security concern, and partially just “…something bothers me about it.”  The Windows Server OS has FTP services built-in, but they are woefully inadquate and they too are all integrated and require actual user accounts.  For years I’ve used the open source FileZilla Server for Windows.

3. FTP access is SOOOOOO SLOOOOOOOW.

The very first thing I had done, when I first installed the Mac OSX Server, was to look for an OSX version of FileZilla.  Alas, they don’t make an OSX version of FileZilla.  I poked around didn’t find a suitable alternative.  So I stuck with the built-in services.

We hadn’t been using FTP all that much on the OSX Server, so we dealt with the slowness issue.  But more recently we’ve had the need to use it a bit more, and the time lags made us want to stab our eyes out.  So less we go blind, I started searching around for a cause and hopefully solution.  And to my great pleasure, I found TWO solutions!

First, it turns out that the slowness issue is very easily solved.  It’s merely a configuration setting that really ought to be part of the default installation, but isn’t.    Go here to find the full write-up from Apple.  But in a nutshell, I just needed to open the file   /Library/FTPServer/Configuration/ftpaccess    in a text editor, and then add the following line:

  passive ports Server_IP_Address 49152 65535

Then restart the server.

That’s it!  The slowdown was because when trying to go to passive mode, it was banging its head against the wall trying to find a valid port to use.

However, it gets even better…

In my travels, I also got clued into a FileZilla -like open source FTP Server!

pureFTPd is an active, open source FTP server project for the BSD unix / linux families including Mac OSX.  And there’s a GUI interface called pureFTPd Manager for OSX!    Just click the preceeding link, and you can download the GUI interface and ftp server all bundled up in one since installation package.

This software will allow you to setup multiple different username/password combinations, locking each into a specific set of “home folders”.  But these are all accounts setup within the software, and NOT actual system accounts.  Its much better security approach, and much “cleaner”.   And the software is FAST too, with better system monitors.

Enjoy!

Ummm, yeah.  Microsoft’s FTP support isn’t even good enough to be called crap.

Since the prior blog post on troubleshooting Microsoft’s built-in FTP server in IIS, I’ve gone back to the tried and true FileZilla Server.  Yes, the community that brought you the free FTP client software also provides a free server version.  It’s great, robust and secure.  Oh, and super fast and easy to install and configure.  Very intuitive.  I’ve been using it for YEARS.  I had such a simple need that I was just trying to work with the built-in FTP in IIS on a new server install (hence the previous post).  But when a new requirement arose recently, I finally punted entirely, turned off FTP in IIS and installed my old friend – the FileZilla FTP Server.

Life is much better now.

It’s reinforced my prior thinking — even if the need is super simple, it’s just faster and easier to go with FileZilla right off the bat.   I recommend you check it out if you have FTP needs.

I’ve been running FTP Services on Windows Servers since the days of Windows NT.  Personally, I prefer a 3rd party product such as RhinoSoft’s ServU or Ipswitch’s WS_FTP Server.  But “free” is a good price, and I’ve setup plenty of built-in FTP systems over the years.

However, I just had the dubious honor of installing FTP on a Windows 2008 Server for the first time.  Like all things Microsoft, it was a great study in how to over-complicate the simplest, most inane thing!  As such, I thought I’d draft a post to list some quick troubleshooting tips to help save someone else a few minutes/hours of frustration.  There’s no rocket science here, just a few helpful hints.

One of the big issues with configuring FTP is that there’s very little in the way of feedback (error messages, etc.) when it’s not configured properly.  It just simply doesn’t work, and there are a zillion possible reasons why…

Obviously, the first thing is to make sure your firewall is flowing through traffic on port 21 for the target IP address.

Next, you need to make sure that FTP services are actually installed!  In my case, my default server install did NOT have FTP services installed.  I had to setup the roles and such to get the WWW services (and IIS) installed, which includes FTP under its wing.  So make sure you do have FTP properly installed.

The next helpful hint:  you have to create a site!  I know this sounds dumb in hindsight, but in the past when you installed WWW and FTP services you got a basic default site.  I like to run FTP from a command-line to just see the welcome banner to know I’m talking end-to-end and reaching the server, to eliminate firewall issues and the like.  Even if you hadn’t configured user access yet, you could still at least hit it and see that you were “talking” to it (getting the welcome banner, etc.)   But in Windows 2008 Server R2 no such luck.  Even with the FTP services running, nothing happens…  it’s dead, and you don’t know why.   You have to create an FTP site inside of IIS first.  Then magically, you can now connect to FTP services and get the welcome banner!

At that point, I was able to get a login banner but not actually login.  To setup logins, you have to hit two different settings icons in IIS.  First, you need to hit the “FTP Authentication” icon to choose “anonymous” or “basic” access.  By default they’re both OFF so nobody can get access, which does make sense from a security standpoint.  Anonymous is self-explanatory, and not what I wanted — I wanted to require authentication to get in.  “Basic” is unclear in my opinion, but is what I wanted.  Essentially, “not anonymous”.  Genius.  So enable “Basic Authentication”.  But that just enables the authentication types you want to allow — still nothing happens yet.

Next, you have to go to the icon next to that one, called “FTP Authorization Rules”.  Because again, by default NOBODY has access.  This is where you choose which users have access.  The dialogs are a little bit cumbersome, in true Microsoft style, but relatively straight forward.  Enter a username or class of user (“Admins”, etc.) and the type of access you want to allot (read, write or both).

At that point, I was finally able to connect and authenticate.

As I mentioned before, in hindsight this all makes sense and I perfectly well understand how and why it’s setup the way it is.  It’s just not overly clear, and is a departure from past setup processes, so I thought I’d share the experience and hopefully save someone a few grey hairs… I’ve got plenty to go around already.

WordPress on Mac OSX is pretty neat out of the box, but I found that when trying to enable the pretty permalinks, to make posts more search engine friendly, I was getting errors.   Oh sure, I could configure it in the WordPress Admin, but then I’d just get 404 Page Not Found errors when trying to access blog entries.

There are lots of articles online about this problem, but they all suffer from a few problems, the most common being that they’re all for a previous version of OS X.  Apparently some directory paths have changed, and the old advice is not applicable to Snow Leopard Server. Some of them also toss out a handful of things-to-do that are actually red herrings and don’t really solve the problem (the old “throw a bunch of stuff against and wall and see what sticks” approach).  Furthermore, most of them speak in very high level terms, assuming you’re incredibly and intimately familiar with all of the details and will know how to fill-in-the-blanks.  I, personally, am a long time veteran of Windows Server, and do have Unix experience from bygone eras. But OS X Server itself, in this particular iteration, is still somewhat new to me.  I’m no babe in the woods, but I can’t necessarily say I know every nook and cranny inside out (yet) either.  So I’m pleased to share what I’ve learned, and boil it down to it’s most simplistic, straight forward, bottom line.

For those of you who are intimately familiar with all the details, and have already researched and read the other blogs, I’ll start with a very quick overview.  This may be enough to trigger the “ah ha!” moment and send you running…    Then, if not, I’ll drill down to the step by step approach.

The main hitch I was running in to was that the .htaccess was being ignored.  All of the blog posts say to check /etc/httpd/sites for the config files,  but there ISN’T one.  Snow Leopard Server moves the httpd stuff to an “apache2″ directory.  So /etc/apache2/sites  is the folder you want to look for.  There you will find the .conf file where you can change the AllowOverrides to FileInfo.  OK, if that didn’t trigger an “ah ha!’ moment, then read on!

Step by Step:

1. First, make sure your .htaccess file is present and has appropriate permissions set.  (For me, I was all set already and was able to entirely skip this part, but I’ll review just for the sake of completeness).  In Terminal:

Read more…