Setting up an Ubuntu 14.04 LEMP Server with the Nightly Build of PHP7

Install nginx

apt-get update
apt-get install nginx

Install and secure MySQL

apt-get install mysql-server
mysql_install_db
mysql_secure_installation

Add Zend repo and install PHP7

echo "deb http://repos.zend.com/zend-server/early-access/php7/repos ubuntu/" >> /etc/apt/sources.list
apt-get update 
apt-get install php7-nightly

Configure PHP7 php-fpm.conf

cd /usr/local/php7/etc
cp php-fpm.conf.default php-fpm.conf
nano php-fpm.conf

Uncomment/Change

pid = /var/run/php7-fpm.pid

Uncomment/Change

error_log = /var/log/php-fpm.log

Configure PHP7 www.conf

cd /usr/local/php7/etc/php-fpm.d
cp www.conf.default www.conf
nano www.conf

Change

user = www-data

Change

group = www-data

Uncomment

listen.allowed_clients = 127.0.0.1

Uncomment

security.limit_extensions = .php .php3 .php4 .php5 .php7

Configure PHP7

wget -O /etc/init.d/php7-fpm "https://gist.github.com/bjornjohansen/bd1f0a39fd41c7dfeb3a/raw/f0312ec54d1be4a8f6f3e708e46ee34d44ef4657/etc%20inid.d%20php7-fpm"
chmod a+x /etc/init.d/php7-fpm
touch /etc/init/php7-fpm.conf
nano /etc/init/php7-fpm.conf

Add the following to php7-fpm.conf

exec /usr/local/php7/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php7/etc/php-fpm.conf

Add the checkconf file for PHP7

touch /usr/local/lib/php7-fpm-checkconf
    nano /usr/local/lib/php7-fpm-checkconf

Add the following to the php7-fpm-checkconf

#!/bin/sh
set -e
errors=$(/usr/local/php7/sbin/php-fpm --fpm-config /usr/local/php7/etc/php-fpm.conf -t 2>&1 | grep "\[ERROR\]" || $
if [ -n "$errors" ]; then
    echo "Please fix your configuration file..."
    echo $errors
    exit 1
fi
exit 0

Configure PHP7 continued

chmod a+x /usr/local/lib/php7-fpm-checkconf
update-rc.d -f php7-fpm defaults
ln -s /usr/local/php7/bin/php /usr/local/bin/php
ln -s /usr/local/php7/sbin/php-fpm /usr/sbin/php-fpm
service php7-fpm start

Set up nginx config

cd /etc/nginx/sites-available
cp default (your site here).conf
nano (your site here).conf

Configure your config as needed (example script below)

server {
        listen *:80;
        server_name (server name here);

        root /usr/share/nginx/html;
        index index.php index.html index.htm;

        client_max_body_size 1m;

        error_log /var/log/nginx/(your site here).error.log;
        access_log /var/log/nginx/(your site here).access.log;

        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
                fastcgi_index index.php;
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                try_files $uri $uri/ /index.php$is_args$args;
                fastcgi_pass 127.0.0.1:9000;
                include /etc/nginx/fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $request_filename;
                fastcgi_param APP_ENV dev;
        }
}

Continue set up nginx

ln (your site here).conf ../sites-enabled/(your site here).conf
rm ../sites-enabled/default

Restart services

service php7-fpm restart
service nginx restart

Independent Sales Representative Position

OmniSpear, Inc. is looking for a seasoned and motivated sales representative who wants to be part of our fast-paced and innovative web and IT solutions team. This candidate should be someone who excels working both independently and as part of a close-knit collaboration. Since 2001, OmniSpear Inc. has been providing web and IT services to businesses in Dayton, Cincinnati, Columbus and beyond.

From IT Support to complex web application development, OmniSpear has the in-house staff to handle the design, development and implementation of both web and IT solutions. As our Sales Representative, you will help us bring new companies in need of one or more of our many customer models. The position offers both a commission on sales generated, as well as base salary – so growing our sales means you grow with us along the way.

The position requires a person who can take the sales function and utilize an entire process from start to finish. This includes devising a sales process, identifying target clients, research of prospective clients’ needs, arranging meetings and presentations, strong follow up and drip campaigns and closing sales.

Responsibilities Include:

– Identifying prospective clients and working to find qualified leads

– Prospective client contact, including cold calling, networking, and referrals

– Client presentations and meeting setup

– Active follow-up on leads and detailed activity notes on the sales process and client communication

– Closing of sales

Qualifications & Experience:

– Self-motivated – someone who doesn’t need to be monitored to get things done

– Team player with overall company focus, while still maintaining the ability to work independently

– Outgoing personality with strong interpersonal skills

– Detail-oriented and goal focused

– Strong computer and online technical skills

– Strong written and verbal communication skills

Compensation:

