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

0x12. Web stack debugging #2 #17

Merged
merged 4 commits into from
Dec 19, 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
5 changes: 5 additions & 0 deletions 0x12-web_stack_debugging_2/0-iamsomeoneelse
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Bash script that accepts one argument
# the script should run the whoami command under the user passed as an argument
# make sure to try your script by passing different users
sudo -u "$1" whoami
10 changes: 10 additions & 0 deletions 0x12-web_stack_debugging_2/1-run_nginx_as_nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# configuring a container to run nginx under nginx user on port 8080
# without using apt-get remove
chown nginx:nginx /etc/nginx/nginx.conf
chown nginx:nginx /etc/nginx/sites-available/default
chmod u+rwx /etc/nginx/nginx.conf
sed -i "s/#user www-data/user nginx/" /etc/nginx/nginx.conf
sed -i "s/80/8080/" /etc/nginx/sites-available/default
pkill apache2
su nginx service nginx restart
7 changes: 7 additions & 0 deletions 0x12-web_stack_debugging_2/100-fix_in_7_lines_or_less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# making task 1-run_nginx_as_nginx 7 lines long
sed -i "s/80 /8080 /g" /etc/nginx/sites-available/default
sed -i "s/#user www-data/user nginx/g" /etc/nginx/nginx.conf
chmod 755 /etc/nginx/nginx.conf
pkill -9 apache
su nginx -c "service nginx restart"
3 changes: 3 additions & 0 deletions 0x12-web_stack_debugging_2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Web stack debugging #2

![image](https://github.com/the1Riddle/alx-system_engineering-devops/assets/125451537/13765a00-ac14-419a-b1ca-da725430690b)