-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Web stack debugging #2 | ||
|
||
 |