-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathapache.sh
More file actions
executable file
·59 lines (51 loc) · 1.3 KB
/
Copy pathapache.sh
File metadata and controls
executable file
·59 lines (51 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# AUTHOR: Benjamin
# DATE: June 2017
# This apache installation script is intended to be run on a Centos OS.
# Please install a Centos VM first before running this script on it.
# _________________ APACHE AUTOMATED INSTALLATION ____________________
echo "Welcome to the Automated Apache Installation"
sleep 1
sudo yum install httpd -y
if [ $? -eq 0 ]
then
echo "Appache Package successfully installed"
else
echo "Appache Package installation failed. Please read the error message"
exit 2
fi
clear
echo "Please wait ..."
sudo systemctl start httpd
sudo systemctl enable httpd
if [ $? -ne 0 ]
then
echo "httpd installation failed. Please read the error message."
exit 6
fi
sudo systemctl status httpd
sleep 1
clear
sudo touch /var/www/html/index.html
sudo chmod 766 /var/www/html/index.html
echo "Please enter a content to display on your Web browser"
read content
echo "<h1> ${content} </h1>" >> /var/www/html/index.html
if [ $? -ne 0 ]
then
echo "Your Web browser configuration has failed. Please read the error message."
exit 9
fi
clear
sudo yum install net-tools -y
if [ $? -ne 0 ]
then
echo "Net-tools installation failed"
exit 5
fi
clear
ifconfig
echo "Please retrieve your IP address from eth1.
Open a browser and enter the IP address to test"
sleep 1
echo "Apache successfully installed - Thank you"