Tag Archives: Architecture

How to Setup the LAMP Stack on Mac OS X

Install Apache MySQL, & PHP on Mac OS X Yosemite

Setup LAMP on Mac OSX

LAMP is an acronym for Linux, Apache HTTP Server, MySQL relational database management system, and PHP server-side programming language.   This web service solution stack is a model for building dynamic web applications and web services.  Web developers can now implement this model on their Mac OS X Yosemite computers to support the development of web-based applications and web services.

Please use caution when installing new software on computer systems. A Best Practice includes creating system backups before changes.

How to Enable Apache Web Server on Mac OS X

The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems.

Apache Web Server is already included with Mac OS X Yosemmite.  This server can be started with the following steps.

Open a terminal window and log in as the root user:
$ sudo su –
(enter root password at the prompt)

Start Apache with the following command:
$ apachectl start

Verify the Apache Web Server is running on your Mac OS X by opening a web browser and navigating to http://localhost

 How to Enable PHP for Apache

PHP is a popular server-side scripting language designed for  web development.

Enabling PHP for the web server on Mac OS X requires an edit of the Apache configuration file.  A copy of the current version of this configuration file can be saved before the edit by running the following command in the terminal.

$ cp /etc/apache2/httpd.conf  /etc/apache2/httpd.conf.bak

The Apache configuration file can be edited by running the following command in the terminal.

$ vi /etc/apache2/httpd.conf

