3

I'm building a Zend website.The project (local) has the following structure:

/app
  /controllers
  /views

  /public
   /css
   /images
   /js
   .htaccess
   index.php

Because the .htaccess and index.php files reside within th public directory,the public directory must be identifiable by apache as the website's document root and root directory.

So I should go to edit the "DocumentRoot from c:/wamp/www/ to c:/wamp/www/my-zend-app/public" inside the httpd.conf file. But if I do so I can't reach my other projects inside "c:/wamp/www/".. can I keep both the documentRoots?

EDIT I tried with uncommenting the httpd.conf line about "httpd-vhost.conf" and edited the file:

[httpd-vhost.conf]

<VirtualHost *:80>
ServerAdmin webmaster@dum.com
DocumentRoot "C:\wamp\www\my-zend-app\application\public"
ServerName website.loc
ErrorLog "C:\wamp\www\my-zend-app\application\public\error.log"
CustomLog "C:\wamp\www\my-zend-app\application\access.log" common
</VirtualHost>

right after edited the windows hosts file adding:

127.0.0.1 website.loc

but it's not working.I'm running WAMPSERVER 2.1

Dmitry Pashkevich
  • 13,431
  • 9
  • 55
  • 73
luca
  • 36,606
  • 27
  • 86
  • 125
  • Use an [Alias](http://httpd.apache.org/docs/2.0/mod/mod_alias.html) if you need a root lower down. – Orbling Oct 11 '11 at 14:02

2 Answers2

3

Add a <Directory> Directive to your <VirtualHost> directive for the new document root

<VirtualHost *:80>
    ...
    <Directory "C:/wamp/www/my-zend-app/application/public">
        Options Includes Indexes FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
jah
  • 2,056
  • 1
  • 18
  • 35
0

Create a second virtual host using a different port or using ServerName (and editing hosts file to resolve locally.

The easier one is just using different virtual hosts on different ports but remember also adding Listen yourPort on the main config to make apache listen that port too.

frisco
  • 1,897
  • 2
  • 21
  • 29