0

I have created a project zfapi by zf command in ubuntu.

Now http://mysite.com/path/to/zfapi/

gives me listing of folder public application and others.

http://mysite.com/path/to/zfapi/public give me the index page index.php.

and i have made the UserController.php in application/controllers

but by http://mysite.com/path/to/zfapi/user/

is saying user not found.

what configuration i need to set for running it proper.

I had set my /etc/apache2/apache2.conf added the following in the last .

<VirtualHost *:80>

    DocumentRoot "/var/www/path/to/zfapi"

    <Directory "/var/www/path/to/zfapi">

        Order allow,deny

        Allow from all

    AllowOverride all

</Directory>

</VirtualHost>

is giving me this error while restarting server.

[Sat Jan 08 13:32:53 2011] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Sat Jan 08 13:33:03 2011] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results

what this i should do .?

2 Answers 2

0

You should at least set a ServerName when using virtualhost configuration.

<VirtualHost *:80>
    ServerName mydomain.com
    DocumentRoot "/var/www/path/to/zfapi"
    <Directory "/var/www/path/to/zfapi">
        Order allow,deny
        Allow from all
    AllowOverride all
</Directory>
</VirtualHost>

And you will have to check that you install mod rewrite by doing this:

sudo a2enmod rewrite

And it wasn't enabled restart apache.

1
  • I have one site-enabled , so i prefer nothing should happen to that site , and i don't have other domain name ,than what ServerName I can give here ,and In which file I need to write this VirtualHost Tag? Jan 8, 2011 at 11:25
0

check your apache configuration files for the 'NameVirtualHost' string

sudo grep -iR NameVirtualHost /etc/apache2/*

It's quite certainly something different than

NameVirtualHost *:80

Maybe you have

NameVirtualHost *

or

NameVirtualHost 10.1.1.15:80

Your VirtualHost tag, the first tag of your VirtualHost definition must match this definiion. You an hae several differentNameVirtualHost defintions, this is elling apache what configuration of listening IP address/port should be attached to VH definitions. If your VH definition does not match any of these you've got the error log you have.

so maybe you'll need on your VH:

<VirtualHost *>

http://httpd.apache.org/docs/2.0/mod/core.html#namevirtualhost

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .