Can the html5 published file run locally?
September 16, 2021 12:00 AM
I exported the cenarioVR as html5 but can't seem to run it locally.
Is there any way that I could host the files to be able to view it?
Solution
Once you've installed IIS, you should be able to open your browser and type "localhost" into the URL and see the following:
If that works, you can then create any directory under you "c:/inetpub/wwwroot" directory, and browse there. So, for example, you can create a directory called "myfiles" (c:/inetpub/wwwroot/myfiles), copy an HTML published CVR scenario there, and browse it locally by entering "localhost/myfiles/" in the URL bar.
Discussion (8)
You could run a local web server. There are excellent free ones, e. g. Apache. There's probably something available from the Microsoft Store, but I never use Windows when I can avoid it, so I don't know. (I personally just upload them to my own web server, but not everyone has access to one.)
Unfortunately, Web Browsers won't allow local web content all of the privileges they need to run. They do it for "security reasons". I just use the default Windows Web server which comes with every copy of Windows. Its not there by default, you need to go to the "Programs and Features" section of the control panel and install "Internet Information Services"
This looks like a pretty good set of instructions: https://www.routerhosting.com/knowledge-base/install-iis-on-windows-10/
Thanks both! Appreciate your help.
I am pretty new to Web Servers, could you explain how then I could host the link there? A helpful link or guide would work too. Thanks!
Once you've installed IIS, you should be able to open your browser and type "localhost" into the URL and see the following:
If that works, you can then create any directory under you "c:/inetpub/wwwroot" directory, and browse there. So, for example, you can create a directory called "myfiles" (c:/inetpub/wwwroot/myfiles), copy an HTML published CVR scenario there, and browse it locally by entering "localhost/myfiles/" in the URL bar.
To add to what @johnb writes: for any web server there is a "root" directory. If it's localhost and you're using IIS, that would be (as John says), c:\inetpub\wwwroot. (Note that I'm using backslashes, which Windows has traditionally expected. On Linux or several other operating systems, it would be forward slashes, "/", as John originally wrote it.)
So now if you send your browser to http://localhost, it searches wwwroot for a file that by default is named "index.html" (or several alternatives like "index.htm" or "index.asp", but in this case it would be index.html). The browser loads that page and displays it, as John showed in his reply.
If you create a subdirectory of that "root" folder, you can add the name of that subdirectory to the URL (Uniform Resource Locator, which in almost every case you can think of as "web address"). So, if you create c:\inetpub\wwwroot\scenario, you could use the URL http://localhost/scenario. Notice that URLs use standard forward slashes, not backslashes. The server would look for an index file in that other folder, and load that page. CenarioVR generates a web page, which in turn loads a bunch of other files (JavaScript, images, etc.). If you copy the HTML publish of your CVR scenario to the folder, IIS will load the index file, then the index file will direct it to load the rest of the required files for your scenario to operate.
I hope that's helpful.
Hello John, I have no issues doing the download of IIS.
I've tried to add a new website, linking to the local folder but I still don't seem to be able to launch the CenarioVR. Not sure if I am doing anything wrong there.
Appreciate your help and explanation @johnb and @carlfink !!
This is really helpful to know which directory I needed to place my files in. Managed to get it working :smiley: