YVS1102
YVS1102

Reputation: 2748

Installing laravel in windows with XAMPP

I recently install Laravel in my laptop. I have no problem when i install it. The problem now is when i'm trying to use punya.by instead of localhost:84/laravel/public.

I install my XAMPP in Disk : D

<VirtualHost punya.by:84>
    DocumentRoot "D:/xampp/htdocs/laravel/public"
    ErrorLog "logs/dummy-host.example.com-error.log"
    ServerAdmin punya.by
    <Directory "D:/xampp/htdocs/laravel">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

and here is my Hosts

127.0.0.1  punya.by

there is no problem when i access it with localhost:84/laravel/public but when i access it with punya.by . I get this

Not Found

HTTP Error 404. The requested resource is not found.

So how to fix this ? thanks in advance.

Upvotes: 1

Views: 385

Answers (1)

George Kagan
George Kagan

Reputation: 6124

You need to access it by punya.by:84
Since it's listening on port 84, doesn't matter if you try to access it via IP or domain.

EDIT:
You need to define the vhost like this:

<VirtualHost 127.0.0.1:84>
    DocumentRoot "D:/xampp/htdocs/laravel/public"
    ServerName punya.by
    <Directory "D:/xampp/htdocs/laravel/public">
        Options FollowSymLinks Indexes
        AllowOverride All
        Order deny,allow
        Allow from 127.0.0.1
        Deny from all
        Require all granted
    </Directory>
</VirtualHost>

Basically, the virtual host listens to an IP:Port combination and only inside the declaration do you define the domain that will be matched.

Upvotes: 2

Related Questions