[Software installation] Use miniserve to build a file server in Windows system

This article mainly introduces how to use miniserve to build a file server in Windows systems.

Table of contents

1. Set up a file server

1.1. Download miniserve

1.2. Start miniserve service

1.3. Specify the root directory

1.4. Turn on access logs

1.5. Specify the startup port

1.6. Set up user authentication

1.7. Set interface theme

(1) squirrel theme

(2) archlinux theme

(3)zenburn theme

(4) monokai main issue

1.8. Enable file upload

1.9. Create directory

1.10. Compressed download


1. Set up a file server

1.1. Download miniserve

miniserve is a lightweight file server written in Rust language. miniserve provides a very beautiful user interface. In addition, miniserve also provides the following functional configurations:

  • Compressed download: You can compress the folder before downloading.
  • Interface upload: You can select the file to be uploaded directly on the interface.
  • Random routing: You can set the routing address for each visit.
  • User authentication: You can set the user name and password to access the file server.
  • Specify directory: Specify a directory as the root directory of the file server.
  • Support TLS: TLS can be turned on and the https protocol can be used.
  • Upload files: You can use the curl command to upload files.

The official download address of miniserve is on GitHub, address:https://github.com/svenstaro/miniserve/releases/tag/v0.24.0. The latest version is 0.24.0. At present, it seems that it has not been updated. Minniserve provides versions for windows, linux, and macos systems. This article uses the windows version.

Download the exe executable file. The exe file of the miniserve server can be downloaded directly and used. No additional installation is required. Double-click the exe file to start the miniserve service.

1.2. Start miniserve service

After miniserve is downloaded, you can put the miniserve exe file under a specified directory. For example: I put it under a directory called miniserve, as shown in the figure below:

Then double-click the exe file. At this time, you can see in the cmd command line window that the miniserve server has started successfully.

Open the browser and enterhttp://localhost:8080/. At this time, you can see the miniserve file server interface. , as shown below:

By default, miniserve uses its current startup directory as the root directory of the file server, and then exposes all files and directories in the root directory.

1.3. Specify the root directory

Open the cmd window and when executing the miniserve.exe file, just add the root directory path at the end.

1.4. Turn on access logs

When starting the miniserve service, you can enable the console to output access logs by specifying the [-v] parameter. In this way, every time the file server is accessed, the access information will be printed to the cmd window, as shown below.

1.5. Specify the startup port

The miniserve service is started using port 8080 by default. You can specify the startup port of the service through the [-p] parameter, as shown below.

1.6. Set up user authentication

There are many ways to set the username and password of the miniserve server. Here is the simplest way. Use the original username and password and add the [-a] parameter to the startup command to set the username and password, as shown below.

When we access the miniserve service, a window will pop up asking us to enter our username and password, as follows:

1.7. Set interface theme

If you think the interface of miniserve is not good-looking, you can use the [-c] parameter to set the theme color of the interface. Optional themes: squirrel (default), archlinux, zenburn, monokai.

(1) squirrel theme

(2) archlinux theme

(3)zenburn theme

(4) monokai main issue

1.8. Enable file upload

When starting miniserve, you can enable the file upload function through the [-u] parameter, and you can specify the directory to save the uploaded file. If you do not specify a directory, the default is to upload it to the miniserve startup directory.

When accessing the browser, you can see the button to upload files.

First select a file, then click Upload File to successfully upload the file to the current directory.

1.9. Create directory

By specifying the [-U] parameter, you can start the directory creation function. Note that the parameter here is a capital U.

You can see the button to create a directory in the miniserve interface.

1.10. Compressed download

By setting the [-r] parameter, you can turn on the compressed tar package function, compress all the files in the current directory into a tar package, and then download it.

Download the tar package as follows:

At this point, the introduction to the miniserve file server is complete.

In summary, this article is over. It mainly introduces how to use miniserve to build a file server in Windows systems.

Guess you like

Origin blog.csdn.net/qq_39826207/article/details/134066278