This will open the configuration file in the terminal window.  Edit this file by pressing “i” key.  Enable PHP for Apache by uncommenting (remove #) the following line.

Enable Virtual Hosting by uncommenting the following line.

Enable Mod Rewrite by uncommenting the following line.

Save and close this configuration file by pressing the “escape” key, then entering the following command.

$ :wq

How to Create Virtual Hosts in Apache

The term Virtual Host refers to the practice of running more than one web site on a single machine.  We enabled virtual hosting by allowing Apache to load the httpd-vhosts.conf file in the previous step of editing the httpd.conf file by uncommenting the following line.  Include /private/etc/apache2/extra/httpd-vhosts.conf

How to Define a Virtual Host in Apache

The site we are creating in the example is “mobile” with “local” as the top-level domain (TLD).  This will give us http://mobile.local as the URL.  I use “local” as the TLD to help me remember the site is running on my local system, but you can use any value for the TLD.  You can also use any value for the site.  The next few steps will also include defining a local project directory for your new web project.  You can change these values to match your needs, just make sure your values match the values you define in the Virtual Host entry in Apache.

Create a folder on your local file system for the DocumentRoot of your new site.

/1/projects/mobile/www/DocumentRoot

Create a backup of the httpd-vhosts.conf file by running the following command.

$ cp /etc/apache2/extra/httpd-vhosts.conf /etc/apache2/extra/httpd-vhosts.conf.bak

Edit the httpd-vhosts.conf file with the following command.

$ vi /etc/apache2/extra/httpd-vhosts.conf

Add the following markup to the httpd-vhosts.conf file.

Note how the <Directory> definition is slightly different for Apache 2.4. This Apache 2.4 configuration will prevent the Forbidden error that is accompanied by the Apache error message, “You don’t have permission to access / on this server.”

This next step assumes the owner defined in Apache config is _www. Replace “_www” with the name of Apache Server owner. Open a Terminal Window and navigate to the parent folder of the new site directory, then enter the following commands:
# Move into the new site directory
$ cd /1/projects/mobile/www/
# Change ownership of all files to the Apache Server process owner
$ sudo chown -R :_www DocumentRoot
# Change permissions of all site files
$ sudo chmod -R g+w DocumentRoot

 How to Define Virtual DNS

In order to access your new site by name, you will need to edit your system’s hosts file.
# Open /etc/hosts file
$ vi /etc/hosts
# Add the following line towards the bottom of the /etc/hosts file.
127.0.0.1 mobile.local
# Save and close file, then flush the DNS with the following command:
$ discoveryutil udnsflushcaches
# Restart Apache
$ apachectl restart

How to Create a PHP Test Page

The PHP test page for your new site can be created with the following commands.
# Create file
$ vi /1/projects/mobile/www/DocumentRoot/php.php
# Press the “i” key to edit this new file and enter

# Press the escape key to exit editing mode, then save file
$ :wq
# Open a web browser and go to the following URL

http://mobile.local/php.php

How to Install MySQL on Mac

MySQL is the world’s most popular open source database.

  1. Download the MySQL DMG for Mac OS X here.
  2. Install MySQL
  3. Install Preference Pane
  4. Start MySQL from Mac System Preferences Panel

Add MySQL to System PATH with the following commands.
# Modify/Create the .bash_profile file
$ touch ~/.bash_profile
$ vi ~/.bash_profile
# Add the following line to the bottom of ~/.bash_profile
export PATH=”/usr/local/mysql/bin:$PATH”
# Activate ~/.bash_profile update
$ source ~/.bash_profile
$ echo “/usr/local/mysql/bin” >> /etc/paths.d/mysql.path

Connect PHP and MySQL
$ cd /var
$ mkdir mysql
$ cd mysql
$ ln -s /tmp/mysql.sock mysql.sock

How to Install phpMyAdmin

phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web.  Download phpMyAdmin here.

Download phpMyAdmin to the system’s default web directory, “/Library/WebServer/Documents/”; then run the following commands from the Terminal Window.

# Move into default web directory
$ cd /Library/WebServer/Documents/
# Unpack phpMyAdmin download
# NOTE: Use actual phpMyAdmin download file name
$ tar -xvf ~/Downloads/phpMyAdmin-3.5.2.2-english.tar.gz
# Rename unpacked phpMyAdmin folder
# NOTE: Use actual phpMyAdmin download folder name
$ mv phpMyAdmin-3.5.2.2-english/ phpmyadmin
# Move into the new phpmyadmin directory
$ cd phpmyadmin
# Create the phpmyadmin config file
$ mv config.sample.inc.php config.inc.php

Launch the phpmyadmin dashboard by opening a web browser and navigating to the following URL: http://localhost/phpmyadmin

How to Start the Virtual Environment

This Mac OS X Apache MySQL PHP development environment can be started with the following steps.

# Make sure the MySQL database is running
Open MySQL Panel from Mac OS X System Preferences
# Open Terminal and switch to root user
$ sudo su –
# Use Terminal Command to start Apache
$ apachectl restart
# Use a Web Browser and Navigate to Website

How to Create Additional Virtual Environments

Additional virtual environments can be easily be created by just repeating the steps outlined in “How to Define a Virtual Host in Apache” section of this tutorial.

Summary

Following these steps provides the web developer with a development environment for creating web applications and web services using open-source technology.

Enterprise Gamification for Leveling Up to Prediction Markets by Powering Up with Collective Intelligence

Enterprise Gamification Strategy

Enterprise Gamification is the use of game mechanics within organizations to support a collaborative culture that aligns with business objectives to create an agile social business model that can increase chances of success in current competitive markets and future markets.  Applying the principals of game theory and implementing game mechanics in enterprise 2.0 platforms plays a very important role in it’s event-driven architecture for capturing the REAL value of enterprise 2.o solutions.  This REAL value is realized by lowering barriers of participation and showing the relationships of people, ideas, and things.  Implementing enterprise gamification strategy should be a part of the complete social business strategy.  Additional information is available in this article, “The Gamification of Innovation in the Enterprise“.

The Exponential Value of Social Business

What is the difference between Social Business and Enterprise 2.0?

The term “Social Business” gained wide-spread popularity at the 2010 Enterprise 2.0 Conference.  Andrew McAfee ( @amcafee ) shares his valid thoughts on this trend in “‘Social Business’ is Past Retirement Age“.  Stowe Boyd ( @stoweboyd ), another well-respected player in the Enterprise 2.0 Industry, shares his thoughts on this trend in “Andrew McAfee on ‘Social Business’ versus ‘Enterprise 2.0′, One More Time“.  Using a label / hashtag ( #e2conf or #e20 ) makes discovering related information easy.  Using “labels/terms” also helps focus context of conversation.  “Enterprise 2.0″ has revived SOA, SaaS, PaaS, …., but I believe the specific term still depends on the context of the conversation.

This controversy over terms also applies to “#Gamification“.  The terms “Gamification” or “Gamify” may seem “buzz busy” and out of place in the context of business, but these terms actually help business leaders connect to new ideas for accomplishing business goals.  You can learn more about how to use game mechanics to accomplish your goals at this Gamification Workshop by Gabe Zichermann ( @gzicherm ) scheduled for June 23 in Washington, DC (check the schedule for a location near you).

The foundation of harnessing the power of the web for Social Business leads us back to “Web 2.0: A Strategy Guide” By Amy Shuen.  Videos on this guide by Amy Shuen are available at “‘Web 2.0: A Strategy Guide'” By Amy Shuen“.

Unlocking the Deeper Levels of Value in Enterprise 2.0 Platforms

Combining Enterprise Architecture (EA) with Service-Oriented Architecture (SOA) and Event-Driven Architecture (EDA) provides methods for capturing and surfacing the power of collective intelligence.  This architecture strategy for Business Intelligence (BI) leverages previously unknown causal relationships to form a new event pattern.  This new business intelligence pattern triggers further autonomous human or automated processing that adds exponential value to the enterprise by injecting value-added information into the recognized pattern which could not have been achieved previously.  I have shared ideas on this topic before at “Enterprise 2.0 Adoption Patterns: Collective Intelligence“.

Collective Intelligence

The main concept to grasp about collective intelligence in the enterprise is this:

The whole is greater than the sum of its parts.”  ~Aristotle

Prediction Markets

Harnessing the power of collective intelligence to unlock the hidden levels of prediction markets can be accomplished by surfacing data through interactive widgets, gadgets, and apps.  Data analysis can be difficult and time consuming, but crowdsourcing these tasks out to the players of your business community can lighten the burden and achieve better results.  These interactive apps can be created by mashing up data with chart/graph APIs and game components into web-based widgets.  Using standard methods for creating these widgets will support sharing the experience across the enterprise in a platform independent manner.

How Do We Get There From Here?

The challenge of successfully unlocking these hidden secret levels of value will require a collaborative effort.  Here are a few resources for helping your team on this quest.

BUNCHBaLL Gamification Whitepaper

“Gamification uses proven techniques from game design to satisfy your customers and engage them with your content, community or brand, while simultaneously driving meaningful value for your business.” ~ BUNCHBaLLGamification Whitepaper

Badgeville – Gamification Report

“Badgeville is a white label Social Rewards & Analytics Platform for web and mobile publishers. Our customers come from a wide variety of verticals including retail, entertainment, publishing, education, enterprise and more.” ~Badgeville – Gamification Report

APIs, Apps, Widgets, & Gadgets

Wisdom of the (developer) crowd: Key lessons on using APIs

“… We’re talking specifically about “open” (or public) APIs, those that are intended to be picked up and used by outside developers. This is common practice in the tech industry, where Facebook, Twitter, Google, and more offer APIs that let developers build applications around their data… ”

PhD Thesis on Mashups

Michele Stecca (@steccami ), Convergent Composition of Telecom and Internet Services in Telco/IT Mashups, PhD Thesis, University of Genoa, 2011

Pro Web Gadgets

“Pro Web Gadgets” by Sterling Udell was published before its time.  This book about “Cross-platform Development Strategies” goes far beyond how to use clever Web 2.0 technologies for creating apps, widgets, and gadgets for the “Distributed Web”.  The author carefully guides the reader through the techniques and strategy of extending existing IT investments to make data more interesting and sharable across environments and devices.  The purchase of this book is a priceless investment for anyone thinking about developing for the future of the web.

Developing Web Widgets with HTML, CSS, JSON and AJAX by Rajesh Lal is also a good book, but I like it for different reasons and plan share some thoughts on it soon too.


Enterprise Gamification is a huge topic with many areas to explore.  You can discover more here “Enterprise Gamification”  I have also discovered a lot of very smart helpful people about this topic on Twitter.  You can follow this #Gamification Twitter List to connect with people that can help you on this adventure.  You can discover intelligent people sharing ideas about Enterprise 2.0 & Social Business on this “Enterprise 2.0 Twitter List #e20“.

Enterprise 2.0: Top 10 Reasons NOT to Use WOA & APIs

Enterprise 2.0 Strategy for Platform Architecture

Intranet vs Internet

The main goal of a winning Enterprise 2.0 Strategy is to facilitate communication and innovation through collaboration.  The Art of Enterprise Architecture in E 2.0 is to unite people and process.  Thoughts on Enterprise 2.0 Architecture include leveraging the principles of Service-Oriented Architecture (SOA) to support Web-Oriented Architecture (WOA).  This type of Internet architecture for the Intranet makes is possible to support Web 2.0 Apps, Gadgets, & Widgets in the Enterprise.  This strategy reduces the number of resources required for the technical part of Enterprise 2.0 Architecture and provides time to focus on Improving Enterprise 2.0 Adoption Through Gamification.

Many organizations today are supporting employee collaboration through Enterprise 2.0 Platforms.  Vendors are also providing Enterprise 2.0 Solutions that include Social Networking features very similar to Facebook and Twitter.  Some organizations and vendors are missing the biggest success factor behind these popular Social Networking Platforms.  The Application Programming Interface (API) of these platforms contributed heavily to their success.  Using APIs to easily link data is the foundation of how the internet works today.  Enterprise 2.0 platforms should provide a great user experience, enable third-party developers and empowers employees to accomplish their business objectives. This can be accomplished with an Enterprise 2.0 solution that leverages Web-Oriented Architecture (WOA) with open, standards-based, non-proprietary API implementations built on web-based RESTful architecture.

Enterprise 2.0: Top 10 Reasons NOT to Use WOA & APIs

  1. We have endless resources and enjoy spending extra money on integration.
  2. We like to spend our bonus money on infrastructure to support bloated code.
  3. We have no desire to support multiple devices.
  4. We have no plans to share information across multiple environments.
  5. We don’t want a platform that can be extended.
  6. We want to pay top dollar for things most get for free.
  7. We don’t support Standards because we enjoy watching our bug list grow.
  8. We believe code should be rigid and not reusable.
  9. We understand the benefits of WOA & APIs, but that’s not the way we do things here.
  10. We feel trendy when talking about OSGI bundles for the Enterprise Service Bus (ESB).

Data.Gov Demonstrates the Power of WOA and APIs

The next-generation Data.gov platform delivers a fantastic citizen experience, enables developers and empowers agencies to accomplish their mission.  See how this is accomplished in this video.

What Does It Mean to API-Enable Data.Gov?

The Web-Oriented Architecture (WOA) of Data.Gov offers an open, standards-based, non-proprietary API implementation built on web-based RESTful architecture. Learn more here [pdf].

Happy Fav Five Friday!

Favorite 5 Places

Forrester: SOA thriving; but interest in ESBs slips A new survey of 2,165 companies, compiled by a team led by Forrester Research’s Randy Heffner, finds that interest in service oriented architecture remains strong, despite today’s emphasis on cloud computing, mobile applications, and social networking …more

Enterprise 2.0 Roll-up: Welcoming Service Cloud 3 and iPad Remember when Chatter first came out? Salesforce.com’s CEO Marc Benioff couldn’t stop talking about how it was just like Facebook. This week that level of social functionality has been extended to Service Cloud 3, the newest iteration of the company’s social …more

5 recommendations for successfully implementing distributed innovation and shared value The real reason for distributed innovation is simply that you can no longer be self-sufficient. You must bring together more and better resources than you can hope to have inside a single organization. This means that distributed innovation models must address how … more

Becoming an Open Leader Two years ago I posted a short post that picked up from an HBR article on leadership flaws.  I posed the question if Enterprise 2.0 initiatives can thrive in environments where toxic leadership reigns.  My first reaction was no, and then I thought about ways to get to yes.  One of the flaws of flawed leadership is the lack of feedback — to gain self-awareness there is a problem in the first place.  Perhaps the feedback loop E2.0 cultures …more

#E2sday: How to Calculate the ROI of Enterprise 2.0 With enterprise social software platforms starting to gain widespread traction, ROI measurements are now becoming possible with early adopter communities. Many companies are looking for a detailed guide on how to measure the benefits of E2.0 …more [infographic]

How to Install Apache Tomcat Web App Server in 10 Minutes

How to Install Apache Tomcat on Mac OS X Snow Leopard

This tutorial will guide the user through the steps of installing Apache Tomcat on Mac OS X.

Prepare the Mac OS X to use the cURL command as Wget : Open a Terminal Window (Applications -> Utilities -> Terminal) and add wget as an alias for curl to the bash_profile file with the following command. Close the Terminal Window when complete.

Apache Tomcat Web App Server

Apache Tomcat is developed in an open and participatory environment and released under the Apache License version 2. Apache Tomcat is intended to be a collaboration of the best-of-breed developers from around the world. There is an open invitation to participate in this open development project. To learn more about getting involved, click here.

Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Some of these users and their stories are listed on the PoweredBy wiki page.  Learn more here.

Mac OS X Snow Leopard

Mac OS X is renowned for its simplicity, its reliability, and its ease of use. So when it came to designing Snow Leopard, Apple engineers had a single goal: to make a great thing even better.  Learn more here.

7 Steps for Installing Tomcat on Mac OS X

Open a Terminal Window and follow these seven steps to install and configure Tomcat on Mac OS X. Application developers can download Tomcat and configure it with various editors, but the method described here can save time and reduce mistakes. This method also supports remote installation. The steps described here, with a modification to step six, can be used to remotely install Tomcat on Unix based systems. This is helpful in “Cloud Computing” environments.

Apache Tomcat App Server Successfully Installed on Mac OS X

Open a web browser and navigate to http://localhost:8080 Application developers should see the main Tomcat page displayed in their web browser.

How to Access Tomcat Virtual Host Manager

Application developers should also configure authorization for the Tomcat Virtual Host Manager.

How to Access Tomcat Application Manager

Application developers should also configure authorization for the Tomcat Application Manager.

How to Configure Authorization for Tomcat Administrators

Go back to the Terminal Window and edit “tomcat/conf/tomcat-users.xml” to add roles and users to “tomcat-users” that can access the Tomcat Administrator areas.

Apache Tomcat Web Application Manager

Authorization has now been configured for the Tomcat Application Manager.

Apache Tomcat Virtual Host Manager

Authorization has now been configured for the Tomcat Virtual Host Manager

Tomcat Mac OS X Resources

The 80-20 Rule for Web 2.0 Architecture in the Enterprise

Enterprise 2.0 Cloud Computing & Service Oriented Architecture (SOA)

Integrating Internet Principals In Your Intranet

80-20-Service-Oriented-Architecture-SOA

You may of heard someone in your office say something like “20% of the people are doing 80% of the work”.  This is known as The Pareto Principle, aka the 80-20 Rule.  This principal will also apply to the future architecture of the internet composed of 80% Consumers and 20% Producers supported by “Linked Data”  This paradigm shift in information architecture will be fuled by the adoption of using widgets, gadgets, and apps to connect information.

Enterprise 2.0 App Stores

  • What if you had an Enterprise 2.0 App created from SharePoint?
  • What if you had an Enterprise 2.0 App for email?
  • What if you had Enterprise 2.0 Apps for your team blog, wiki, graphs, activity streams, …?
  • What if all these apps were displayed as Widgets in your Enterprise 2.0 Dashboard?

Why would you log into all these different areas, when you can see what you want, how you want in a single place.  Navigating to multiple places is time consuming, even with Single Sign On (SSO) solutions in place.  Most Enterprise 2.0 Apps, Widgets, and Gadgets can be created with common web programming languages.  These web programming languages can be as simple as standard HTML, CSS, and JavaScript.  These User Interfaces can easily leverage AJAX and other Web 2.0 Technologies to enhance the User Experience.  The extra benefits of using these standard technologies is lower development cost, shorter time to deployment, and better support across multiple devices such as smart phones, iPads, and standard tablets.

Enterprise 2.0 App Store Architecture

Most organizations have a difficult time measuring the use of their Information Technology.  Some organizations can measure enough to know that moving at least some technology to the cloud makes sense.  Businesses can also realize the benefits from the concept of cloud computing through Enterprise 2.0 App Store Architecture.

What is an Enterprise 2.0 App?

An Enterprise 2.0 App is “a snippet of code that is shared to serve a specific purpose”.  This “App” can be displayed and used on smart phones, mobile devices, desktops, web browsers, dashboards, or other applications.

Where is the App Stored?

Apps can be stored internally or externally.

Internal Apps, Widgets, & Gadgets

Internal apps are hosted and used by the owner, usually in the same domain, therefore the level of trust is higher.

External Apps, Widgets, & Gadgets

External apps are hosted outside the domain and usually by a third party.  The level of trust is lower, therefore the proper security measures should taken.  All developers should know how to build, design and test the security of web applications and web services.

Using a Web Proxy

All modern web browsers impose a security restriction on network connections, which includes calls to XMLHttpRequest. This restriction prevents a script or application from making a connection to any web server other than the one the web page originally came from (Internet Explorer will allow cross-domain requests if the option has been enabled in the preferences). If both your web application and the XML data that application uses come directly from the same server, then you do not run into this restriction.  See the PHP Web Proxy code below and learn more about AJAX Web Proxies here.

<?php
// PHP Proxy example for Yahoo! Web services.
// Responds to both HTTP GET and POST requests
//
// Author: Jason Levitt
// December 7th, 2005
//

// Allowed hostname (api.local and api.travel are also possible here)
define (‘HOSTNAME’, ‘http://search.yahooapis.com/’);

// Get the REST call path from the AJAX application
// Is it a POST or a GET?
$path = ($_POST[‘yws_path’]) ? $_POST[‘yws_path’] : $_GET[‘yws_path’];
$url = HOSTNAME.$path;

// Open the Curl session
$session = curl_init($url);

// If it’s a POST, put the POST data in the body
if ($_POST[‘yws_path’]) {
$postvars = ”;
while ($element = current($_POST)) {
$postvars .= urlencode(key($_POST)).’=’.urlencode($element).’&';
next($_POST);
}
curl_setopt ($session, CURLOPT_POST, true);
curl_setopt ($session, CURLOPT_POSTFIELDS, $postvars);
}

// Don’t return HTTP headers. Do return the contents of the call
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

// Make the call
$xml = curl_exec($session);

// The web service returns XML. Set the Content-Type appropriately
header(“Content-Type: text/xml”);

echo $xml;
curl_close($session);

?>

You should also see this article: “Restricting Access to your AJAX Services“.

Open Source to the Rescue!

Open Source Libraries and Frameworks to Support Enterprise 2.0  Apps, Widgets, & Gadgets

Creating Enterprise 2.0 Apps, Widgets, and Gadgets can be less time consuming with these free open source libraries and frameworks.

jMaki

jMaki is a lightweight client/server framework for creating JavaScript centric Web 2.0 applications using CSS layouts, widgets widget model, client services such as publish/subscribe events to tie widgets together, JavaScript action handlers, and a generic proxy to interact with external RESTful web services. While jMaki abstracts much of the JavaScript and CSS by providing defaults for widgets, the JavaScript widgets and CSS are made easily accessible so they may be customized by a designer or page developer. jMaki focuses on the aspects of delivering JavaScript to the client allowing the JavaScript to communicate to various server-technologies including PHP, Java (JSP/JSF), and Phobos in a server-technology neutral way. Learn more here.

jmaki-architecture

Google Web Toolkit (GWT)

Google Web Toolkit (GWT) is a development toolkit for building and optimizing complex browser-based applications. Its goal is to enable productive development of high-performance web applications without the developer having to be an expert in browser quirks, XMLHttpRequest, and JavaScript. GWT is used by many products at Google, including Google Wave and the new version of AdWords. It’s open source, completely free, and used by thousands of developers around the world. Learn more here.

Screen shot 2011-01-14 at 2.52.57 AM