I have tested it on Linux Mint to create virtual host for setting up a Zend Framework application. It should also work on Ubuntu and Debian based distro-
1. Edit the httpd.conf using the following command on terminal-
$ sudo gedit /etc/apache2/httpd.conf
Add the following line to this file
N.B. : Replace PlayWithZend.com to your desired host name.
<VirtualHost *:80>
ServerName PlayWithZend.com
DocumentRoot /var/www/playwithzend/public # application public directory
SetEnv APPLICATION_ENV "development"
<Directory /var/www/playwithzend/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
2. Edit the httpd.conf using the following command on terminal-
$ sudo gedit /etc/hosts
Add the following line to this file-
127.0.0.1 PlayWithZend.com # Your Virtual host name
3. Open your terminal and write one by one -
$ sudo a2enmod rewrite
$ sudo updatedb
$ cd /etc/apache2/mods-enabled
$ touch rewrite.load
$ sudo gedit rewrite.load
If you dont get the following line in your editor then add it-
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
4. Restart your apache-
$ sudo /etc/init.d/apache2 restart
Open up PlayWithZend.com(your hostname here) and see the boom