IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Activate Built-in Web Server

Laptop icon

If you ever need to use a local web server on Windows, it’s always convenient just to turn on IIS server in your system. But for a security reason, that’s not feasible to have that in your corporate environment. However, IIS is not the only option available, if you have any of development tools installed in your system, you’re still in luck.

This post will show how you can activate a built-in web server if you have any (or a combination of) of the following: PHP, Python and/or Node.js.

With the assumption that we’re using port 8000 for the built-in server, here are the command line to activate the built-in web server from each platform.

IMPORTANT: DO NOT USE FOR PRODUCTION. This should be used only for development.

Always type in the command line from the web folder.

PHP

If you don’t have it installed yet, here’s how to install PHP on Windows.

php -S localhost:8000

Python 2

This is strictly posted for a legacy system. If you don’t have Python 2 yet, it’s better just to install the newer Python 3 for this purpose.

python -m SimpleHTTPServer 8000

Python 3

Make sure Python 3 is installed.

python -m http.server 8000

Node.js npm

Before you can activate the web server, you need to install express first.

npm install express —save (just need to install this one time)

Then you can activate it by typing this command:

node http.js

Further Reading

How to Install IIS on Windows 10
How to Install Python on Windows Server
How to Install PHP on Windows 10

January 10, 2023 Filed Under: How To Tagged With: Web Server

Robocopy Example to Mirror Web Server

Just to solve a challenge of dealing with legacy CMS that’s only specifically mapped to an old server. The contents need to be copied over to a new server periodically throughout the day and it has to act like a mirror (option /mir) in such a way that net new files are copied and any deleted directories and files are also reflected on the new server.

As the server was upgraded, there is a couple files that cannot be overriden. With the use of Windows Robocopy, certain directories such as App_Data and aspnet_client can be excluded (option /xd). In the same way, files like global.asa and web.config (option /xf).

Robocopy command:

robocopy \\shared\d$\itnota\ D:\itnota\ /mir /e /xd "App_Data" "aspnet_client" /xf "global.asa" "web.config" /log:"F:\migration.log"

The command then can be set on a task scheduler to run automatically.

Robocopy commands in Task Scheduler

More Windows Robocopy examples can be found on the links below (Further Reading).

Further Reading

Robocopy
Robocopy and a Few Examples
Robocopy /mir switch doesn’t copy security
MCSA Windows Server 2016 Complete Study Guide: Exam 70-740, Exam 70-741, Exam 70-742 and Composite Upgrade Exam 70-743 2nd Edition

January 29, 2014 Filed Under: How To Tagged With: Task Scheduler, Web Server, Windows Robocopy, Windows Server

Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure