簡體   English   中英

在laravel @ Apache2服務器Ubuntu 14.04 LTS中將根目錄設置為公用文件夾

[英]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選項索引FollowSymLinks MultiViews AllowOverride All允許所有訂單,拒絕所有ErrorLog $ {APACHE_LOG_DIR} /error.log CustomLog $ {APACHE_LOG_DIR} /access.log組合在一起我具有以下配置,但我無法直接訪問laravel。 出現以下內容: 在此處輸入圖片說明

任何幫助將不勝感激。 提前致謝。

您必須在/etc/apache2/sites-enabled/laravel.conf文件中將目錄更改為公用路徑。 像這樣:

<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>

您還應該檢查目錄的權限。 大多數文件夾應為普通的“ 755”,文件為“ 644”。 當然,您的供應商文件夾必須可用於安裝任何更新。

請記住,apache用戶是www-data。

這是一個使apache應用程序在laravel bootstrap緩存上工作的示例:

sudo chgrp -R www-data storage bootstrap/cache

sudo chmod -R ug+rwx storage bootstrap/cache

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM