Tag Archives: apache

A little bit of magic from Adobe PhoneGap: instant app preview on a device

Adobe has released an update to its PhoneGap tools (build mobile apps using HTML and Javascript) which enabled instant preview on a device. You don’t need to compile and deploy; it is enough simply to save your changes using a text editor, and the running app preview on the connected device will refresh.

I tried a quick demo on Windows 8. PhoneGap installation or update is easy since it uses the node.js package manager: open a node command line and type npm install –g phonegap.

I had to update the Android SDK to version 19, which was the usual tedious update using the Android SDK Manager, but also worked smoothly.

Then I created a PhoneGap app and ran it in the emulator. So far so goo.

Next, I went to an Android phone and installed the PhoneGap Developer App.

image

Back on the PC, I started the built-in web server that serves the app refreshes to the device. Simply navigate to the app folder in the node command line and type: phonegap serve

Then on the device I ran the PhoneGap Developer App, and connected to the PhoneGap development server (IP no and port). The app preview appeared on the phone.

I then used Notepad to change the app home page slightly. Saved. The app preview refreshed almost instantly.

image

Here it is on the device:

image

A cool feature, though with some limitations. See Raymond Camden’s post for a few more details.

Currently iOS and Android are supported, with Windows Phone coming soon.

Adobe’s Roy Fielding patches Apache to ignore IE10 Do Not Track privacy request

Adobe’s Roy Fielding, who is also the original author of the W3C’s Tracking Preference Expression draft, has patched Apache, the open source web server, to ignore the Do Not Track header sent by Microsoft’s Internet Explorer 10, the browser in Windows 8:

image

Under the heading “Apache does not tolerate deliberate abuse of open standards,” Fielding’s patch sets Apache to remove the Do Not Track request header if IE10 is the web browser.

Fielding’s argument, one presumes, is that IE10 breaches clause three in the Tracking Preference Expression draft:

Key to that notion of expression is that it must reflect the user’s preference, not the choice of some vendor, institution, or network-imposed mechanism outside the user’s control. The basic principle is that a tracking preference expression is only transmitted when it reflects a deliberate choice by the user. In the absence of user choice, there is no tracking preference expressed.

However the document goes on to say (highlighting is mine):

We do not specify how tracking preference choices are offered to the user or how the preference is enabled: each implementation is responsible for determining the user experience by which a tracking preference is enabled. For example, a user might select a check-box in their user agent’s configuration, install an extension or add-on that is specifically designed to add a tracking preference expression, or make a choice for privacy that then implicitly includes a tracking preference (e.g., Privacy settings: high). The user-agent might ask the user for their preference during startup, perhaps on first use or after an update adds the tracking protection feature. Likewise, a user might install or configure a proxy to add the expression to their own outgoing requests.

Here is what happens in Windows 8 after startup. This is among the first screens you see when installing Windows 8, before you get full access to the operating system:

image

One of the settings specified is “Turn on Do Not Track in Internet Explorer. If you click Learn more about express settings you get this:

image

If you click Customize you get this:

image

Does this respect the user’s preference? It seems to me a reasonable effort. The only objection I can see is if you consider that any user agent that defaults to setting Do Not Track on cannot be respecting the user’s preference. The draft specification does not state what the default should be.

It is also worth noting that clause 3 in the Tracking Preference Expression draft has changed; the wording about “not the choice of some vendor” was inserted in the 7th September draft, after Windows 8 was released to manufacturing. Here it is in the latest (March 2012) W3C Working draft:

Key to that notion of expression is that it must reflect the user’s preference, not the preference of some institutional or network-imposed mechanism…

Even if you agree with Fielding’s views on browser defaults, quietly patching the world’s most used web server to ignore the IE10 setting looks hard to defend, especially on a matter that is far from clear cut. Fielding is personally involved, not only as the author of the Tracking Preference Expression document, but also as an employee of Adobe, which specialises in digital marketing and may be more aligned with the vendors and their brands which may want to track user activity wherever their ads appear, rather than with end users.

Of course Apache is an open source project and Fielding’s patch has attracted the attention of the Apache community and may not survive.

