Really advanced web applications – Things you need to know deploying your first web app Part 1

Really advanced web applications - Things you need to know deploying your first web app Part 1

Computer-Code

They say that web applications are the wing of application development that is the most difficult, time consuming and demanding endeavor in the life of an applications programmer. Firstly, web applications are wider and require a lot of time managing, tweaking and developing their interconnected joints. What do we have? We have the programming language which falls in two server side and client side.

Client Side Programming

In client side programming languages we have contenders such as:

  1. HTML5
  2. Javascript
  3. CSS
  4. ActionScript

Server Side Programming

Server side programming languages are what make web applications tick. They provide the functionality, logic and work closely with the server. This is the stuff for big boys or rather grown men. Server side code is hidden from the eyes of the user and is processed in the back end so that the user can be able to do stuff  like, share what’s on your mind, updates, interests, places on ClikPals, or say what’s on your mind on Facebook. It just happens automagically without you realizing how much work has been done to put this experience in place. The server side the contenders are:

  1. PHP – most popular of them all with over 244M sites running it.
  2. Server Side Javascript – Node.JS and the likes
  3. Java
  4. ASP stands for Active Server Pages
  5. Python – considered the easiest, is preferable to beginners
  6. Perl
  7. Ruby

Now you are encouraged to try to learn how to code, coz that is the future and everyone should be a programmer in one way or another. Programming is great in that it opens your mind, allows you to think in various dimensions at once and that is how a programming solution is solved.

Which programming language you wish to learn first is all up to you, but you should start at code.org and then learn the very basics for you to have  a solid foundation in writing code. How to program, well that is out of the scope of this post, but you can find some very easy to follow instructions on how to learn and intuitive learning at code school.

Once you have built your web application you gear yourself to start monetizing it and if it is a start up application then your intention is to make it big. With big data comes more responsibility, you have to be sure that your application is running at top notch. Besides the optimal code practices you learn at code school, you need to ensure that your web application performs best at all times. That is where the responsibilities of a System Administrator come in, the server where your application is hosted must be maintained and kept running smoothly at all times. To help you do this there are various applications out there SaaS (Software as a Service) provide by other developers like you. We will talk about new relic here, what it is, its installation and I will also share a few screenshots of it in action.

New Relic – Server and Application Monitoring

Like I have mentioned that you will need to be on top of your game when dealing with really advanced web applications. You will need to know how much space has been utilized on your server, how much is left, how many core CPUs do you have and how much load is it dealing with at a specific time, is the mail server sending out and receiving mails as expected. How many processes are running on your server and are they the right processes or some clever fellow is piggy backing on your server using your resources to do some very nasty stuff like emailing all your ex-girlfriends all the way to pre-primary school or worse stealing your users account details like credit card information, when this happens it is not good for you at all. That is where New Relic comes in. New Relic is an internet company that offers performance management solutions enabling developers to diagnose and fix application performance problems in real time. Signing Up with New Relic will give you access to tools that will allow to monitor your server and web application in real time.

Installing New Relic

Installation of New Relic is not a lengthy process and they also offer an installer script in case you do not want to go through all the trouble of setting repositories etc

1. Confirm your server specifications before you proceed, you need to know which operating system your server is using and which server side programming language your application runs on. Mine is PHP, though I mix in Java and some other languages. I have a 64 bit CentOS dedicated server, meaning I can login through ssh and execute the following commands. If you do not have root access then you can stop and kiss this experience good bye or upgrade to some dedicated hosting now.

2. Once you have have gotten some dedicated hosting by clicking the immediate link above we can proceed. I will run the command to add the 64 bit new relic repo to my server

sudo rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm

3. We will install the new relic agent using yum. If you don’t know what yum is then please stop.

sudo yum install newrelic-php5

4. We then run the new relic install and follow the instructions, if you have advanced knowledge in server management then this will be a walk in the park, otherwise it may prove to be a little difficult. However, if you have no idea what you are doing then you need to stop and get some professional help from us or any other experienced Systems Administrators, with good knowledge of Linux Server, Windows Servers are another thing all together.

sudo newrelic-install install

5. When you sign up for new relic as you deploy the new relic agent you will be given a license code which you will include in your php.ini new relic configuration.

6. Once you are through with the installation you can now restart your services, i.e nginx, httpd. For me I am using Apache with the httpd web server and the command for this is:

service httpd restart

7. Wait for a few minutes and refresh your New Relic dashboard before the application can be able to start sending data.

Now we have fully set up our web application monitoring, lets move on to server monitoring. This is where I talked about monitoring your disk space usage, your CPU load e.t.c

Installing New Relic Server Monitoring

Being that we had already installed the web application monitoring, server monitoring will now be just a few commands away. We won’t need to set up the new relic repo again or go through the process of installing new relic again.

To install the new relic server monitoring agent we will go through the following steps.

1. Install the server monitor, run these commands as root

yum install newrelic-sysmond

2. Set new relic license key. The license key can be obtained from the New Relic dashboard once you login to their site.

nrsysmond-config --set license_key=YOUR_LICENSE_KEY

3. Start nrsysmond. Execute the following command as root:

/etc/init.d/newrelic-sysmond start

Verify that a message indicates that nrsysmond has started successfully. Then your server statistics will start being reported from the Servers tab of your New Relic dashboard. That’s it for part one of this post, in part two I will be focusing on optimizing your application speed by installing caching technologies such as Pagespeed Module by Google. Please feel free to drop me your inquiries and suggestions about this post on the comments below.

Share

SNETTSCOM is an IT company. We excel at providing solutions in systems integration, consultancy, outsourcing, applications development, networking and security. Aside from this, SNETTSCOM also specializes in creative design and marketing.

Recommended Posts