如何在没有公用文件夹的根目录中运行 laravel? [英] How to run laravel in root directory without the public folder?

查看:34
本文介绍了如何在没有公用文件夹的根目录中运行 laravel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在自己的服务器上运行最新版本的 laravel,运行 DebianApache2.

I am running the latest version of laravel on my own server running Debian and Apache2.

laravel 的内容位于 /var/www 中,这是我的域名所指向的,但是所有功能都发生了通过 public 目录,所以我必须去 http://mydomain.com/public 访问任何内容.

The contents of laravel are located in /var/www which is what my domain name is pointed to however all of the functionality happens through the public directory so I would have to go to http://mydomain.com/public to access anything.

我想更改它,以便我只需要访问 http://mydomain.com.这可能吗?

I would like to change it so that I only have to access http://mydomain.com. Is this possible?

我该如何改变呢?我是否必须将所有内容上移到 /var 的父级?

How can I change this? Would I have to move everything up another level to the parent at /var?

到目前为止,我还没有在网上找到任何说这是可能的,或者说这是个好主意.

I haven't found anything online so far that says that it is possible, or that it is a good idea.

推荐答案

这不是你的问题,你需要将虚拟主机指向公用文件夹.

That is not your problem, you need to point the virtual host to the public folder.

这篇关于如何在没有公用文件夹的根目录中运行 laravel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