Vanilla-RustLang-Server - User Manual


1. Server configuration

Note: all the server configuration variables are inside src/configuration.rs.

  1. ABSOLUTE_STATIC_CONTENT_PATH

    Used to specify the directory in which you have stored the static HTML files.

    Required: true

    Depends on: None

    Type: String

  2. ABSOLUTE_LOGS_PATH

    Used to specify the directory in which the server will store the logs. Only necessary if you set SAVE_LOGS to true.

    Required: true / false

    Depends on: SAVE_LOGS

    Type: String

  3. ADDR

    The adress which the server will use. Leave it to 127.0.0.1 for localhost. Change it to 0.0.0.0 for production.

    Required: true

    Depends on: None

    Type: String

  4. PORT

    The port which will be used by the server. The default port for HTTP (Hyper Text Transfer Protocol) is 80 and for HTTPS (Hyper Text Transfer Protocol Secure) 443.

    Required: true

    Depends on: None

    Type: Number

  5. SAVE_LOGS

    Specifies whether you want the server to save logs upon a new request.

    Required: true

    Depends on: None

    Type: Boolean

  6. MULTITHREADING

    Specifies whether you want to use multiple threads (faster) or a single thread (slower).

    PRODUCTION WARNING: LOGS ARENT SAVED EVEN IF THEY ARE ENABLED WHEN MULTITHREADING IS IN USE

    Required: true

    Depends on: None

    Type: Boolean

2. Adding static files

Steps for adding static files

  1. Create your static files in the ./media/ directory
  2. Run setup.sh (root access might be necessary)
  3. Specify the directory for your static files (should be the same as the ABSOLUTE_STATIC_CONTENT_PATH)
  4. Run the rest of the script

3. VRS structure (/var/www/ default)

4. setup.sh

This bash script should be run every time you edit (or create) a new static file in the media directory. It copies all the files to the destination directory (the static directory) and clears the logs.

5. FAQ

  1. Is this production ready?

    I do not see any problem with using this web server for production as the only thing it does is serve HTML and static files.

  2. What is this project licensed under?

    MIT License