– Base salary plus commission

– Commission paid every two weeks

– Ongoing monthly commission on website hosting sales for as long as you hold a working business relationship with OmniSpear, Inc.

Job Type: Full-time

Required experience:

– Sales Experience: 2 years

Regression testing of websites with just a little JavaScript.

In my past professions whenever the word “testing” came up, there were usually one of two follow-up actions to take on my part as a developer.

– Get with a group of testers and draft a Q&A (quality assurance) specification.
– I would be the one stuck with the task of programming test scripts in some language that would take quite a bit of time (I was using Borland Silk Test version 6 and I’m quite sure the latest is a dramatic improvement).

As I spend most of my time in Javascript, it would be nice to create standard automated regression tests in the same realm of my skill set (i.e. web technologies). And that’s where PhantomJS comes in. For those web developers who have used the Console window inside their browser cranking out console.log statements will be right at home with PhantomJS.

What is it? It’s a headless (something you can’t see) web browser based on WebKit that is “scriptable”. Imagine a console terminal application that can be programmed to go to a web site which performs the following:

– Calculates the time it takes to load the page.
– Performs some validation. When the script enters a letter instead of a integer (inside a input box), does it error like it’s suppose to?
– Automated action. Fill in the input fields and click on the submit button.

If you’re comfortable using jQuery, you can simply load it in the PhantomJS environment and off you go. Here’s a taste of a PhantomJS script that goes to www.omnispear.com to print out all the blog headings:

var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
    console.log(msg);
};
page.open("http://www.omnispear.com", function(status) {
    if (status === "success") {
        page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js", function() {
            page.evaluate(function() {
                var blogs = $('#blog_feed_text');
                $(blogs).find('.wp-title a').each(function(i) {
                    console.log($(this).html());
                });
            });
            phantom.exit();
        });
    }
});

I’ve been following the development of PhantomJS since it first came out in 2011 and I am excited about where the project is heading. If testing websites is something that is in the back of your mind, you definitely should check it out.

Full-Time Web Developer

OmniSpear, Inc. is currently seeking versatile individuals eager to join our team of talented web professionals. Working in a business-to-business environment, you will be responsible for working on large and small web-based applications for our clients. Projects range from custom websites to custom ERP and CRM systems.

This is a full time position at our Miamisburg, Ohio office (located near the I-75 Austin Pike Interchange). You must be a U.S. citizen or permanent resident.

Requirements:

– Attained or pursuing a Bachelor’s degree in information technology/computer science or equivalent experience
– 2 to 5 years of experience with PHP, C#, Java, Scala, or Ruby
– Show the capability to learn new languages and existing code bases quickly
– Experience with SQL (dialect not important)
– Experience with JavaScript and HTML/CSS
– Clear communication and comprehension skills
– Ability to manage multiple tasks simultaneously
– Experience using source control such as Git

Responsibilities:

– Develop, support, and maintain web-based applications
– Identify opportunities for application scalability, sustainability & improvement
– Evaluate customer or internally-driven functionality change requests for technical feasibility and level of effort
– Track time spent on projects effectively
– Document and write tests for code
– Follow established development standards for the company and clients

Bonus Skills:

– Experience with Continuous Integration or Automated Deployments
– Experience with Linux web server configuration
– Experience with IIS configuration

Perks:

– Insurance
– IRA Plan with matching
– Casual work environment

Send resumes to careers@omnispear.com.

NowHiring

Use multiple cloud hosting companies for efficient pricing and effective infrastructure.

While the idea of managing data and applications using multiple cloud providers may sound like a nightmare to maintain – are there any benefits? One likely benefit is the removal of single point of failure within your business process. Cloud providers ranging from Amazon to Microsoft have faced outages in the past and it surely was noticed throughout the web (Instagram website was unavailable).

By putting your business processes in multiple locations and infrastructure – you will find yourself in the following situation: “Our website and applications are down but our reporting service and HR systems are still up.” Doesn’t that sound better compared to “It’s all down. We’re waiting on the hosting company to come back with an ETA.” Perhaps your reporting service is hosted in Microsoft’s Azure (SQL Server and SharePoint rigged with SQL Reporting Services) with SalesForce.com handling HR information. Just because your corporate website and product is unavailable doesn’t mean your whole company is at a full stop.

Selecting multiple cloud carriers leaves room for creative price management. Perhaps one provider is better for bandwidth while another is more flexible for storage. If the cost of managing your IT infrastructure is really a concern, selecting multiple cloud hosting company should definitely be considered. And there are solutions out there to help manage the multiple cloud environment, such as RightScale.

Further reading:

2014 Best Cloud Hosting Reviews and Comparisons

Amazon Web Services suffers outage, takes down Vine, Instagram, others with it

Designing Website Asset Caching with Scalatra

