Set up port forwarding to access sites in Linux in VirtualBox

Source: Internet
Author: User

In the previous article we talked about how to set up Virtuabox to log in to the machine via SSH.

Similarly, we can set up port forwarding to access the Web site that the virtual Linux system has built, as described in the previous article:


1. Set Port forwarding:


We set up a local 8888 port to forward to the 80 port of the virtual machine.


The simple structure of a Web site in a virtual machine is as follows:

[Email protected]:/var/www/php# ll/var/www/php/test.php
-rw-rw-r--1 Zhiguo Zhiguo 217 Apr 20:59/var/www/php/test.php


2. Test with 192.168.56.1:8888/php/test.php to successfully access:



OK, you can now successfully access the Web site in the virtual machine:-)


After that we can set up a similar port forwarding, to be developed and tested locally, virtual machine open all of our work can be done locally!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.