The following procedure describes how to configure Zend Server to run Zend Framework projects in a development environment, using port-based virtual hosts. The advantage of port-based virtual hosts is in the ease of running several isolated applications on the same Web server. This overall solution allows developers working on a Zend Framework project in Zend Studio to immediately test any code changes locally.
The following procedure uses instructions suitable
for Zend Studio for Eclipse and the Apache bundled with Zend Server. A
similar procedure with some modifications can apply for other IDEs and
web servers.
|
|
To configure Zend Server to run a Zend Framework application:
Listen 10089 < VirtualHost *:10089> DocumentRoot " DOCUMENT_ROOT" <Directory "DOCUMENT_ROOT"> Order allow,deny Allow from all AllowOverride all </Directory> </VirtualHost>
# public/.htaccess RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /index.php [NC,L] Note: Some web servers may ignore .htaccess files unless otherwise configured. Make sure that your web server is configured to read the .htaccess file in your public directory.
|
|
Your Zend Framework projects will now be accessible from a browser through: http://localhost:10089/ (the port number 10089 should be replaced with the unique port you dedicated to this virtual host). |
Apache uses a main configuration file for all its settings, typically this file is called httpd.conf or apache2.conf. The location of this file varies depending on your installation:
Windows:
<install_dir>\Apache2.2\conf\httpd.conf
If you changed the location
of your Zend Server installation,
your document root will be located at <installation_directory>\
Apache2.2\conf\httod.conf, where <installation_directory> is
the location of the directory in which Zend Server is
installed.
Linux:
If you installed Zend Server from
a repository (DEB or RPM packages), the location of your configuration
file is defined by your distribution's Apache packages, and will vary
depending on your distribution and configuration.
Common locations include:
Debian / Ubuntu - /etc/apache2/apache2.conf
Fedora Core / RHEL / CentOS - /etc/httpd/httpd.conf
If you installed Zend Server using the generic Tarball package - /usr/local/ zend /apache2/conf/httpd.conf.
If you changed the location of your Zend Server installation, your document root will be located at <installation_directory>/ apache2/conf/httpd.conf, where <installation_directory> is the location of the directory in which Zend Server is installed.
|
|
|
Related Links: Working with Zend Frameworkhttp://framework.zend.com - external link http://framework.zend.com - external link |
|
|