Regardless of if you spent countless hours writing pretty CSS and JavaScript or you just need to package Bootstrap and jQuery in your application the last thing you need to worry about is loading all of your assets individually. This can wreck your sites loading times and rendering performance. Scalatra being a light weight framework for building straight forward applications and API’s doesn’t come with a prescribed solution, though WRO4J can step in to assist us with this process. We will step through the configuration of WRO4J, SBT, and finally the inclusion of these into your layouts.

To configure WRO4J we will first add it into our Build.scala or Build.sbt file. We will add a dependency in the following manner:

      libraryDependencies ++= Seq(
        "ro.isdc.wro4j" % "wro4j-core" % "1.4.0",
        ...
      )

We then need to configure our wro.xml file for our Boostrap and jQuery assets:

<?xml version="1.0" encoding="UTF-8"?>
<groups xmlns="http://www.isdc.ro/wro">
    <group name='core'>
        <css minimize="false">/css/bootstrap.min.css</css>
        <css minimize="false">/css/bootstrap-theme.min.css</css>
        <css minimize="false">/css/bootstrap-glyphicons.css</css>
        <css minimize="true">/css/app.css</css>
        <js minimize="false">/js/jquery.min.js</js>
    </group>
    <group name='bottom'>
        <js minimize="true">/js/bootstrap.min.js</js>
    </group>
</groups>

Followed by our wro.properties file which defines our WRO4J usage:

cacheUpdatePeriod=0
modelUpdatePeriod=0
debug=false
disableCache=false
gzipResources=true
ignoreMissingResources=false
jmxEnabled=true
preProcessors=cssImport,semicolonAppender
postProcessors=cssMinJawr,jsMin

Now we will adjust our layouts to point to the new compiled asset:

        <link href="/assets/core.css" rel="stylesheet" />
        <script src="/assets/core.js"></script>

While this is running you should see a local development speed improvement similar to the table below. This result will be amplified when the application is running remotely in a production environment.

To make this capability suit our needs better in development and to additionally be used for Cache Busting in production we can also add a versioning output to our SBT build process. This will create a file that holds version information and a build number from our Jenkins CI, which we will use to determine the build state and to append to the URL to bust the cache.

To create our version.scala add the following code to your Build.scala file:

lazy val project = Project (
    ...
      // put this in your build.sbt, this will create a Version.scala file that reflects current build state
      sourceGenerators in Compile <+= (sourceManaged in Compile, name, organization, version) map {
        (sourceManaged: File, name: String, vgp: String, buildVersion) =>
          import java.util.Date
          val file = sourceManaged / vgp.replace(".", "/") / "Version.scala"
          val code =
            (
              if (vgp != null && vgp.nonEmpty) "package " + vgp + "n"
              else ""
              ) +
              "object Version {n" +
              "  val namet= "" + name + ""n" +
              "  val versiont= "" + buildVersion + ""n" +
              "  val datetimet= "" + new Date().toString() + ""n" +
              "  val buildNumbert=""+System.getProperty("BUILD_NUMBER", "MANUAL_BUILD")+""n" +
              "}n"
          IO write(file, code)
          Seq(file)
      }
    )
)

We also need to make sure that Scalate will see this class in scope during runtime.

In Build.scala replace:

            Seq.empty,  /* default imports should be added here */

With:

            Seq("import "+Organization+".Version"), /* default imports should be added here */

Now we can update our layout file with a condition that will automatically switch between development and production inclusions of our assets with a Cache Busting scheme.

    #if(com.omnispear.example.assets.Version.buildNumber=="MANUAL_BUILD")
        <!-- Bootstrap core CSS -->
        <link href="/css/bootstrap.min.css" rel="stylesheet" />
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    #else
        <link href="/assets/core.css?v=<%=com.omnispear.example.assets.Version.buildNumber%>" rel="stylesheet" />
        <script src="/assets/core.js?v=<%=com.omnispear.example.assets.Version.buildNumber%>"></script>
    #end

To verify your BUILD_NUMBER handling will work and be passed from Jenkins or your other build system of choice you can run the command example below. Then verify that your assets have switched properly and you are seeing minified and gzipped responses.

./sbt -DBUILD_NUMBER=234 "container:start" "~ ;copy-resources;aux-compile"

An alternative solution would be to use the SBT WRO4J plugin. However, we feel the above method is slightly cleaner and easier to work with for our development process.

The example project for this is available on github. We also would like to thank those whom helped with the initial help with the generation of the Version.scala.

Subliminal Marketing

James Vicary in the late 1950’s performed an experiment in front of moviegoers (unbeknownst to them) flashing two messages: “Drink Coca-Cola” and “Eat Popcorn”. His finding shows there was a substantial increase in the sales of soda and popcorn. When Vicary was asked to reproduce his findings, he admitted he had falsified the data.

