Вопрос

I am having trouble setting up a virtual host on Mavericks

First I have this uncommented:

# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf

I have my virtual host set up as like so:

<VirtualHost *:80>
    DocumentRoot "/Users/aaronhappe/Sites/learning-laravel/public"
    ServerName laravel.dev
</VirtualHost>

And this is my hosts file:

127.0.0.1   localhost
127.0.0.1   laravel.dev
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0 localhost

However, when I go to laravel.dev, instead, I see a directory structure exactly the same as if I would go to my local host, rather than my home view to laravel.

Any ideas as to what is wrong?

Нет правильного решения

Другие советы

Did you restart your local server?

sudo apachectl restart

You may try something like this:

<VirtualHost laravel.dev>
    DocumentRoot "/Users/aaronhappe/Sites/learning-laravel/public"
    ServerName laravel.dev
</VirtualHost>

Host file entry:

127.0.0.2   laravel.dev # or 127.0.0.3, an unique IP

Restart apache. Another similar answer.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top