Skip to content

Commit eb95e28

Browse files
committed
apache installation on start script
1 parent 4e662b1 commit eb95e28

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
#==========================================
4+
# INSTALL APACHE SERVER ON AMAZON LINUX 2
5+
#==========================================
6+
7+
# Get super user priviliges
8+
sudo su
9+
10+
#=== Update and Install httpd (Linux 2 Version) ===
11+
12+
# Updates instance (server)
13+
yum update -y
14+
# Install httpd.x86_64
15+
yum install -y httpd.x86_64
16+
# Start httpd service
17+
systemctl start httpd.service
18+
# Enables httpd service auto-restart if instance gets re-started
19+
systemctl enable http.service
20+
# -OPTIONAL: Overwrites apache welcome index.html file with instance name
21+
echo "$(hostname -f) is now running..." > /var/www/html/index.html

0 commit comments

Comments
 (0)