Skip to content

Latest commit

 

History

History

0x0C-web_server

img

Web server

web-server

Background context

web-server

In this project, some of the tasks will be graded on 2 aspects:

  • Is your web-01 server configured according to requirements
  • Does your answer file contain a Bash script that automatically performs commands to configure an Ubuntu machine to fit requirements (meaning without any human intervention)

For example, if I need to create a file /tmp/test containing the string hello world and modify the configuration of Nginx to listen on port 8080 instead of 80, I can use emacs on my server to create the file and to modify the Nginx configuration file /etc/nginx/sites-enabled/default.

But my answer file would contain:

itsfoss@ubuntu cat 88-script_example
#!/usr/bin/env bash
# Configuring a server with specification XYZ
echo hello world > /tmp/test
sed -i 's/80/8080/g' /etc/nginx/sites-enabled/default
itsfoss@ubuntu

As you can tell, I am not using emacs to perform the task in my answer file. This exercise is aiming at training you on automating your work. If you can automate tasks that you do manually, you can then automate yourself out of repetitive tasks and focus your energy on something more interesting. For an SRE, that comes very handy when there are hundreds or thousands of servers to manage, the work cannot be only done manually. Note that the checker will execute your script as the root user, you do not need to use the sudo command

A good Sofware Engineer is a Lazy Sofware Engineer

lazy-swe

Resources

Read or Watch:

  1. How the web works
  2. Nginx
  3. How to configure Nginx
  4. Child process concept page
  5. Root and subdomains
  6. HTTP Request
  7. HTTP Redirection
  8. Not found HTTP response code
  9. Log files on Linux

References

Man or help

  • scp
  • curl

Learning objectives

By the end of this project, you are expcted to be able to explain to anyone Without the help of Google:

General

  • What is the main role of a web server
  • What is a child process
  • Why web servers usually have a parent process and child processes
  • What are the main HTTP requests

DNS

  • What DNS stands for
  • What is DNS main role

DNS Record Types

DNS Record Types

  • A
  • CNAME
  • TXT
  • MX

Requirements

General

  • Allowed editors: vi, vim, emacs
  • All your files will be interpreted on Ubuntu 16.04 LTS
  • All your files should end with a new line
  • A README.md file, at the root of the folder of the project, is mandatory
  • All your Bash script files must be executable
  • Your Bash script must pass Shellcheck (version 0.3.7) without any error
  • The first line of all your Bash scripts should be exactly #!/usr/bin/env bash
  • The second line of all your Bash scripts should be a comment explaining what is the script doing
  • You can’t use systemctl for restarting a process

Quiz

Quizes