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

linux.sh file updated #396

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion linux.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ echo "-----------------------------"
sleep 2
curl ifconfig.me

This is week 4 - project test
echo -e "\n===========================" && sleep 2
echo -e "This is week 4 - project test for \"$name\"\n Thank you"
38 changes: 38 additions & 0 deletions template
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# check and update system
sudo yum check-update
sudo yum -y update # -y bypass inquiry step and automatically execute update

# install Apache HTTP web server
sudo yum -y install httpd # install the Apache HTTP webserver

# start the web server
sudo systemctl start httpd # start the web server
sudo systemctl enable httpd # enable the server for start up upon (re)boot
sudo systemctl status httpd # check the server status


# change directory ownership so current user can write in webser directory
sudo chown -R $USER:$USER /var/www
# change webserver directory attribute for all users to access webpage content
sudo chmod -R 755 /var/www
cd /var/www/html/

# write index.html using echo statements below
echo "<!DOCTYPE html>" > index.html
echo "<html>" >> index.html
echo " <head>" >> index.html
echo " <title>Level It Up ~!!!</title>" >> index.html
echo " <meta charset=\"UTF-8\">" >> index.html
echo " </head>" >> index.html
echo " <body>" >> index.html
echo " <h2>Welcome to Level Up in Tech</h2>" >> index.html
echo " <h3>This web server is run on EC2 instance!!</h3>" >> index.html
echo " <h3>Date of creation: Feb. 10, 2023</h3>" >> index.html
echo " <h3>Date of correction: Feb. 11, 2023</h3>" >> index.html
curl ifconfig.me >> index.html
echo " <h4>Cheer Up, Gold Team!!</h4>" >> index.html
echo " </body>" >> index.html
echo "</html>" >> index.html
# cat /var/www/html/index.html