Contact Me

Contact Us
For an informal discussion

Everyone's business is different. Our business is software - ask where we can help.
eMail: john at appsolo.com
13
Jun

WampServer logo 300x298 Switching off IIS to WAMPLately I looked to migrating from WordPress to Kirby for my class website. The VM I use runs Windows Server 2008 so IIS (Internet Information Services) was the initial choice for WordPress. Initially, I thought I could just create a new web site through IIS, power down the existing sites while I migrate and away she goes. That wasn’t to be. IIS is in that category of products/services that I visit only very occasionally and the myriad of settings that pertain to IIS are enough to humble the bravest souls. In the end, I learned to embrace the inevitable and took Kirby where any PHP product likes to live – Apache+PHP.

The choices here are pleasantly few – WAMP (from Wampserver) or XAMP. Having played with WAMP in the past, it seemed the natural choice. Setup was a breeze though I gave mySQL a miss since Kirby rocks without the need for a database – I’m guessing it needed a user set up on mySQL but this served only to confirm my reasons for moving from database-centric CMSs.

That’s the good news – after that, things got messy. There were many guides to be found on setting up WAMP and frankly getting it working locally (as Localhost) is easy, there seemed a lot of misinformation around how to expose the site publicly. So here are a few pointers worth noting:

  1. First off, identify the IP assigned to the server you’re hosting your site at. Use ipconfig on the cmd or just look to IIS which will show the IP address. You’ll notice that the address is suffixed with :80 to indicate port 80 is being used.
  2. You’ll need to shut down IIS, at least for the site on port 80. I’ve left the ftp server running on port 21 as this won’t cause interference.
  3. From the WAMP task bar system tray, check the version of PHP is >5.3 (at least for some Kirby extensions)
  4. From WAMP, check that the Rewrite_Module for Apache is enabled – seems this should really be on by default as most PHP CMSs rely on this.
  5. I wanted to experiment with using Dropbox to host my site so that I could update from anywhere and let Dropbox do its thing. I need to let Apache know where the web site files are at so I create an alias directory (like a virtual directory for IIS). Mine looks a bit like this:
  6. Alias / "C:/Users/jkelleher/Dropbox/kirby/"
    <Directory "C:/Users/jkelleher/Dropbox/kirby/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    Allow from all
    </Directory>
  7. This means that Apache will look for the index.php (or other default files) at a different location. It also lets me leave the dropbox folder alone if it’s already in situ.
  8. Next up to edit the httpd.conf file. You can get this from the system tray or dig down the folder structure beginning at c:\wamp\bin\apache\apache 2.2.22\conf\httpd.conf – yea, this could be easier. There’s a few things to change in here so…
  9. Find the line with ‘Listen 80′ (or similar) and change to ‘Listen 10.19.2.54:80′ (or whatever your statically allocated IP address is as found out earlier)
  10. Change the line with ‘ServerName localhost:80′ to be ‘ServerName jkwp.itsligo.ie:80′
  11. Change the line with ‘DocumentRoot’ to be ‘DocumentRoot “C:\myWebSiteFolder”
  12. In the <Directory> section, comment out ‘AllowOverride None’ to ‘AllowOverride All’. Do the same for ‘Deny from all’, changing it to ‘Allow from all’
  13. A few lines further down is another reference to <Directory>. Change the folder reference to that which you used above.
  14. Some guides will direct you to edit the hosts.txt file buried deep in c:\windows\system32\drivers\etc but this is of no concern if you’re publishing beyond the server. Similarly, there is a line in httpd.conf that some suggest to uncomment (#Include conf/extra/httpd-vhosts.conf) but which equally is of no concern.
  15. Btw, if you goof, you can resurrect a default https.conf file from the conf \extra folder and start again.
  16. Don’t forget to restart all services of WAMP to test your site.
  17. If things don’t go right (e.g. WAMP won’t go orange or green), check out the error log for Apache.
  18. Finally, you’ll want to enable access to wamp and apache in the Firewall rules.

So, not a walk in the park but sensible enough once you’ve knocked your head against a wall for a few hours. Still, it’s good to have a site pop up when it’s all done right.

13
Jun

Flat file CMS

posted in: blog

kirbylogo Flat file CMSHaving playing with several CMSs down the ages (Joomla, Drupal, Wordpress and DotNetNuke), I find that it’s time to simplify things. Wordpress is great and probably the best of those I’ve used but lately I find that I’m less in control than ever. For something that holds a lot of important information, I felt that it could be lost too easily and require a bunch of arcane instruction to resurrect it. For me this is the time of year for spring-cleaning so I started to look about for alternatives.

Actually my journey began with Github that I’m finding very interesting. Seems you can ‘host’ a site as a repository if you follow a few simple rules. Okay, it can’t be very sophisticated but I think the focus should be more on the content than the underlying tech. Git uses Markdown by John Gruber which I instantly loved. Think of it as a simple text formatting syntax – like html only much simpler. It is supported by many editors and Git will automatically convert your markdown to html when your site is rendered. The best bit of course is how seamless the site update experience is, thanks to Git. Just commit and push your updates to Git and it’s live. (Well, in my case I found the ‘lag’ before my updates showed to be in the order of 5 minutes but others don’t report that problem as common) That immediacy of updates is attractive especially compared to long-winded posting in WordPress. If you want to know more on this, it’s worth checking out Jekyll which Git uses (automatically) with your markdown text. This adds templating to the equation giving a greater expressiveness to your web pages. Jekyll is what is called a static site editor, and is written in Ruby.

Static site editors take your markdown and (like a compiler with source code) renders html during a build process. You then upload these html pages (which can include css) to your server. This is actually a neat solution yielding very efficient html. Github runs Jekyll automatically against your markdown pages so the process is simple. However, for greater flexibility you can do this process yourself – here’s some guidelines. Better yet, use Octopress: a framework for Jekyll, it adds some sugar to Jekyll, such as HTML templates, CSS, JavaScripts and configuration.

I was smitten with Jekyll pretty early on and Octopress helped iron out any wrinkles in the former but now I felt that I was juggling too much by way of command prompt magic and took fright. This should be easier so kept looking.

Next stop: Flat-file CMS. These alternatives sit a little higher up the food chain, kinda half-way between static site generators and full CMSs. And this I like. The big caveat here is they don’t use a database which is fine with me. The market is thick with choice here but notable mentions are: Kirby (more later), Stacey, and Statamic – here’s a good comparison. Stacey is open-source while the other two are c. $30. I looked at each up close and like Statamic and Kirby but felt that Bastian Allgeier really shines in support and felt he truly cared for this baby of his. Plus for education, he’ll knock 50% off the price. I was in.

All three use a small PHP code footprint to drive the site. But you can package up your entire site in a simple folder (for backup or forking) which is a delight. The basic principle of organising content is inspired. Just create a folder and pop in a humble text file (in markdown if you like, and you will). That folder becomes the first level page – say, “jkwp.itsligo.ie/about” will render from the presence of an ‘about’ folder with a text file therein. The text file can be called anything but if you match it with a simple template (run up with PHP) of the same name then you have great control over the appearance of that page. Or more typically, a collection of similarly templated pages. Needless to say, it screams along thanks to the absence of a database call. I had my ’site’ up an running in minutes along with MAMP to host the local site on my Mac. (Not so with WAMP, but more on that later)

But that’s not all… the best bit is that Dropbox has a role to play here. If you keep your site content (which is really mostly a collection of folders and text files) in Dropbox, then you can install a Dropbox client on the server. So now when you make a change on your local machine to the site content in Dropbox, your page is instantly mirrored on the server. In fact, you can do this from any device that supports Dropbox. And since the ‘pages’ are just Markdown the editing is trivial.

Another nice feature of Kirby is the use of YAML (YAML ain’t a markup language – don’t you dig recursion!). Each text file (typically of Markdown) can have a YAML front matter section where you can specify on-the-fly key/value pairs. For example, you could have a ‘category’ field or a ‘author’ field. These values can later be used in templates to pull together custom collections of pages or to generate menus or side-bar content. The PHP in question is trivial and Bastian has provided a useful Kirby toolkit which is elegant in operation.

So far, the Kirby experience is very promising. Check out jkwp.itsligo.ie as I build out the content. Now the decision is which CSS framework to use or if I borrow a basic grid framework and skin it myself.

I learned a lot about IIS and WAMP in the process of migrating to Kirby. Check out here for details of that. Also, read more on my choice of editor to pump the site full of content. If you’re moving from Wordpress Bastian hosts a Wordpress Exporter which is something I might checkout.

27
May

Here’s a curious one. In deploying a recent application, I changed the connection string in web.config to point to the Azure-hosted SQL database. The web.config entry looks like:

<add name=”MyAppDb” connectionString=”Server=tcp:dhgifx5yo0.database.windows.net,1433;

Database=MyAzureDb;User ID=myLogin@dhgifx5yo0;Password=myPassword;

Trusted_Connection=False;Encrypt=True;Connection Timeout=30;” providerName=”System.Data.SqlClient” />

In typical fashion, I commented out the connection string to the local database. So I run the application and for a while didn’t notice that anything was wrong since the remote database was seeded similarly to the local one. However, it soon emerged that the database I was seeing was actually the local one – this despite the fact that the (only) connection string pointed to remote database. How could the app (still locally hosted) be pulling data from a local database that it didn’t have a connection string to?

I don’t have the full answer but the fix was to ensure that the name of the DbContext class that you create to invoke Code First must match the name of the connection string in your web.config. So, in the above connection string where the ‘name’ is ‘MyAppDb’, you must ensure that the DbContext class is called the same identifier. Apparently if a match isn’t found, it reverts to ‘DefaultConnection’ but I’m not convinced of this behaviour. For now, don’t accept defaults – name the connection string appropriately.

25
May

P. Long time no Post.

 

 

 

 

 

 

I’m working on a prototype that involves .net micro controllers, RFID readers, XBee PAN network with a PC which connects to a WCF service that populates and queries data stored in an Azure data base. This was all developed first. The overall architecture is shown

image thumb DB first TFS Azure Integration Plan of Action

Then I built an MVC 4 web site on local host and with a local copy of the DB and ASP membership which of course was deployed to .\SQLEXPRESS 2012 but need to be integrated into the production database. In the middle of the development process is TFS. This Post is about the steps I took to deploy the MVC 4 based web site via TFS to Azure having taken a DB first approach to development and incorporating ASP membership along the way.

Here are the steps.

1. Setup a Project in TFS.

2. Scripted DB from Azure and created local copy on SQLEXPRESS

a. Created EDMX (EF 5) link to the SQLEXPRESS database.

b. SQLEXPRESS also handles the ASP membership

3. Merge the ASP authentication model with the data model in SQLEXPRESS. This gives rise to two connection strings for 2(a) and 2(b) as EDMX is compiled/scripted and has metadata references in the connection string and ASP Auth does not.

4. Export a script of the newly updated DB from SQL Express as it now has the ASP membership and user Profile tables in there.

5. Drop the Azure SQL database and recreated it with an admin login and took note of the connection string on Azure Portal.

6. Login to the Azure SQL manager (Silverlight based) on the Azure Portal. You’ll need the admin account setup previously for this. The DB being empty and imported the local script and populated the Azure SQL Data.

7. Change the local Web.config to point at the new Azure Database and tested it worked.

8. Upload a copy of the latest code to TFS

9. Create a web site (new Azure feature in Review at the moment)

10. Connect the website to TFS (you should ensure that the same live ID is used for TFS and Azure Portal for clean connection between the two services)

11. Go to TFS

a. Choose your Project

b. Choose the Build Option

c. You should see name-CD that is created

12. Selecting name-CD click on Queue Build…

13. Fill in the Build popup screen and click ok

14. It will deployed to the linked Azure Web site.

Go for a cup of tea and then test the site.

P.

25
May

Azure Deployment

posted in: blog

So you want to deploy your beautiful localhost ASP.NET MVC project to Azure. Well, pack a lunch…

Typically your ingredients will be:

  • Visual Studio ASP.NET MVC Project (tested with VS2012 Update 2)
  • SQL Server local database (tested with SQL Express 2012)
  • Azure subscription
  • Team Foundation Service source control

There are several ways to go about deploying and this is part of the confusion. The database deployment in particular can be difficult once you leave the same confines of SQL Server Management Studio (SSMS). Shifting the project itself can be accomplished in a few ways (link to TFS, download publish profile etc.). Here’s how to go about it:

  1. Sign into Azure and create a SQL Server. You don’t need a database at this point as we’ll create that later. Do note the administrator username and password as you’ll need this later.
  2. I found it best to deploy the database first as you can then attempt to connect to it from your localhost web app to ensure that the connection string is correct before you deploy the web app itself to the cloud. SSMS 2012 now has an easy way to deploy the database to Azure.
    Screen Shot 2013 05 25 at 17.20.57 Azure Deployment
    Screen Shot 2013 05 25 at 17.23.39 300x175 Azure Deployment
    You’ll have to connect to the SQL Server on Azure so ensure you took careful note of the Administrator username and password. The rest of the form will be filled by SSMS.
  3. You now have the database on Azure and can modify your connection string in your localhost project if you like to see if you can access it. You only have the administrator username/password for now so we’ll need to create a separate Login/User combination later (best practice). You’ll find the full connection string by visiting Azure and viewing the newly uploaded database.
    Test your localhost web app against the Azure-hosted SQL database. If using Code Migrations ensure you have updated your database with Package Console before doing these steps. While it’s possible later to have code migrations run by Azure, I haven’t tested this.
  4. Next we need to set up specific a Login and User for your deployed database. This is distinct from the admin username & password we use to connect to the Azure SQL Server. Ordinarily, SSMS would be useful here but Azure isn’t compliant with these kinds of operations from SSMS so we need some T-SQL. However, one problem that needs addressing is that you cannot use the T-SQL ‘USE’ command to switch between databases on the Azure SQL Server. This is important as we need to set up both a Login (for the master database) as well as a corresponding User (for the deployed database).
    The easiest way to do this is via SSMS but as the Login must be established on the master database, you need to make a connection to the Azure SQL Server ‘master’ database first. Remember to use the admin username here. Then create another connection to the Azure SQL Server but this time to your deployed SQL database. Have these two connections side by side in SSMS for convenience.
    Now create a Login on the master database. Ensure you have the ‘master’ db connection active on the left panel and press CTRL-N to create a new SQL Query window. Now create a Login with an associated password: CREATE LOGIN readonlylogin WITH password=’1231!#ASDF!a’;
    Next create a User on the deployed database by switching to the other database connection:  CREATE USER readonlyuser FROM LOGIN readonlylogin;
    Lastly, you need to assign permissions to that Login so that it can play with the database: EXEC sp_addrolemember ‘db_datareader’, ‘readonlyuser’;

    You may find this post useful to elaborate on this aspect. Test your settings by taking the Login and changing your connection string (in your localhost app) to reflect the new Login and its password.

  5. Assuming your modified connection string worked, the next step is deploy the web application. Begin by signing into Azure and creating a Web Site. Don’t bother with a database for this as we’ll indicate the linked database later. Next step is to upload your localhost application. But before doing this, make a connection on Azure between your Web Site (not yet uploaded) and the database created in the previous steps.
  6. One new way to do this is particularly convenient (if it works) is to integrate your nascent web site on Azure with TFS (Team Foundation Service). Ensure that the Azure Live ID is the same you use to manage your TFS project (or at least, I’m guessing, is a member of the project team on TFS). Once connected in Azure, head back to VS2012 and do a trivial change and check in to Source Control. This will trigger the Build that Azure set up and begin the deployment. You can monitor the progress of this Build from within VS by calling up Team Explorer and viewing the Builds dropdown.
    Screen Shot 2013 05 25 at 18.08.00 300x189 Azure Deployment
  7. Another method which I’ve had better success with is to download from Azure a ‘Publish Profile’, available from the main web site dashboard. Save this small file locally and re-enter VS. Right click on the web application Project in Solution Explorer.Screen Shot 2013 05 25 at 18.27.44 300x160 Azure Deployment
    Most of the information needed by this dialog will be pre-populated. However, on the Settings tab, ensure that only the necessary connection string is active – uncheck those that don’t apply. The final ‘Preview’ screen will warn of any errors and click ‘Start Preview’ to see your files scanned in readiness for uploading to Azure. Click ‘Publish’ to deploy and try to browse to your newly published web site.
  8. If you get errors (YSOD) that are not descriptive, then turn on ‘CustomErrors’ in your web.config file. Read more on this here. This will result in better descriptions of your problems – likely to be database connection issues.
  9. Also, you need to ensure that your IP address is set as an ‘allowed IP address’ on Azure. For public deployment you’ll likely need a range of addresses that are permitted.

So, piece of cake really though I guess once you’ve ironed out all the pitfalls, it would be automatic. Also, republishing is simple and it will only upload those files that have changed. If using TFS integration, the a simple re-build is all that is needed – be sure to turn on continuous integration for the Build in question though.

16
Apr

UI Flow

posted in: blog

Often, we use wire-framing or mock-up tools (like the good guys at Balsamiq) to help communicate design ideas between developers as well as to clients. However, there is a need for something more efficient to aid communication of possible user interface flows through our emerging application. This communication is for internal use typically and doesn’t need to approximate the appearance of the final product in any way – it’s just a means to explore the pathways through the program without getting side-tracked by the scenery along the way.

Ryan at 37Signals posted a very interesting way of addressing this issue. As you can see it seeks to communicate the movement between states more effectively. It also avoids getting bogged down with the detail of each representation of state, focusing instead on the salient aspects to each (probably, well-known) state.323 flow template UI Flow

The horizontal line separates what the user sees on the screen (topside) from what action he (can) take (bottom-side). Here’s a more detailed example Ryan provides:

324 todo flow UI Flow

As you can see it very succinctly captures the pathway that the user takes through the process of adding an item to a ‘To-Do List’. Building on this Ryan offers equally compact means to capture multiple choices of action by the user:

325 login flow UI FlowThe dashed lines separate alternative actions that the user can choose from, each naturally leading to alternative views from where further actions can be selected. I like Ryan’s reminder at the end that all these drawings are ‘destined for the garbage’ – like all prototyping and similar tooling, they are part of the process, not the product. The longer they linger the less use they serve.

10
Apr

Ogham Water Monitoring & Metering CRMDelighted to post an update on some interesting work being undertaken on behalf of Ogham Engineering Ltd.. Ogham were looking for a multi-faceted management system to permit both managers and tenants access to up to the minute water consumption and metering data.

The system will provide Ogham with the ability to integrate with their own in-house wireless water monitoring technology. Data is gathered from these sensors unobtrusively installed to water pipes about the building. The data is hosted in the cloud and retrieved by this application. This happens at very regular intervals offering strict control on consumption patterns and helping to identify leaks and mis-use.

Our application provides an interface to these meter readings. It also allows Ogham to keep tabs on their customers and tenants to ensure that data is limited only to those concerned. Given the significant customer-facing aspect to this product, a highly intuitive and yet information rich front-end was required. We turned to a now well-established Microsoft development stack – ASP.NET MVC – to provide the breadth of features needed. This coupled with extensive use of Javascript, jQuery and associated libraries, frameworks and plugins offers a very comprehensive package that serves the needs of our client well.

Estimation completion date: May ‘13.

8
Feb

Parallels Getting Parallels 7 to play nice with Windows 8One of the challenges of working in the Mac environment while developing in Microsoft technologies is getting the VM machine working as you want. Being a fan of keyboard shortcuts, it’s a major PITA if the key mappings aren’t set as you’d expect, especially as I move routinely between Mac and Windows PC.

So, with my Parallels 7 and Windows 8 setup, do the following to get it just right:

  1. In Parallels, choose Preferences…Keyboard and ensure Virtual Machine Shortcuts are off.
  2. At the bottom of that box, I leave ‘Enable Mac OSX system shortcuts’ enabled to give me the Fn controls across the top of my keyboard. This means I have to press Fn with, say, F6 to compile in VS2012 but that’s how I prefer it.
  3. That’s all she wrote.
8
Feb

There’s an issue when you try to attach a local MDF SQL database file to the local instance of SQL Express. VS typically will insert a USER INSTANCE = true into the connection string that it generates when you add the LINQ-to-SQL or ADO.NET Entity modelling to your project.

The connection to the database as attached to SQL EXPRESS will fail on open. Fix this by removing the User Instance clause from the connection string.

Other solutions advise deleting the SQL Express folder from the AppData folder for the user but I found the first options works for me and doesn’t require any privileges on the host machine.

25
Nov

My putting a toe in the water of Azure. Love the interface, very slick and well thought out – looks like Scott Gu kicked the team into action. Here’s a few very ‘MS’ tricks that I’ve overcome so far:

  • Using SSMS (SQL Server Management Studio 2008) isn’t a great place to start. Upgrade to 2008 R2 or jump into SSMS 2012 or you’ll get the ’sys.configurations’ error. I installed (the not insignificant) R2 upgrade and the problem went away and the next step rendered un-necessary.
  • For SSMS 2008 only: Once you have the Azure SQL database set up (along with the SQL Server), don’t try the normal server logon in SSMS. Instead, choose ‘New Query’ from the toolbar. Enter the database address (no need for https:// prefix), followed by your administrator username (not email or Azure sign-on), followed by the password for the SQL Server. It’s easy to reset the password from the Azure portal if you forget it.
  • I ran into difficulties in Chrome trying to ‘Manage’ the database server but it worked fine in Safari – problem was keystrokes wouldn’t appear in logon text-boxes – silly thing but a problem none-the-less.
  • I could make a connection to the server in VS2010 using View..Server Explorer but it’s easier in SSMS.
  • Seems now in SSMS 2008 R2, the table designer is gone for Azure table creation, so scripting is needed. Likely be simpler to let EF do the table generation.
  • This is a good resource for marrying up a ASP.NET MVC project to begin using Azure (both as a Azure web hosted app and using Azure SQL database).
  • Another thing worth remembering is that while working in a VM, ASP.NET won’t permit accessing a database that is on a  UNC share. Even if your database is local (as you see it), say, C:\vs\mydb.mdf, ASP.NET will not access it. Mapping to a drive letter won’t work either. Solution is to run native (using Bootcamp on a Mac, for example) or attach the database to a lock SQL Server instance. Or better, use an Azure SQL database.
6 pages

latest news

Switching off IIS to WAMP

Posted on Thursday, 13th June, 2013

Lately I looked to migrating from WordPress to Kirby for my class website. The VM I use runs Windows Server 2008 so IIS (Internet Information Services) was the initial choice for WordPress. Initially, I thought I could just create a new web site through IIS, power down the existing sites while I migrate and away [...]

Testimonials

Excellent design skills

Posted on Sunday, 2nd May, 2010

We at Taxonomy.ie are happy to be associated with Appsolo and look forward to further work together.

follow me

twitter facebook delicious

AppsoloLtd. VAT No. IE97548691 - Copyright © 2010.

Google+