Deployed application content is not found in htdocs. Where is it?

Follow

Issue

When an application is deployed, the content is not found in a subdirectory of /www/zendsvr6/htdocs.  Instead, an Alias directive is used to define the content directory.  This article tells how to find that content.

Environment

Zend Server 6 or 7 for IBM i, running on any supported version of IBM i.

Resolution

This example uses the IBM i Samples application that is installed using these instructions:

Install the Samples Application in Zend Server for IBM i

When the application is deployed the content goes to a directory based on the Virtual Host configuration. The Samples application was installed to the default virtual host. To find it, we can start by looking at the Apache configuration file for Zend Server:

/www/zendsvr6/conf/httpd.conf 

These lines define the default virtual host:

<VirtualHost *:10080>
Include /usr/local/zendsvr6/etc/sites.d/zend-default-vhost-10080.conf
</VirtualHost>

Notice that most of the definition is found in this include file:

/usr/local/zendsvr6/etc/sites.d/zend-default-vhost-10080.conf 

The contents of the include file look like this:

Include /usr/local/zendsvr6/etc/sites.d/http/__default__/0/*.conf <
Directory '/usr/local/zendsvr6/data/apps/http/__default__/0/'>
Allow From All
</Directory>

Note: for applications deployed to other virtual hosts rather than the default, see the note at the end of the article.

Each application deployed to this virtual host will have a configuration file in this directory:

/usr/local/zendsvr6/etc/sites.d/http/__default__/0/ 

The configuration files will all have the '.conf' prefix, and will be picked up by the include of '*.conf'.

For the Samples application, the configuration file is named something like this:

/usr/local/zendsvr6/etc/sites.d/http/__default__/0/98_samples.conf 

Here are the contents of that file:

    Alias /samples '/usr/local/zendsvr6/var/apps/http/__default__/0/samples/1.0_16/'
<Directory '/usr/local/zendsvr6/var/apps/http/__default__/0/samples/1.0_16/'>
AllowOverride All
Options +Indexes +FollowSymLinks
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory>

The Alias and Directory directives tell us the directory where content for the Samples application can be found:

/usr/local/zendsvr6/var/apps/http/__default__/0/samples/1.0_16/     

It is useful to know where the application content is deployed, and in the case of an example application like the Samples application it can be useful to examine the code. However, it is not recommended to make changes to a deployed application by making code changes to the content in this location. Such changes would be lost if an update to the application is deployed. Instead, the changes are made in the source on the machine where the application is developed and tested, and then packaged and deployed as an update.

Note:  For applications deployed to other deployed virtual hosts, the vhost configuration can be found in the
/usr/local/zendsvr6/etc/sites.d/ directory, as defined by the include statement:
Include /usr/local/zendsvr6/etc/sites.d/vhost_*.conf
Have more questions? Submit a request

Comments

Powered by Zendesk