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.
-
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 acurl
GET request, it returns a page containing the stringHello World
.
-
2. Setup a domain name
- 2-setup_a_domain_name: A text file containing the domain name set up for the server through Gandi.
-
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 a301 Moved Permanently
redirection to another page.
- The location
-
4. Not found page 404
- 4-not_found_page_404: Bash script that configures a new Ubuntu machine with Nginx.
- Setup is identical to 1-install_nginx_web_server
plus:
- Features a custom 404 page containing the string
Ceci n'est pas une page
.
- Features a custom 404 page containing the string
-
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.
- Usage:
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.
- Usage:
clean
- Deletes the archive
holbertonwebapp.tar.gz
in the local directory.
- Deletes the archive