It is also possible that a future draft of the Tracking Preference Expression document will state that Do Not Track must be off by default; but even if it does, patching the web server to ignore the browser’s header strikes me as a contentious solution.

Finally, it is worth noting that sending the Do Not Track header has little effect on whether or not your activity is tracked, since its meaning is unclear and respecting its value is a a choice made by third-parties, so this is a debate with little practical impact for the time being.

PhoneGap is Adobe, Cordova is Apache

The hot cross-platform mobile toolkit PhoneGap was created by Nitobi, a company acquired by Adobe last year. Almost at the same time, the project was submitted to Apache as an open source project. However, the Apache project is not called PhoneGap; it was briefly known as Callback and is now called Cordova (the name of the street in Vancouver where Nitobi was based).

A new official log post explains why PhoneGap was renamed at Apache, but also makes the point that the PhoneGap brand will continue.

PhoneGap is a distribution of Apache Cordova. You can think of Apache Cordova as the engine that powers PhoneGap, similar to how WebKit is the engine that powers Chrome or Safari. (Browser geeks, please allow me the affordance of this analogy and I’ll buy you a beer later.)

Over time, the PhoneGap distribution may contain additional tools that tie into other Adobe services, which would not be appropriate for an Apache project. For example, PhoneGap Build and Adobe Shadow together make a whole lot of strategic sense. PhoneGap will always remain free, open source software and will always be a free distribution of Apache Cordova.

Read it carefully, because it is still potentially confusing. Note that PhoneGap “will always remain free, open source software” though it may gain hooks into commercial Adobe tools. At least, that is how I read it.

I would also expect that Adobe will come up with design and development tools for which PhoneGap (or Cordova) is invisible to the user. You will just be able to build for multiple platforms.

The post adds:

Currently, the only difference is in the name of the download package and will remain so for some time.

I will add that there is great brand-awareness of PhoneGap and what it is, and little for Cordova, so if you want to be understood talk about PhoneGap.

PhoneGap likely to move to Apache Software Foundation

Nitobi’s Brian LeRoux, who works on PhoneGap, has announced the start of a process to move the project to the Apache Software Foundation:

We have initialized the process to contribute PhoneGap to the Apache Software Foundation (ASF). The process is straightforward beginning w/ a submission of a proposal to the ASF that describes the move in detail. We’ve been looking at different options for a foundation contribution since the beginning. Now is the time. PhoneGap is hugely adopted and the IP belongs in an org aligned w/ our goals, philosophy and the web. It will remain free software, licensed as it always has been: Apache/BSD/MIT.

Apparently the name may change thanks to a trademark dispute.

PhoneGap seems to have plenty of momentum and is turning up in a variety of tools, including Adobe DreamWeaver and Embarcadero RAD PHP XE2, to mention two I am aware of.

OpenOffice moving to Apache; next step reunification with LibreOffice

Oracle has announced that it is contributing the OpenOffice.org code, the source for the free productivity suite that competes with Microsoft Office, to the Apache Software Foundation’s Incubator:

Incubation is the first step for a project to be considered among the diverse Open Source initiatives overseen by the ASF. A submitted project and its community will join the more than 50 projects in the Apache Incubator, and will benefit from the Foundation’s widely-emulated meritocratic process, stewardship, outreach, support, community events, and guiding principles that are affectionately known as "The Apache Way".

Everybody love the Apache Foundation so this is good news for the future of the project, though the Document Foundation, formed by renegade OpenOffice.org contributors fed up with Oracle’s stewardship, says the event is neutral from their perspective. The Document Foundation welcomes the ability to reuse code that will now but under the Apache License, but adds:

The Document Foundation would welcome the reuniting of the OpenOffice.org and LibreOffice projects into a single community of equals in the wake of the departure of Oracle. The step Oracle has taken today was no doubt taken in good faith, but does not appear to directly achieve this goal. The Apache community, which we respect enormously, has very different expectations and norms – licensing, membership and more – to the existing OpenOffice.org and LibreOffice projects. We regret the missed opportunity but are committed to working with all active community members to devise the best possible future for LibreOffice and OpenOffice.org.

It seems inevitable that the two projects will be reunited, and it seems that dialogue has already begun:

TDF is therefore willing to start talking with Apache Software Foundation, following the email from ASF President Jim Jagielski, who is anticipating frequent contacts between the Apache Software Foundation and The Document Foundation over the next few months.

A curious story, but one that seems likely to end in a good way. IBM, which is a big supporter of the ODF XML document formats used in OpenOffice, is welcoming the move:

Over the long-term, we plan to work with other Apache contributors to extend the vision of productivity beyond documents. We are learning much more about the semantic web through our additional work on LotusLive Symphony, and the vision in the research and lab teams has to extend productivity into new realms. Meanwhile, the Apache community can be expected to accelerate adoption of ODF as a primary set of document formats, and to drive ODF compatibility in other products and solutions in the future.

says Ed Brill. It is good to read about new approaches to productivity, because this has been a weakness in OpenOffice which is sometimes perceived a a kind of inferior-but-free equivalent to Microsoft Office. In the meantime, Microsoft has worked to make its own suite more distinctive, to defend a territory that accounts for a significant share of its profits. The ribbon user interface is part of that strategy, but more significant is its integration with SharePoint, and the emergence of Office Open XML as a unifying format for editing documents in desktop Office and within the browser using Office Web Apps.

Unifying the open source teams behind OpenOffice and getting it away from Oracle are both important steps towards making the project more compelling.

Accelerating PHP with the Alternative PHP Cache

I decided to install the open source Alternative PHP Cache on this server in order to improve performance. Interesting exercise. This server runs Debian Linux, and there are several ways to install APC:

1. Install the official package with apt-get install php-apc or similar

2. Install with the PHP Extension Community Library which goes something like:

apt-get install apache2
apt-get install libapache2-mod-php5
apt-get install php-pear
apt-get install php5-dev
apt-get install make
apt-get install apache2-prefork-dev
pecl install apc

The advantage over (1) is that you get the latest stable build, version 3.1.6, instead of the Debian package which is 3.0.19

3. Download the source and do something like this to install.

I started with option (2) though I came to regret it. The first problem is that the pecl installer will build with your currently-installed Apache, and if you later upgrade Apache it might break. Sticking with the official package is safer, even though it is very out of date.

I could live with the idea of re-installing APC every time Apache was updated if necessary, but I had another problem. I was up and running with APC 3.1.6 and pleased with the results, until after a while everything stopped working and my blog became a screen full of messages saying “Unable to allocate memory for pool”.

It looks like this bug, which was said to be fixed in version 3.1.5, but if you look to the end of the comments there is one from today with the same issue, and no suggestions about how to fix it.

The ancient version, on the other hand, has performed perfectly so far.

Another point of interest: I found it challenging to discover the best settings for APC. By default the install does no more than to enable the extension; but the default setting is unlikely to be the best one. The documentation tells you what each setting does, but not how to choose the best values for those settings. Should the cache be the default 32MB, or something much greater? Another thing to note: if you compile with MMAP support, which is the default, the value of apc.shm_segments is ignored, and the value in apc.shm_size will solely determine the size of the cache.

I found this Moodle article on installing APC in Windows helpful. What you do is first to find the file apc.php which the install put somewhere like /usr/share/doc/php-apc – in my case it was also compressed -  and put this on your website, preferably in a password-protected folder. This tells you the status of the cache. The aim is to have the cache just big enough that it does not become full and highly fragmented. Here is what I get after a short run with 128MB, which may be a little too much:

image

Another tip is to set apc.stat to 0. This means APC will not check for changes in PHP files since they were last compiled and cached. The downside is that every time you change a file you have to restart the web server; but the benefit is better performance, which is the goal after all.

nginx market share growing faster than any other web server

According to the latest netcraft web survey nginx market share is growing faster than that of any other web server, even though it is still small relative to Apache or Microsoft IIS. In December 2010 nginx share grew by 0.88% to 7.5% – which can also be expressed as a 13.3% increase.

Apache 59.13%
Microsoft 21.00%
nginx 7.50%
Google 5.53%
lighttpd 0.68%

I did not take much notice of nginx until hearing Ryan Dahl evangelise it at Cloudstock, a Dreamforce event, last month. Now I plan to install it at itwriting.com when I find the time.