Nearly 50 years later, Vicary’s hoax is still in use (and still fine-tuned) by many companies practicing subliminal advertising and marketing. Can a logo of a company build trust and loyalty with consumers (as subtle as shifting a character within a company name)? Definitely something to consider when you are debating between buying an Apple product versus Dell, Lenovo, or the many PC makers out in the market.

Do you see the arrow in FedEx’s logo? The arrow is pointing to the right (parked between the two letters E and X), possibly hinting at “wanting to move something forward”.

Further reading for your consideration:

15 Corporate Logos That Contain Subliminal Messaging

Small Business Marketing Advice: Should You Use Subliminal Advertising?

Subliminal Messages Motivate People To Actually Do Things They Already Wanted To Do

Subliminal advertising really does work, claim scientists

UCL study: subliminal messaging ‘more effective when negative’

The Importance of Software License Management

As businesses grow and purchasing of software is spread across multiple people, it has become increasingly difficult to manage and keep track of the licenses for this software. There are several reasons why keeping an up-to-date inventory of software licenses is important. First it ensures that you are in compliance with the software company’s terms and conditions. Secondly, this inventory will help assist you in the process of showing proof of purchase in case of an audit done by a software company. Lastly, keeping an up-to-date inventory allows you to easily and quickly access license serial keys for software reinstalls in case of a computer crash.

Many companies use basic Microsoft Office Excel spreadsheets to manage their software licensing. This solution is okay, but the major issue with using any type of manual entry inventory is making sure your data is up-to-date. After purchasing several licensed software titles and forgetting to update your inventory results in the data becoming out of date and eventually unusable.

AllMySoftware

OmniSpear has a solution to this problem. Currently in beta now, AMS (AllMySoftware) is a web and cloud-based solution that will manage all of your IT infrastructure licensing needs by small software agents deployed on all computer systems that will securely transmit data to a web management portal in the cloud. This portal will display all licenses across several groups, locations, or clients (for MSP’s) and will allow multiple users in your organization to manage this data. This system will always keep an up-to-date listing of software licenses on all systems.

For more information please visit www.allmysoftware.com

Mobile Application Development Frameworks

Here at OmniSpear, the development team is about to ramp up on creating a mobile application for the iOS and Android platform (Windows Phone support to follow). Evaluating the many frameworks out in the wild, we’ve become attracted to one specific contender. Our initial requirements out of the gate are as follows:

  1. Rapid development & deployment without steep learning curve.
  2. The ability to test the application on multiple physical devices without publishing the application to the market store (Google Play & Apple Store).
  3. Mobile application should have a native look and feel aspect to it.

Following options were assessed:

PhoneGap Build, Steroids, and Icenium all support the PhoneGap framework (or the open source version Cordova). Since Javascript is a common knowledge among our team, utilizing PhoneGap fits quite well in our development environment. All three has a solid build system allowing us to make changes and viewing the application on our own physical device with ease. However Icenium really shines when it comes to providing a rich user interface library, that’s where Kendo UI comes in (among other attractive integration features like MVVM).

Build, test, fix, test, and deploy. We could take the route of either creating or bringing in external open source work to create the bells and whistles and the lean underlying code that does the real work. However if the project schedule is too sensitive to bringing in some “cool” library from Github what naturally makes sense? In our case, a whole solution provider to keep development cycle tight and all integrated along with a dedicated customer support.

For those interested in the difference between the popular jQuery Mobile and Kendo UI: JQUERY MOBILE VS KENDO UI

Onsite Email is Becoming a Thing of The Past

As the entire IT industry moves toward the “cloud”; companies are looking at every component of their infrastructure to see what is no longer needed “on premise”. One of the most popular mail server products on the market is Microsoft Exchange. Many companies host this onsite for the rich feature set that Microsoft Exchange provides. With Microsoft Small Business Server 2003, 2008, and 2011, Exchange was built-in to the operating system which provided a cost-effective email server solution without the need to purchase a separate exchange license and extra CAL’s which are costly on their own.

The problem is that many companies would prefer to have exchange functionality with actually hosting “exchange” themselves. And many MSP’s would love to offer exchange functionality to their clients without having to support “exchange”. Businesses want to reap the benefits of having exchange functionality and all that comes with it without having to actually deal with an Microsoft Exchange server on-premises. Same goes for MSP’s.

office 365Microsoft’s solution is a product called Office 365. Built as a competitor to the ever increasing popular Google Apps product by Google, Office 365 essentially provides email solutions with exchange functionality, but all hosted in the “cloud” on redundant Microsoft servers across the world. It doesn’t stop there, they have added many of their existing server software packages to Office 365 including Lync, SharePoint, and SkyDrive. With more and more features added every year, moving your email solution to the cloud only makes sense for small to medium sized companies.

If you have further questions about moving your company to the cloud or for a quote, please email us at info@omnispear.com