I hope you find this option a useful tool in your toolbox. You can also use a while loop with ncat or /dev/tcp/host/port for transport… but that is another article. Serve a file on an allowed port of firewall - Copy a file to a folder and serve with python -m SimpleHTTPServer port.Share a file to/from a VM - Copy a file to a folder and serve with python -m SimpleHTTPServer.Edit the grub config at boot, and away you go. Quickly serve kickstart files in a pinch - Copy the /root/anaconda-ks.cfg or /root/original-ks.cfg to a folder and serve with python -m SimpleHTTPServer.However, we can use the module for our purposes to: The SimpleHTTPServer module is actually a development tool used as a framework tool to lay the foundation for a full-blown web server with all the necessary security features included. This tip is not a replacement for actual file-hosting solutions in business environments. wget curl This simple local HTTP server is a nice little utility to use in those times when you need to transfer files quickly across systems. The module loads and serves any files within the directory on port 8000 by default.Īnother option is to use wget or curl to download the files to the remote system. * Note: The module has been renamed rver in python3 To use the module for our purposes, run the following command from the directory with the files we want to share: python -m SimpleHTTPServer Python may be installed as a dependency to an application or service that is already running on the system. Python must be installed to use the SimpleHTTPServer module. ![]() However, as sysadmins, we can use the module to serve files from a directory. Status: beta (expected to work, but not tested in production yet). The SimpleHTTPServer module is a Python module that enables a developer to lay the foundation for developing a web server. Implementation of the server side of the LiveReload protocol in Node.js a component of LiveReload.app and some other projects. Regardless of the situation, we can use Python's SimpleHTTPServer module as a quick web server. We find that we need to install a package or utility to share the files, or we may need to enable a feature to share the content. ![]() For whatever reason, we need to get a single tar or conf file from one system to another, or maybe copy a group of files between systems. Sometimes as admins, we need to share files across systems quickly. How well do you know Linux? Take a quiz and get a badge.Linux system administration skills assessment.A guide to installing applications on Linux.To handle them, youll need something more exactly what youll need depends on the server-side language you are trying to run. Download RHEL 9 at no charge through the Red Hat Developer program Pythons rver (or SimpleHTTPServer for Python 2) module is useful, but it is merely a static file server it doesnt know how to run code written in languages such as Python, PHP or JavaScript.
0 Comments
Leave a Reply. |