Issue

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

Environment

Zend Server 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:

Zend Server 2020.x and higher:

/www/zendphp74/conf/httpd.conf 

These lines define the default virtual host:

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

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

/usr/local/zendphp74/etc/sites.d/zend-default-vhost-10100.conf 

The contents of the include file look like this:

Include /usr/local/zendphp74/etc/sites.d/http/__default__/0/*.conf <
Directory '/usr/local/zendphp74/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/zendphp74/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/zendphp74/etc/sites.d/http/__default__/0/98_samples.conf

Here are the contents of that file:


Alias /samples '/usr/local/zendphp74/var/apps/http/__default__/0/samples/1.0_16/'
<Directory '/usr/local/zendphp74/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/zendphp74/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.

For applications deployed to other deployed virtual hosts, the vhost configuration can be found in the
/usr/local/zendphp74/etc/sites.d/ directory, as defined by the include statement:
Include /usr/local/zendphp74/etc/sites.d/vhost_*.conf

Zend Server 9.1.x, Zend Server 2018.x and Zend Server 2019.x:  

** The default VirtualHost port of 10090 may be 10080 for your installation if this version of Zend Server was installed when no earlier version was present. 

/www/zendphp7/conf/httpd.conf 

These lines define the default virtual host:

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

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

/usr/local/zendphp7/etc/sites.d/zend-default-vhost-10090.conf 

The contents of the include file look like this:

Include /usr/local/zendphp7/etc/sites.d/http/__default__/0/*.conf <
Directory '/usr/local/zendphp7/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/zendphp7/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/zendphp7/etc/sites.d/http/__default__/0/98_samples.conf

Here are the contents of that file:


Alias /samples '/usr/local/zendphp7/var/apps/http/__default__/0/samples/1.0_16/'
<Directory '/usr/local/zendphp7/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/zendphp7/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.

For applications deployed to other deployed virtual hosts, the vhost configuration can be found in the
/usr/local/zendphp7/etc/sites.d/ directory, as defined by the include statement:
Include /usr/local/zendphp7/etc/sites.d/vhost_*.conf

Zend Server 6 - 8.5x 

/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/zendsvr6var/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.

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