简体   繁体   中英

Setting the Root to public folder in laravel @Apache2 Server Ubuntu 14.04 LTS

/etc/apache2/sites-available/laravel.conf : ServerAdmin webmaster@localhost DocumentRoot /var/www/html/laravel/public Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined I have the following configuration and yet i am not able to access laravel directly. the following appears : 在此处输入图片说明

Any help would be highly appreciated. Thanks in advance.

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 admin@amdinserver.es
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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM