TeamCity on Azure Windows Server

You’ve recently installed TeamCity on your Azure Windows Server and would like to access the TeamCity page from a remote computer. However, you are getting a timeout error when you try to access this page from the remote computer. What gives?

Firstly, let me just point you to these two resources for getting started with Azure Windows Server and TeamCity installations.

For the Windows Server setup, there is a tutorial video that you can watch on the Azure Portal. Navigate to: https://portal.azure.com/ and you will see the following on your dashboard.

azure-dashboard

Once you select Virtual Machines you see the tutorial to get started with Windows Server on Azure.

Next, for TeamCity installation instructions, this can be found on the main website here:  https://confluence.jetbrains.com/display/TCD10/Installing+and+Configuring+the+TeamCity+Server

Once you’ve installed TeamCity, you’d like to access it from a remote computer, as mentioned previous, however, you can’t because the web page keeps timing out. I experienced the same problem and below I’ve got the solution for you to save you some headache (as I had).

While searching around for why this was happening, I found this article here: http://www.danmusk.com/setting-up-teamcity-8-on-an-azure-virtual-machine/. It seems extremely promising, until I realized that it appears to be out of date, and Microsoft have made some major changes to the way that they have the UI structured to achieved what is mentioned in the article.

In a nutshell, what we need to do is configure the port to be accessible from a public facing computer (i.e. the remote that you are trying to connect from). From the Azure environment, this is handled slightly differently than a traditional server where you would just configure the router/hub/switch and the server’s firewall settings. Once you know where to find the configuration, it is much simpler than doing it the traditional way (as one would hope for cloud hosted solutions).

Let me walk you through the steps to get this configured.

Please note that this “tutorial” is for the UI version of Azure as at April 2017. If you are reading this in the future and do not see any of the components that I am talking about, Microsoft may have changed the way that you need to navigate to the setting in order to get this configured. Hopefully, the explanation that is provided here is enough to help you regardless of the UI.

On your dashboard you should see the followingazure-dashboard-2

Note the Network Security Group. This is the one that you need to click on.

Once there you will see a overview page similar to the one below (note that the TeamCity line will be missing in your case, since it has not been set up yet). (Click on the image if it is too small)

nsg

From the side menu, select Inbound Security Rules and you will see an option to add a new Security Rule.

nsg-new

Once you select Add, you will be able to fill in the details that pertain to your TeamCity instance. Enter the port number that you used when installing TeamCity and you will now be able to connect to your TeamCity instance from a remote computer.

Let’s Encrypt (using certbot) tutorial

Let’s Encrypt is a free, automated, and open Certificate Authority. It’s goal is to get all web pages on the internet, encrypted (using HTTPS/SSL). When web pages are sent via HTTPS, the contents cannot be modified in transit, ensuring that the receiver of the content receives the intended information. There are also other benefits of using HTTPS which you can read about here.

I have written a tutorial on how to get your site set up and using HTTPS/SSL on my wiki site, which you can find here.

The reason I have posted the tutorial on the wiki instead of directly here is to allow quicker navigation between tutorial headings. WordPress does not allow this in it’s design but the wiki platform does.

You can use this platform to provide any comments you might have regarding the tutorial

Google Analytics Blocked by Ad Blockers

Recently I thought it would be great to know how many users (if any) are visting my blog, main website and other sites on my domain. With that in mind I decided to add some google analytics to my sites in order to simply track the number of users (at least that’s what I want to do for now; google analytics is much more powerful than that, but I have yet to explore those capabilities).

I created a google analytics account (which you can do here) and went through the basic setup. I finally created a properties for my blog and my main website. My main website being the one found here: https://newteq.co.za. Both sites have different tracking codes as I would like to monitor traffic on my main website and my blog site separately.

