title: Virtual Host is not working in Zend Framework after multiple tries at fixing things
body: <p>In both the sites-available and sites-enabled folders, I have a conf file called "zend-framework.conf".  This is what I have contained in the file.</p>
  
  <pre><code> &lt;VirtualHost *:80&gt;
       # The ServerName directive sets the request scheme, hostname and port that
       # the server uses to identify itself. This is used when creating
       # redirection URLs. In the context of virtual hosts, the ServerName
       # specifies what hostname must appear in the request's Host: header to
       # match this virtual host. For the default virtual host (this file) this
       # value is not decisive as it is used as a last resort host regardless.
       # However, you must set it for any further virtual host explicitly.
       ServerName zendlocalhost
       ServerAlias zendlocalhost
       ServerAdmin root@localhost
       DocumentRoot /var/www/zend-framework/public
       SetEnv APPLICATION_ENV "development"
       &lt;Directory /var/www/zend-framework/public&gt;
           DirectoryIndex index.php
           AllowOverride All
           Order allow,deny
           Allow from All
       &lt;/Directory&gt;
  
       # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
       # error, crit, alert, emerg.
       # It is also possible to configure the loglevel for particular
       # modules, e.g.
       #LogLevel info ssl:warn
  
       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog ${APACHE_LOG_DIR}/access.log combined
  
       # For most configuration files from conf-available/, which are
       # enabled or disabled at a global level, it is possible to
       # include a line for only one particular virtual host. For example the
       # following line enables the CGI configuration for this host only
       # after it has been globally disabled with "a2disconf".
       #Include conf-available/serve-cgi-bin.conf 
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p># vim: syntax=apache ts=4 sw=4 sts=4 sr noet</p>
  
  <p>This is what I have in my etc/hosts file</p>
  
  <pre><code>127.0.0.1   localhost
  #127.0.1.1  lazerorca-iMac
  127.0.0.1   zendlocalhost
  
  # The following lines are desirable for IPv6 capable hosts
  ::1     ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  </code></pre>
  
  <p>This is what I have in my ports.conf file.  I get a message saying that NameVirtualHost *:80 is going to be deprecated in a later version.  I tried adding that only because I saw it in another question</p>
  
  <pre><code># If you just change the port or add more ports here, you will likely also
  # have to change the VirtualHost statement in
  # /etc/apache2/sites-enabled/000-default.conf
  
  Listen 80
  
  &lt;IfModule ssl_module&gt;
   Listen 443
  &lt;/IfModule&gt;
  
  &lt;IfModule mod_gnutls.c&gt;
   Listen 443
  &lt;/IfModule&gt;
  
  NameVirtualHost *:80
  
  # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  </code></pre>
  
  <p>This is the error I get when I go to <code>http://zendlocalhost</code></p>
  
  <blockquote>
    <p>Internal Server Error</p>
    
    <p>The server encountered an internal error or misconfiguration and was
    unable to complete your request.</p>
    
    <p>Please contact the server administrator at root@localhost to inform
    them of the time this error occurred, and the actions you performed
    just before this error.</p>
    
    <p>More information about this error may be available in the server error
    log.</p>
  </blockquote>
  
  <p>This is what access.log says</p>
  
  <blockquote>
    <p>127.0.0.1 - - [16/Dec/2014:15:05:22 -0500] "GET / HTTP/1.1" 500 798 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:35.0) Gecko/20100101
    Firefox/35.0"</p>
  </blockquote>
  
  <p>This is what the error.log says</p>
  
  <blockquote>
    <p>[Tue Dec 16 15:25:20.271792 2014] [core:alert] [pid 4825] [client
    127.0.0.1:60826] /var/www/zend-framework/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not
    included in the server configuration</p>
  </blockquote>
  
  <p>I check the .htaccess file and it looks ok to me, but evidently it isn't.  here is what is in the .htaccess file</p>
  
  <pre><code>RewriteEngine On
  # The following rule tells Apache that if the requested filename
  # exists, simply serve it.
  RewriteCond %{REQUEST_FILENAME} -s [OR]
  RewriteCond %{REQUEST_FILENAME} -l [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [NC,L]
  # The following rewrites all other queries to index.php. The 
  # condition ensures that if you are using Apache aliases to do
  # mass virtual hosting, the base path will be prepended to 
  # allow proper resolution of the index.php file; it will work
  # in non-aliased environments as well, providing a safe, one-size 
  # fits all solution.
  RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
  RewriteRule ^(.*) - [E=BASE:%1]
  RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
  </code></pre>
  
  <p>Interestingly enough if I go to <code>http://zendlocalhost/phpmyadmin</code> it pulls up
  If I go to 127.0.0.1, it pulls up the generic Ubuntu apache index.html file
  I am very new to Zend as in this is my first time trying it out.  i know there are some crazy URL rewriting and such.  I would have thought going to the root address would have pulled up the index.php file.</p>
  
  <p>Thanks in advance for your help</p>