MartinJJ
MartinJJ

Reputation: 347

Server set up of project with vhosts config

Zend framework is new to me and I'm working from a book so I can get a rudimentary grasp of things (book is Zend Framework A Beginners Guide).

I have my project set up and have created it in a folder called "test"

I have also added a vhost, vhosts file contains:

<VirtualHost *:80>
   DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/test/public"
   ServerName .localtest

   # This should be omitted in the production environment
   SetEnv APPLICATION_ENV development

   <Directory "C:/Program Files/Zend/Apache2/htdocs/test/public">
       DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>

I have called the vhosts file from within apaches conf file

I have also added a line to system32 hosts file:

127.0.0.1 test.localtest

My problem is that when I browse to http://test.localtest/ I get the zend server test page, when as from what I am reading I should be getting the Zend Framework projects Main Page splash, this I can reach by browsing to http://test.localtest/test/public/

Am I missing something?

Upvotes: 1

Views: 968

Answers (2)

RockyFord
RockyFord

Reputation: 8519

one thing most everyone misses is that Zf needs FollowSymlinks to work most of the time.

this is the directory definition I usually use in my vhosts

<directory "C:\www\project">
    Options Indexes FollowSymlinks
    AllowOverride all
    Order Deny,Allow
    Allow from all
</directory>

not sure how DirectoryIndex will affect this.

make sure mod_rewrite is enabled in Apache:

LoadModule rewrite_module modules/mod_rewrite.so //make sure this line is uncommented httpd.conf

make vhosts is enabled in apache:

Include conf/extra/httpd-vhosts.conf //make sure this line is uncommented httpd.conf

make sure this line is present in your vhosts file usually above the vhosts definitions:

NameVirtualHost *:80

Upvotes: 2

Iori
Iori

Reputation: 660

Try changing

<VirtualHost *:80>
   DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/test/public"
   ServerName .localtest

to

<VirtualHost *:80>
   DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/test/public"
   ServerName test.localtest

EDIT

ok i have check on my system and it work perfectly, but i am using ubuntu hope this helps

edit this file

C:\Program Files\Zend\Apache2\conf (Zend Server on Windows machines)

and add this code

<VirtualHost *:80>
    ServerName test.localtest
    DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/test/public"

    SetEnv APPLICATION_ENV "development"

    <Directory "C:/Program Files/Zend/Apache2/htdocs/test/public">
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

then edit this file

C:\WINDOWS\system32\drivers\etc\hosts

and add this line

127.0.0.1 test.localtest

and then dont forget to restart you apache server (wamp or xampp or anything you are using)

and then open this link

http://test.localtest

try to write the url with http:// sometimes the browser does not work without http://

try it comment if it does not work

Upvotes: 2

Related Questions