Hosting a site made with the conventional Zend Framework Structure on a Shared Host without virtual Hosting Support

Author Moses Ndiritu 06/01/2010

Intended for developers and server administrators

When using a shared host that does not provide virtual hosting services, it is still possible to host a ZF application made following the conventional folder layout as shown below.

Zf_Project.png

 

The public folder represents the www or the public_html or public folder on the available to a site to hold the htdocs. This folder would contain the index.php file and the folder css, images and js for storing stylesheet, images and javascript files respectively. Notice the application and the library folders should be on the same level with the public_html folder.

Example_site.png

The diagram above shows a typical hosting site which on the Internet may be accessed as www.viskenya.com but on the filesystem is accessible as /home/username/public_html/.

For the main site, the application and library folders should be put on the same level ie /home/username as the public_html or www or inetpub folder and not within it.

ZF_hosted.png

 

 

Notice that the application and the library folders are on the same level (/home/username) as the www or the public_html folder that holds the htdocs.


Hosting subdomains with ZF structure

To host subdomains with the ZF structure, the sub domains are created in the htdocs folder (public_html or www or inetpub). Suppose on the site www.viskenya.com we also want to host the sub domain www.epar.viskenya.com. The application and the library folders of the sub domain cannot be placed in the htdocs folder for security reasons. They can also not be placed on the same level as the application and library folders of the main site. However, the site folder epar containing the ZF application can be placed on the same level as the application and library folder of the main site and the public_html folder. Symbolic links of the public folder in the epar folder can then be created in the subdomain folder inside the public_html folder.


Main site with a single sub domain

Site_with_subdomains.png