However, for just running a basic web server without needing any specific environment directly in a browser, an extension like Web Server for Chrome developed by MIT is a very useful tool. It is an open source extension that is updated regularly.
This extension can be helpful for simple web server functions like just rendering basic web pages, sharing files locally or for minor HTML development work – all using just Google Chrome. Any other browser too can be used to fetch and display local content when this web server in Chrome is running.
Another place where this extension can be used is inÂ Chromebook.
Using it is very simple too. First, add it to ChromeÂ from here
Once installed, before running it, there are two main configuration tasks to be done :
Define a root folder : This is the root folder that will be accessible to web server (like public_html). That means all the files and sub folders inside it can be accessed by web server.
To add one, click on CHOOSE FOLDER and point to the appropriate path.
Define a web port : This is the port on which web server will listen. The default port for Web Server for Chrome extension is 8887.Â It can be kept as it or be changed to something else if needed.
To do this, enter any other number in Port field. Then stop and restart the web server.
The change should reflect in the accessible web server URL. It should now point towards the new port number.
To access the web folder that is set as root folder, simply open the web link as displayed in browser.
It should display the contents of the folder and display the HTML pages if any.
If needed, it can be set to be accessible to local network (great for hosting files that other computers and devices can access) or even the Internet. These settings can be changed by enabling Accessible on local network and Also on Internet.
The start up behavior of web server too can be set to that during login or in background. To activate these settings, restart the web server.
Overall, this is a great lightweight extension that can help in basic web development tasks or for sharing on local network/Internet.
Do try it out.