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

Revert "Revert "Web stack debugging #1"" #6

Merged
merged 1 commit into from
Dec 6, 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
8 changes: 8 additions & 0 deletions 0x0E-web_stack_debugging_1/0-nginx_likes_port_80
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# finding out what’s keeping Ubuntu container’s Nginx installation from..
# listening on port 80.
# Then, writing a Bash script with a minimum num of commands t automate the fix
sudo sed -i "s/ipv6only=on//" /etc/nginx/sites-available/default
sudo rm -f /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
sudo service nginx restart
4 changes: 4 additions & 0 deletions 0x0E-web_stack_debugging_1/1-debugging_made_short
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# my short version of task 0, making it short N sweet
sed -i 's/8080/80/g' /etc/nginx/sites-enabled/default
pkill -1 nginx
44 changes: 44 additions & 0 deletions 0x0E-web_stack_debugging_1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# <p align="center">Web stack debugging #1</p>

- this involves identifying and fixing issues at various levels of the web development stack, including the front end, back end, and the server.

## <p align="center">![image](https://github.com/the1Riddle/alx-system_engineering-devops/assets/125451537/7287d3c2-b790-4654-9f97-4e57e320baf8)</p>

## How to approach web stack debugging:

### <p align="center">Back-End Debugging:</p>

1. Server Logs:
> Check server logs for errors and warnings.
> Analyze logs to identify patterns or specific issues.

2. Database Debugging:
> Ensure database connections are established correctly.
> Check database logs for errors.
> Verify that database queries are returning the expected results.

3. API Testing:
> Test API endpoints using tools like Postman or cURL.
> Inspect API responses for errors and unexpected behavior.

4. Code Profiling:
> Use profiling tools to identify performance bottlenecks in your server-side code.
> Profile database queries and optimize slow-performing queries.

### <p align="center">Infrastructure Debugging:</p>

1. Server Configuration:
> Verify server configurations for web servers (e.g., Apache, Nginx).
> Check for any misconfigurations that may lead to issues.

2. Load Balancing:
> If applicable, check load balancing configurations.
> Ensure that requests are distributed evenly among server instances.

3. Firewall and Security:
> Check firewall settings for any restrictions.
> Verify that security configurations are not blocking legitimate requests.

4. Resource Monitoring:
> Monitor server resources (CPU, memory, disk space) to identify resource-related issues.
> Use tools like top or server monitoring services.