Deploy Orange Application 5.2 + Angular2

Asked

Viewed 525 times

10

I’m developing a small application with Laravel 5.2 and Angular2. So far everything is ok in the development environment (not to contradict :) ). My concern is how to do the deploy of this application for a shared server - in this case I will be publishing on Kinghost.

I have published projects using other technologies in this hosting without major problems.

But the current project has Nodejs and Laravel5.2 and both have a huge amount of dependencies that believe that should not all be taken to the server. This is my first project with these two technologies and I have no idea how to publish them. Flavius

  • Shared server or dedicated server?

  • 5

    +1 by the question, why I will take advantage of the answers here too :) I am at the same impasse, only that at Locaweb.

  • Opsss... truth, I forgot to inform that the hosting service is of type "Shared server"!

  • you have access to ssh of this project?

2 answers

2


In shared hosting plans, the client does not usually have access to install new features or services to be used on the server. The most common is to have only the freedom to configure the resources already available on the contracted plan.

Despite Laravel be listed among the frameworks supported by Kinghost, nor Nodejs nor Angular-2 are listed as "supported languages" or "compatible frameworks" (see Technical characteristics)

*You would need access to the hosting admin panel to find out what is available to you, please contact their support.

Among the plans of this lodging I do not know which one would better serve you. But in cases with dependencies like this, I would use a droplet in Digital Ocean, where I would be free to set up the environment the way I need it.

0

Recently I also came across this question.

In the Angular, did the build in the way production with the command

ng build --prod

The generated files are in the folder build at the root of the application Angular. Upload these files to the folder /public_html server.

In the case of Laravel, it is necessary to make some changes:

  • Upload the entire project folder Laravel (except the folder public) in root server. I suggest compressing the files so the transfer takes less. Unzip the project and name the folder. Ex.: Portable;
  • Upload the folder public in the briefcase /public_html server. After that, I renamed it to the desired name;
  • In the archive index.php (that was in the folder public from Laravel), edit the following lines:

    require __DIR__.'/../vendor/autoload.php';
    
    $app = require_once __DIR__.'/../bootstrap/app.php';
    

    for

    require __DIR__.'/../laravel/vendor/autoload.php';
    
    $app = require_once __DIR__.'/../laravel/bootstrap/app.php';
    

    Where laravel is the name of the folder that was unzipped on the server root. If you put it in a subfolder, adjust the paths until they reach the folder laravel.

Access http://seudominio.com.br to see the application running.

Of course the folder structure may vary depending on the structure of your application.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.