Deployment with Zend Studio 10 Beta and Zend Server 6 Beta

Sick on a Sunday and it’s cold and wet outside..no better time to dig into some new technology.

My goal was to setup a mobile application in Zend Studio 10 beta using their built-in tools. It is advertised that this can be done in 10 minutes or less with Zend Studio. I began by reading the infomation on the Zend website and then watching the tutorial videos below. I planned on using a local install of Zend Server 6 beta instead of the Zend cloud mentioned in many of the tutorials.

Local setup:

  • MacBook Pro running OS X 10.7.5
  • Default install of Zend Studio 10 beta
  • Default install of Zend Server 6 beta

Application Setup:

  • Mobile Application Name: cold-sunday-mobile
  • REST Application Name: cold-sunday-rest

Reference Sites:

I thought I’d take a peek into the new Zend Studio 10 beta mobile features and found myself delving into the deployment process. Watching some videos online, I thought I’d spend 20 minutes replicating a demo and then start adding my own features. Six hours later, with a couple of bald spots on my head from pulling out my hair, I was debugging .htaccess rules and writing my own virtual hosts to compare the deployed processes to my own.

Creating the mobile and REST applications with the creation tools in Zend Studio 10 beta (ZS10b) was a snap. Zend Server 6 Beta (ZS6b) and Zend Studio are integrated well and that makes the deployment process quite easy. ZS10b detected my local install of ZS6b and created a deploment target and uploaded my files to the server. The next step in the tutorial is to test one of your mobile routes (testing that the front end mobile app can talk to the back end REST app) and that is where my issues began. The server was returning 404 errors from the REST application.

Some digging into the deployment process showed the following defaults:

When the application is deployed:

  • deployed applications are routed through port 10088
  • the deployed files are uploaded into /usr/local/zend/var/apps/http/__default__/0 and
  • a .conf file is created in /usr/local/zend/etc/sites.d/http/__default__/0 that contains a vHost for the application. In this vHost an alias is created to the uploaded files (in /usr/local/zend/var/apps/http/__default__/0).

This makes your application available at:

http://<server-address>:10088/application-name/

and in my case it was available at:

http://localhost:10088/cold-sunday-rest/

This was loading fine for me in a browser with a json response of  {“error”:”No matching route found.”} <–this is not an error as there is no route defined in the sample application for the index route.

The issue was in the passing of the sample service (customers) to the application (http://localhost:10088/cold-sunday-rest/customers), I was getting the 404 mentioned above. After a LOT of digging, I figured out that the conf file vHost that’s created in /usr/local/zend/etc/sites.d/http/__default__/0 was missing a line. Something that I found common in my other Zend vHosts. I needed to add the line “AllowOverride all” to get the action part of the url to route.

Here’s how it looks after the change:

Alias /milton-rest "/usr/local/zend/var/apps/http/__default__/0/milton-rest/1.0.0/public/"
# This is needed to work-around configuration problem in SLES
<Directory "/usr/local/zend/var/apps/http/__default__/0/milton-rest/1.0.0/public/">
Options +Indexes
DirectoryIndex index.php
Order allow,deny
Allow from all
AllowOverride all
</Directory>

That’s the gist of it, but there are other issues. Secondary deployments of my application from ZS10b resulted in error. The solution was to delete the application in the Zend Server 6 beta interface for applications (http://localhost:10081/ZendServer/Deployment/). When you do this, you WILL HAVE TO add the AllowOverride all to your conf file again.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top