简体   繁体   English

共享主机上的Laravel:安全方法

[英]Laravel on shared host: safe method

Deployment of a Laravel 5 project shouldn't be done on a shared host, that's clear by now. Laravel 5项目的部署不应该在共享主机上完成,这已经很明显了。 But in some cases there's no alternative. 但是在某些情况下,别无选择。 I want to put my project online, but I need to make sure everything is safe and secure. 我想将我的项目放到网上,但是我需要确保所有内容都是安全的。

Is it a safe approach: 这是一种安全的方法:

  • Put all the content of the /public folder in the root 将/ public文件夹的所有内容放在根目录中
  • All the rest in a /project folder 所有其余的都在/ project文件夹中

Is the public part separated enough from the "private" part of the app? 公共部分与应用程序的“私有”部分是否足够分开? Or are vulnerable files in danger? 还是易受攻击的文件处于危险之中? I'm fairly new to deploying Laravel projects, so this is the first time I will deploy a project. 我刚开始部署Laravel项目,所以这是我第一次部署项目。

No while those two folder still seperated its safe. 这两个文件夹仍然没有分开它的保险箱。

/home/username/public_html  -- public part
/home/username/laravaelAppSource -- private part with application

But to make it work you should change the index.php in public_html /home/username/public_html/index.php 但是要使其正常工作,您应该在public_html /home/username/public_html/index.php中更改index.php

problem.require __DIR__.'/../laravaelAppSource/bootstrap/autoload.php';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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