Laravel 5.4: Do not load the routes in virtualhost (Error 404)

0

I have almost-successfully configured a virtualhost using Apache to work with Laravel 5.4 (initially I was working with Homestead but "x" reasons I am now working locally).

The problem is that even if you manage to load the initial page, I can not access to consult Laravel's "api" routes, so, if I have the route:

link

and I want to get the results of the following route:

link

It does not work. Rather I get the error 404. I do not know if I should do more configurations, but this is what I have in the configuration of my virtualhost:

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName ventas.dev
    ServerAlias www.ventas.dev
    DocumentRoot /var/www/html/Ventas/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory /var/www/html/Ventas/public>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Any ideas of what I might be doing wrong?

    
asked by Ricky 17.08.2017 в 01:08
source

1 answer

3

Well, I fixed my problem. It was necessary to give 777 permissions to the storage directory:

sudo chmod -R 777 storage

and enable the mod_rewrite:

sudo a2enmod rewrite

Finally, it is necessary to restart the server (in my case Apache):

sudo systemctl restart apache2

That's it

    
answered by 17.08.2017 / 16:53
source