Skip to content

Commit

Permalink
add vagrant port forwarding and ssh info
Browse files Browse the repository at this point in the history
as per #76
  • Loading branch information
tkimnguyen authored Mar 17, 2019
1 parent 7737bb1 commit 72c1474
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions docs/vagrant.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,43 @@ to remove the old host key, then try again.

This should not happen if you're using the generated vbox_host.cfg, as it turns of Ansible's host key checking.

Testing
-------
Using the Vagrant
-----------------

To use your Vagrant, you must use SSH.

Vagrant maps host ports into the guest VirtualBox OS.

The standard mapping takes host port 2222 to the guest's SSH port, 22.

This comment has been minimized.

Copy link
@stevepiercy

stevepiercy Mar 17, 2019

Contributor

remove comma or make consistent with host port 2222.


To SSH to your Vagrant:

.. code-block:: bash
vagrant ssh
Port Mapping
------------

Vagrant maps host ports into the guest VirtualBox OS. The standard mapping takes host port 2222 to the guest's SSH port, 22.

The Vagrantfile included with this kit maps several more ports. The general rule is to map each guest port to a host port 1000 higher::

config.vm.network "forwarded_port", guest: 80, host: 1080
config.vm.network "forwarded_port", guest: 1080, host: 2080
config.vm.network "forwarded_port", guest: 4949, host: 5949
config.vm.network "forwarded_port", guest: 6081, host: 7081
config.vm.network "forwarded_port", guest: 8080, host: 9080
config.vm.network "forwarded_port", guest: 4949, host: 5949

You can find these forwarded port settings by opening VirtualBox, selecting your Vagrant (will be called something like `ansible-playbook`), right-clicking, choosing "Settings", clicking "Network", expanding the "Advanced" widget, and clicking the button "Port Forwarding".

This comment has been minimized.

Copy link
@stevepiercy

stevepiercy Mar 17, 2019

Contributor
  • Add :guilabel: directive for GUI thingies, e.g.:
right-click on your Vagrant :guilabel:`ansible-playbook` (or similar name) and choose :guilabel:`Settings`.

Here is what the forwarded ports are used for and where they are defined:

- 80, 443: nginx (`roles/nginx/templates/host.j2`)
- 1080: haproxy (`roles/haproxy/defaults/main.yml`)
- 4949: munin_node (`roles/munin-node/defaults/main.yml`)
- 6081: varnish (`roles/varnish/defaults/main.yml`)
- 8100: zeo_port (`roles/plone.plone_server/defaults/main.yml`)
- 8081: client_base_port (`roles/plone.plone_server/defaults/main.yml`)

This comment has been minimized.

Copy link
@stevepiercy

stevepiercy Mar 17, 2019

Contributor

Use double backticks for inline literals and correct reST syntax. Single backticks result in italic in reST (code in markdown).

For example:

- 80, 443: nginx (``roles/nginx/templates/host.j2``)

Note that when you use host port 1080 to connect to guest port 80, the virtual hosting will not work correctly. You'll get the homepage, but links -- including those to stylesheets and JS resources, will be wrong. So, you can't really test virtual host rewriting via Vagrant.

0 comments on commit 72c1474

Please sign in to comment.