2
votes

I have the following configuration and yet i am not able to access Laravel directly.

in /etc/apache2/sites-available/laravel.conf

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/laravel/public
        <Directory /var/www/html/laravel/public>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

the following appears:

enter image description here

Any help would be highly appreciated. Thanks in advance.

1
solved this already?Helder Lucas
@HelderLucas - no i have not come around the solution.dpak005
@HelderLucas the solution RafaelM give is the best solution please try it.Yousef Altaf

1 Answers

4
votes

You must to change in your /etc/apache2/sites-enabled/laravel.conf file the directory to the public path. Like this:

<VirtualHost your-ip-address:80>



ServerAdmin [email protected]
ServerName localhost
ServerAlias your-url
DocumentRoot /var/www/html/laravel/public

<Directory "/var/www/html/laravel/public">

    AllowOverride All
        Options FollowSymLinks Indexes
        Order allow,deny
        Allow from all

</Directory>


ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


</VirtualHost>

You should also check the permissions of the directories. Most folders should be normal "755" and files, "644". Of course, your vendor folder must be avaible to install any update.

Remember that the apache user is www-data.

This is an example that makes the apache application work on laravel bootstrap cache:

sudo chgrp -R www-data storage bootstrap/cache

sudo chmod -R ug+rwx storage bootstrap/cache