How to get Laravel homestead on server - laravel

I already have a running server and i just want to get laravel homestead on it.
All the tutorials are about how to install it on a localmachine or on a virtual machine.

Homestead is VM box, it was created to copy usual server environment for using on any local machine. You absolutely do not want to use it on your server for production.

According to the Laravel Docs Homestead is intended to use only in the local development.
It is just a pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine.
Source : Laravel Docs
You may need to look on the forge which does the same on production server.
You can learn more about forge here

Related

How to deploy a laravel application that will be accessed over a LAN on a windows server?

I am tasked to develop a laravel project for our company. I have to deploy it within the company's network only. It is my first time to do it and haven't find any good source of instruction so far. I hope you can help me with this. I am using XAMPP for this one. And the machine runs on a Windows Server 2016.
Laravel applications are easy to install on IIS. You can use the url_rewrite extension to import the rules from the .htaccess file. Other than that it is really no different than deploying to any other server.
You can also use your company's local DNS to point to the server if you wish to access it via https://my-app.company.com.
May sure you all are one in common network
sudo php artisan serve --host 0.0.0.0 --port 81 (you can change the port if you want)
Other people will be able to access with you'r IP address http://your-pc-id-address:81

Does Laravel Homestead come with Nginx or Apache installed?

I am very new to Laravel and i love coding locally so of course i am using Homestead. Does Homestead use Nginx or Apache? A question before i send my site online when i get it completed.
Laravel 5.6 is the current and latest. I am using that. I am also using the latest version of Homestead as of 5/7/2018.
By default Homestead goes with Nginx but it's also possible to use Apache.
You can read more about it here: https://laravel.com/docs/5.6/homestead :
Homestead uses the Nginx web server by default. However, it can install Apache if apache is specified as a site type. While both web servers can be installed at the same time, they cannot both be running at the same time. The flip shell command is available to ease the process of switching between web servers. The flip command automatically determines which web server is running, shuts it off, and then starts the other server. To use this command, SSH into your Homestead machine and run the command in your terminal:
flip

Laravel app running on Homestead - how to access it on a mobile device?

I'm running an app on Laravel Homestead. My OS is Windows 7. The hosts file:
192.168.10.10 myapp.dev
My PC uses the LAN Internet connection.
Now, I would like to be able to access myapp.dev on a mobile device.
I have tried this (1), as well as that (2). None of these worked for me. If I use the php artisan serve approach (link 1), my IPv4 gets rewritten to myapp.dev, and the site cannot be found.
How do I access my Homestead-based app on a phone?
Homestead 5.x
As of Homestead 5.x, ngrok software is included in your homestead environment. You can use the share myapp.dev command to fire off ngrok to listen for myapp.dev. Please refer to the Laravel Homestead documentation (Sharing Your Environment)
Homestead versions without ngrok included
You can change your nginx configuration file to listen on all requests and use your local IP http://yourip:8000 instead of myapp.dev, but the easiest way to archive this is by creating a secure tunnel to your machine with software like ngrok.com
With your local domain myapp.dev you can basically run the following command after you served your webserver:
ngrok http 192.168.10.10:80 -host-header=myapp.dev
ngrok will generate a secure url which is available on your local network, but also publicly so you can share it with your friends/colleagues.
source

Sharing sites quickly like Laravel valet

I would like to be able to share Laravel application hosted on a local Homestead Vagrant VM to users online.
Is there a way I can easily do this like Valet does? I have too many sites and configurations made to switch over to Valet hence I'm look for a retrofit solution with my existing Homestead setup.
You can try using vagrant share
https://www.vagrantup.com/docs/share/

Using vagrant on EC2

I need to setup a web server and a database server on EC2.
It should be easy to migrate to another service provider later.
Currently, I have a web server and a database server, each running on separate EC2 micro instances with software installed there remotely.
Can we run a vagrant box on these micro instances with pre-installed and pre-configured softwares like LAMP stack and use that instead. So I will end with 2 vagrant boxes , one for web server another for database server.
Amazon provides already means to copy an instance but it is copied to another EC2 instance only probably .. If there is need to move to some other provider, it will be same process of re-installing all. So, an own virtual box installed on Amazon's virtual box is what i was looking into..
I don't know how good or bad it is.. I doubt if this will affect performance as well. Please share your views. Target is to have env prepared locally and have flexibility to deploy it on any service provider easily.
Running vagrant inside your AWS box is probably not the right solution. Have you looked into the Vagrant AWS provider?
That will allow you to setup and provision your AWS boxes with Vagrant and Puppet or Chef... if you are using Puppet or Chef to provision your servers then you will have a very portable "scripted" install for your servers that can easily be moved to another provider at a later date...
So running a virtual machine, on another virtual machine probably isn't the best. But if you want to install Vagrant on Amazon Linux you can do:
wget https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_x86_64.rpm
sudo rpm -ivh vagrant_2.2.4_x86_64.rpm
The RPM is the Centos version from the downloads page here: https://www.vagrantup.com/downloads.html
But then you cannot install virtualbox to run a VM. So it doesn't actually work anyways.

Resources