Skip to content

Commit

Permalink
0x12-web_stack_debugging_2
Browse files Browse the repository at this point in the history
0x12. Web stack debugging #2
  • Loading branch information
the1Riddle authored Dec 19, 2023
2 parents b6a60de + d7d166b commit 0252864
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
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)

0 comments on commit 0252864

Please sign in to comment.