For security reasons, you cannot open the index.html file in the project directory directly in the browser.
You must set up a local server on your computer. This section explains how to do it.

Building a local server under Windows

Enable Internet Information Service

  1. In Control Panel, click Programs.
  2. Click on “Turn Windows features on or off”.
  3. In the “Windows Features” window, click “Internet Information Services” to enable it.*Not selected, but not completely selected
  4. Click OK.

Where the files are installed

When Internet Information Services is enabled, a local server folder will be automatically created. Place the project folder in this folder.

  1. Click “This PC” → “Local Disk (C:)”.
  2. Open the “wwwroot” folder in the “inetpub” folder.
  3. Put your project folder in the “wwwroot” folder.

Visit in your browser

  1. Open your browser.
  2. Enter the following address in the address bar and confirm.
    http://<IP address>/project folder name/
    or
    http://<computer name>/project folder name/
    or
    http://localhost/project folder name/

    Example) http://192.168.0.1/project folder name/

Finding the Computer Name

  1. Open a File Explorer window, right-click “This PC” in the sidebar and click “Properties”.
  2. Find the name of your computer to the right of “Computer name:” under the “Computer Name, Domain, and Workgroup Settings” area of ​​the “System” window.

Find your IP address

  1. In Control Panel, click View network status and tasks.
  2. In the Network and Sharing Center window, click Connections: Local Area Connection.
  3. In the Local Area Connection Status window that appears, click Details…
  4. The number you find to the right of “IPv4 Address” is your IP address.

Setting up localhost

To access http://localhost/ in your browser, you need to set up the “hosts” file.

  1. Click the “Start” button, go to “All Programs” → “Accessories”. Right-click “Notepad” and click “Run as administrator”.
  2. In Notepad, click “File” → “Open” and navigate to “C:\Windows\System32\drivers\etc”. Select “All Files (*.*)” and open the “hosts” file.
  3. Modify the following location in the file and save the file.
    ■ Before modification# 127.0.0.1 localhost ■After modification127.0.0.1 localhost
  4. Restart Windows.

Mac OSX local server setup

In Mac computers, Apache is installed by default. You can use a local server by running Apache.

Basic Apache Operations

Enter the command in the terminal to run Apache.

Run Apache

$ sudo apachectl start

Exit Apache

$ sudo apachectl stop

Where the files are installed

Place the project folder in the following location.

/Library/WebServer/Documents

* When creating a new project and saving it, the project folder will be located in the location specified by “Location”.

Visit in your browser

  1. Open your browser.
  2. Enter the following address in the address bar and confirm.
    http://localhost/project folder name/

Leave a Reply

Your email address will not be published. Required fields are marked *