Skip to content

Latest commit

 

History

History

0x0C-web_server

Web server

In this project, I learned how web servers work and began using one. I was provided a personal server by ALX. I learned how to use scp and Fabric to transfer files to my server. Additionally, I completed a basic configuration of the server using Nginx.

The server is accessible at bdbnb.site.

Tasks 📃

  • 0. Transfer a file to your server

    • 0-transfer_file: Bash script that transfers a file from Holberton's client to a server.
    • Accepts four arguments:
      • The path of the file to be transferred.
      • The IP of the server to transfer the file to.
      • The username that scp connects with.
      • The path of the SSH privtae key that scp uses.
    • scp transfers the file to the user home directory ~/.
  • 1. Install nginx web server

    • 1-install_nginx_web_server: Bash script that configures a new Ubuntu machine with Nginx.
    • Nginx listens on port 80.
    • When querying Nginx at its root / with a curl GET request, it returns a page containing the string Hello World.
  • 2. Setup a domain name

  • 3. Redirection

    • 3-redirection: Bash script that configures a new Ubuntu machine with Nginx.
    • Setup is identical to 1-install_nginx_web_server plus:
      • The location /redirect_me returns a 301 Moved Permanently redirection to another page.
  • 4. Not found page 404

  • 5. Design a beautiful 404 page

    • A custom-designed 404 error page for my server, accessible at bdbnb.site/404.
  • 6. Deploy fast, deploy well

    • fabfile.py: A Python Fabric configuration file defining the following functions:
    • pack
      • Usage: fabric pack
      • Creates a tar gzipped archive of the current directory named holbertonwebapp.tar.gz in the local directory.
    • deploy
      • Usage: fabric -H <remote server IP> deploy
      • Uploads the archive holbertonwebapp.tar.gz to the /tmp directory of the remote server.
      • Creates the directory /tmp/holbertonwebapp in the remote server.
      • Untars holbertonwebapp.tar.gz in the /tmp/holbertonwebapp directory of the remote server.
    • clean
      • Deletes the archive holbertonwebapp.tar.gz in the local directory.