In order to track activity on the sites, a different approach is required for each, since my blog is a wordpress site and my main website is simply a static HTML website. I proceeded to add the tracking code snippet (information on how to do that can be found here) and then tried to test it out. It wasn’t working… I thought let me give it a day or so and try again, in the meantime, I’ll set up the tracking on the blog site too.

For my blog’s tracking, I installed this plugin by MonsterInsights. It’s a great plugin that lets you authorize the WordPress site to use your google analytics account, and then you can provide the actual tracking ID that needs to be used for tracking. After setting up the MonsterInsigths plugin, I provided the tracking ID and yet again, I was unable to view my traffic on the site. Again, I thought let me just give it a day and check back.

The next day came and I was still having problems. I then found this Tag Assistant chrome extenstion here. And once everything was set up with this extension, I found that I was getting an error. The error read: Missing HTTP Response. After searching around for a while, I came across this page here. On this page, the guy said that he found out that google analytics was being blocked by an Ad Blocker. So I did a little more digging and found this site: Which Ad Blockers are blocking Google Analytics.

A couple of months ago, I moved from AdBlock Plus to uBlock Origin. And from the table given in the above mentioned website, I could see that uBlock was blocking google analytics. I went over to my website, disabled uBlock on my website, and BAM. Traffic was now being recorded.

Now, there are ethical and moral debates that can be had about using Ad Blockers but this isn’t the forum for that. There are similar debates that can be made about tracking users who don’t want to be tracked. For this reason, I would like to implement the following approach on my sites; an article written by the same guy that gave us the wonderful ad blocking table also wrote this: How to track if Google Analytics is blocked – in Analytics! In this article he basically describes that all he wants to do is track the number of users which are actually blocking Google Analytics, and nothing more. Is approach is perfect for my purposes as I simply want to understand how much traffic (visitors) my sites are getting on a daily basis.

In Philip’s article mentioned above, he using JS and PHP to implement the tracking (of users that have blocked Google Analytics). This approach should be straight forward for me to implement on my main website, but I’m going to have to investigate how this can be done on the WordPress (my blog) site.

I’ll post an update on how this can be achieve in WordPress once I have figured it out 🙂

Update 1:

Turns out that, uBlock Origin does not block the ga object from being created. When this code is run:

The console outputs GA loaded. so, the php code will never be run. After I inspected the network tab in the developer options, I found this (click on the small image to expand it):

 

As you can see, the call to the analytics API is what is actually blocked by uBlock Origin. This would explain the initial “Missing HTTP Response” error that I was getting, since uBlock Origin, stopped the request after it was sent out.

I will need to find another way to implement this.

If anyone has any suggestions, please let me know in the comments.

Update 2:

While searching the web, I manage to come across two approaches to determining if a user has an ad blocker installed. One here and another here. The first approach does not seem to work for uBlock Origin, as I was not getting the desired results. The second approach using a custom ads.js file, worked like a charm :)…

Further, the only problem with this method is that requests sent to google analytics are still intercepted and blocked by uBlock Origin. This means that I am currently still unable to track users if uBlock Origin is installed.

Wiki site available

The purpose of this post is for me to announce the availability of a new “site” on my domain – a wiki site. This site can be found at: https://wiki.newteq.co.za.

I will be using the wiki site for more tutorial based posts and things to keep in mind when setting up servers, or configurations for applications.

My first post on the wiki platform will be an item regarding the set up of SSL on your apache web server, using Let’s Encrypt . Let’s Encrypt is a great way to get your website SSL secured without having to pay for SSL certs. The Let’s Encrypt drive is to ensure that all web traffic is sent over HTTPS. Let’s Encrypt ensures that you own the server that you are wanting to enable SSL on, making it perfect for anyone (like myself) who would like to ensure that their content is served over HTTPS, but aren’t a huge corporate with big pockets to get the Verisign (or similar) certs.

I have only covered a very high level overview of my understanding of Let’s Encrypt. If you wish to find out more about it, please visit their website

Once I have completed the Let’s Encrypt tutorial, I will be posting another article on here as notification.