简体   繁体   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 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. /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。 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. 您必须在/etc/apache2/sites-enabled/laravel.conf文件中将目录更改为公用路径。 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". 大多数文件夹应为普通的“ 755”,文件为“ 644”。 Of course, your vendor folder must be avaible to install any update. 当然,您的供应商文件夹必须可用于安装任何更新。

Remember that the apache user is www-data. 请记住,apache用户是www-data。

This is an example that makes the apache application work on laravel bootstrap cache: 这是一个使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.

相关问题 如何在Ubuntu 14.04 LTS上使用Apache2 + Ruby on Rails配置乘客 - How to Configure Passenger with Apache2 + Ruby on Rails on Ubuntu 14.04 LTS Ubuntu 14.04LTS Apache2漂亮的URL不起作用 - ubuntu 14.04LTS apache2 pretty url's not working 在Ubuntu 14.04上的Apache2中设置缓存 - Setting up caching in Apache2 on ubuntu 14.04 Ubuntu 14.04服务器:Apache2问题与phpMyAdmin - Ubuntu 14.04 Server: Apache2 issue with phpMyAdmin 在运行Apache2 + userdir的Ubuntu服务器14.04上保护$ HOME和public_html安全 - Securing $HOME and public_html on Ubuntu server 14.04 running Apache2 + userdir Apache2 (2.4.7 Ubuntu 14.04 LTS) 中的 ProxyPass 工作主机名太长,如何解决这个问题? - ProxyPass worker hostname too long in apache2 (2.4.7 Ubuntu 14.04 LTS), how to get around this? 如何在具有RVM和Passenger for Apache2的Ubuntu 14.04 LTS上安装Ruby on Rails - How do I install Ruby on Rails on Ubuntu 14.04 LTS With RVM and With Passenger for Apache2 允许在Ubuntu Server中的apache2上创建文件夹 - Allow creation of folder on apache2 in Ubuntu Server Apache虚拟主机无法在Ubuntu 14.04 LTS上运行 - Apache Virtual Host not working on Ubuntu 14.04 LTS 在Ubuntu 14.04 / Apache2上为Vhost启用SSL - Enabling SSL for Vhost on Ubuntu 14.04 / Apache2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM