Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web debugging #12

Merged
merged 6 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 0x0C-web_server/1-install_nginx_web_server
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Installs Nginx with the following configurations:
apt-get update
apt-get install -y nginx
sudo apt-get update
sudo apt-get install -y nginx
sudo ufw app list
sudo ufw allow 'Nginx HTTP'

Expand Down
24 changes: 24 additions & 0 deletions 0x0C-web_server/3-redirection
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Script that installs Nginx server and redirects /redirect_me

# Check if Nginx is already installed
if ! command -v nginx &> /dev/null; then
sudo apt-get update
sudo apt-get install -y nginx
fi
sudo ufw allow 'Nginx HTTP'
echo "Hello World!" | sudo tee /var/www/html/index.html

echo "server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;
index index.html;

location /redirect_me {
return 301 https://github.com/the1Riddle;
}
}" > default

sudo service nginx restart
30 changes: 30 additions & 0 deletions 0x0C-web_server/4-not_found_page_404
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# sets up a new 404 error page that contains

sudo apt-get update
sudo apt-get install -y nginx
sudo ufw allow 'Nginx HTTP'
echo "Hello World!" | sudo tee /var/www/html/index.html
#page info
echo "Ceci n'est pas une page" > 404.html
sudo mv 404.html /var/www/html
echo "server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;
index index.html;

location /redirect_me {
return 301 https://github.com/the1Riddle;
}

error_page 404 /404.html;
location = /404.html{
internal;
}

}" > default

sudo mv -f default /etc/nginx/sites-available/default
sudo service nginx restart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# What happens when you search google.com on your Browser

Background Context
------------------

Being a Full-Stack Software Engineer means you’re comfortable interacting with any layer of the stack.
<br>
A way to easily assess this is to simply ask an engineer to explain how a software system works. They can have a general overview of the flow or can choose to dig deep in a certain area.

![my awesome image](https://s3.amazonaws.com/intranet-projects-files/holbertonschool-sysadmin_devops/298/aJPw3mw.jpg)