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
- In Control Panel, click Programs.
- Click "Turn Windows features on or off".
- In the Windows Features window, click Internet Information Services to enable it.
*Not selected, not fully selected
- 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.
- Click "This PC" → "Local Disk (C:)".
- Open the "wwwroot" folder in the "inetpub" folder.
- Put your project folder in the "wwwroot" folder.
Visit in your browser
- Open your browser.
- 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
- Open a File Explorer window, right-click "This PC" in the sidebar and click "Properties".
- 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
- In the Control Panel, click View Network Status and Tasks.
- In the Network and Sharing Center window, click Connections: Local Area Connection.
- In the Local Area Connection Status window that appears, click Details....
- The number found to the right of "IPv4 Address" is your IP address.
set localhost
To access http://localhost/ in your browser, you need to set up the "hosts" file.
- Click the "Start" button and go to "All Programs" → "Accessories". Right click on "Notepad" and click "Run as administrator".
- Click "File" → "Open" in Notepad and navigate to "C:\Windows\System32\drivers\etc". Select "All files (*.*) and open the "hosts" file.
- 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
- 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
- Open your browser.
- 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)