From dd37276e7d4266a6bd4bc6158b3443f21df7cd89 Mon Sep 17 00:00:00 2001 From: voodoorai2000 Date: Sat, 6 Apr 2019 20:54:16 +0200 Subject: [PATCH 1/3] Add general Vagrant documentation --- docs/en/installation/vagrant.md | 44 +++++++++++++++++++++++++++++++++ docs/es/installation/vagrant.md | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 docs/en/installation/vagrant.md create mode 100644 docs/es/installation/vagrant.md diff --git a/docs/en/installation/vagrant.md b/docs/en/installation/vagrant.md new file mode 100644 index 000000000..767713d53 --- /dev/null +++ b/docs/en/installation/vagrant.md @@ -0,0 +1,44 @@ +# Vagrant + +Install [Vagrant](https://www.vagrantup.com/) and setup a virtual machine with [Linux](prerequisites.md) + +Vagrant is compatible for [Debian](/en/installation/debian.md) and [Ubuntu](/en/installation/ubuntu.md). + +## Browser configuration + +To access the application through the brower at `localhost:3000` we must forward a port and run the rails server with a binding option: + +## Port forwarding +Open the Vagrant configuration file: + +``` +nano Vagranfile +``` + +Find this line: + +``` +# config.vm.network "forwarded_port", guest: 80, host: 8080 +``` + +And change it for this configuration: + +``` +config.vm.network "forwarded_port", guest: 3000, host: 3000 +``` + +Reload your virtual machine: + +``` +vagrant reload +``` + +# Running the rails server + +In your virtual machine, run the application server, binding to your local ip address: + +``` +bin/rails s -b 0.0.0.0 +``` + +Now you should be able to see the application running in your browser at url `localhost:3000`! :tada: diff --git a/docs/es/installation/vagrant.md b/docs/es/installation/vagrant.md new file mode 100644 index 000000000..d47c00fef --- /dev/null +++ b/docs/es/installation/vagrant.md @@ -0,0 +1,44 @@ +# Vagrant + +Instale [Vagrant](https://www.vagrantup.com/) y configure una máquina virtual con [Linux](prerequisites.md) + +Vagrant es compatible para [Debian](/es/installation/debian.md) y [Ubuntu](/es/installation/ubuntu.md). + +## Browser configuration + +Para acceder a la aplicación a través del navegador en la url `localhost:3000` debe enrutar el puerto de la aplicación y ejectuar el servidor de la aplicación con la opción `-b`: + +## Enrutar el puerto de la aplicación +Abra el archivo de configuración de Vagrant: + +``` +nano Vagranfile +``` + +Encuentre esta línea: + +``` +# config.vm.network "forwarded_port", guest: 80, host: 8080 +``` + +Cámbiela por esta: + +``` +config.vm.network "forwarded_port", guest: 3000, host: 3000 +``` + +Recargue la máquina virtual: + +``` +vagrant reload +``` + +# Ejecutar el servidor + +En su máquina virtual, debe ejecutar la aplicación enlanzándola a su IP local: + +``` +bin/rails s -b 0.0.0.0 +``` + +Ahora debería ver la aplicación desde el navegardor en la url `localhost:3000` :tada: From 3e72e442a4d332dc7a5c2827213ba8ce2eb25b83 Mon Sep 17 00:00:00 2001 From: voodoorai2000 Date: Sat, 6 Apr 2019 20:54:26 +0200 Subject: [PATCH 2/3] Add Vagrant documentation for Debian --- docs/en/installation/debian.md | 5 +++++ docs/es/installation/debian.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/docs/en/installation/debian.md b/docs/en/installation/debian.md index b8e1b927f..201c712d3 100644 --- a/docs/en/installation/debian.md +++ b/docs/en/installation/debian.md @@ -8,6 +8,11 @@ Note that 'sudo' is not installed by default in Debian. It's possible to install su ``` +> For [Vagrant](/en/installation/vagrant.md) run: +> ``` +> sudo su - +> ``` + ## Git Git is officially maintained in Debian: diff --git a/docs/es/installation/debian.md b/docs/es/installation/debian.md index 30eb6e68e..289ca2e44 100644 --- a/docs/es/installation/debian.md +++ b/docs/es/installation/debian.md @@ -8,6 +8,11 @@ El programa 'sudo' no viene instalado en Debian por defecto. Su instalación y c su ``` +> Para [Vagrant](/es/installation/vagrant.md) ejecutar: +> ``` +> sudo su - +> ``` + ## Git Git es mantenido oficialmente en Debian: From d6205987a33d8ea89e3295e21dd1ecff33201237 Mon Sep 17 00:00:00 2001 From: voodoorai2000 Date: Sat, 6 Apr 2019 20:54:42 +0200 Subject: [PATCH 3/3] Add Vagrant to documentation menu --- docs/SUMMARY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index d49b6b6f6..9fa6d3d0a 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -15,6 +15,7 @@ * [Debian Linux](en/installation/debian.md) * [MacOS](en/installation/macos.md) * [Windows](en/installation/windows.md) + * [Vagrant](en/installation/vagrant.md) * [Production and Staging servers](en/installation/servers.md) * [Installer](en/installation/installer.md) * [Crear usuario](en/installation/create_deploy_user.md) @@ -63,6 +64,7 @@ * [Debian Linux](es/installation/debian.md) * [MacOS](es/installation/macos.md) * [Windows](es/installation/windows.md) + * [Vagrant](es/installation/vagrant.md) * [Servidores de producción y pruebas](es/installation/servers.md) * [Instalador](es/installation/installer.md) * [Create a deploy user](es/installation/create_deploy_user.md)