Start Windows or Mac OSX local server (without installing third-party server software)

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

 

Build a local server under Windows

 

Open Internet Information Service

  1. In Control Panel, click Programs.
    Start Windows or Mac OSX local server (without installing third-party server software)
  2. Click "Turn Windows features on or off".
    Start Windows or Mac OSX local server (without installing third-party server software)
  3. In the Windows Features window, click Internet Information Services to enable it.
    Start Windows or Mac OSX local server (without installing third-party server software)

    *Not selected, not fully selected

  4. Click "OK".

 

file installation location

A local server folder is automatically created when Internet Information Services is enabled. Put the project folder in this folder.

 

  1. Click "This PC" → "Local Disk (C:)".
    Start Windows or Mac OSX local server (without installing third-party server software)
  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/

 

find computer name

  1. Open a File Explorer window, right-click "This PC" in the sidebar and click "Properties".
    Start Windows or Mac OSX local server (without installing third-party server software)
  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.
    Start Windows or Mac OSX local server (without installing third-party server software)

 

Find your IP address

  1. In the Control Panel, click View Network Status and Tasks.
    Start Windows or Mac OSX local server (without installing third-party server software)
  2. In the Network and Sharing Center window, click Connections: Local Area Connection.
    Start Windows or Mac OSX local server (without installing third-party server software)
  3. In the Local Area Connection Status window that appears, click Details....
    Start Windows or Mac OSX local server (without installing third-party server software)
  4. The number found to the right of "IPv4 Address" is your IP address.
    Start Windows or Mac OSX local server (without installing third-party server software)

 

set localhost

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

 

  1. Click the "Start" button and go to "All Programs" → "Accessories". Right click on "Notepad" and click "Run as administrator".
    Start Windows or Mac OSX local server (without installing third-party server software)
  2. Click "File" → "Open" in Notepad and navigate to "C:\Windows\System32\drivers\etc". Select "All files (*.*) and open the "hosts" file.
    Start Windows or Mac OSX local server (without installing third-party server software)
  3. Modify the following locations in the file and save the file.
    ■Before modification
    #   127.0.0.1       localhost
    

    ■After modification

    127.0.0.1       localhost
    
  4. Restart Windows.

 

Mac OSX local server setup

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

 

Apache Basic Operation

Enter the command in the terminal to run Apache.

 

run Apache

$ sudo apachectl start

 

quit Apache

$ sudo apachectl stop

 

file installation location

Put the project folder in the following location.

/Library/WebServer/Documents

* When creating a new project and saving, 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/

 

Original: http://miaowm5.github.io/RMMV-F1/page/01_11_08.html

 

 

This article is transferred from: Open Windows or Mac OSX local server (non-installation of third-party server software)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326542536&siteId=291194637