在GoDaddy Linux托管中部署Web应用程序 [英] Deploying web application in GoDaddy Linux Hosting

查看:78
本文介绍了在GoDaddy Linux托管中部署Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天

我正在尝试将laravel应用程序部署到godaddy linux托管.我是云服务器的新手,我在引用要购买的域要使用的laravel文件夹中的public/index时遇到问题.我已经看到了将文件移动到托管根目录(公用)中公用文件夹内的教程.我将尽可能避免将公共文件移动到文档根目录中,因为我将在那里托管多个Web应用程序.有什么办法吗?顺便提一句.网站索引为 http://filcaspro.com/site/public .访问网站时,我想删除/site/public.

I am trying to deploy a laravel application to godaddy linux hosting. I am kind of new to cloud servers and I am having problems referencing the public/index inside the laravel folder to be used by the domain I bought. I have seen tutorials moving the files inside the public folder in the hosting root (public). As much as possible, I would like to refrain from moving the public files in the document root since I'll be hosting several web applications there. Is there any way to do this? BTW. the site index is http://filcaspro.com/site/public. I would like to remove the /site/public when accessing the website.

感谢进阶

推荐答案

我了解您的情况.这样做

I understand your situation. Do this

让我们考虑一下名为网站"的主题项目

Let's consider that the subject project called "website"

最初的网站"目录就是这样.

originally "website" directory is something like this.

 - app
 - bootstrap
 - config 
 - database
 - public
 - ...
 - vendor
 - .env
 - artisan
 - composer.json

现在这就是您需要做的.将所有内容分组到一个名为网站"的文件夹(您的主题项目全部或称其为您想要的名称),但公共文件夹"除外

Now this is what you need to do. group everything to a folder name "website" (your subject project all or call it something you want) but Except for the "public folder"

您应该具有这样的目录.

You should have directory to look like this.

- website
    - app
    - bootstrap
    - ...
    - .env
    - composer.json
- public

现在进入公用文件夹,将所有内容移到外面,看起来像这样.

Now for the public folder, move everything outside and will look like this.

- website
  - app
  - bootstrap
  - ...
  - .env
  - composer.json
- index.php
- .htaccess
- (your assets css/js/images files)

您快到了,我们应该只需要从以下位置编辑index.php

You're almost there, we should just need to edit the index.php from

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

require __DIR__.'/website/bootstrap/autoload.php';  //where website is the new foldername

$app = require_once __DIR__.'/../bootstrap/app.php';

$app = require_once __DIR__.'/wesbite/bootstrap/app.php';

现在应该可以使用了.无需通过"/public"文件夹访问即可在goDaddy或cpanel中的任何共享主机上运行网站.

This should work now. and no need to access via "/public" folder in order to run the website in goDaddy or any sharedhosting in cpanel.

这篇关于在GoDaddy Linux托管中部署Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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