Created
March 20, 2018 06:13
-
-
Save lucassrg/e136490a0b3da7de2620b71fd130340f to your computer and use it in GitHub Desktop.
Install Apache on OL7.x
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
#!/bin/bash | |
yum install -y httpd | |
systemctl enable httpd.service | |
systemctl start httpd.service | |
echo '<html><head></head><body><pre><code>' > /var/www/html/index.html | |
hostname >> /var/www/html/index.html | |
echo '' >> /var/www/html/index.html | |
cat /etc/os-release >> /var/www/html/index.html | |
echo '</code></pre></body></html>' >> /var/www/html/index.html | |
firewall-offline-cmd --add-service=http | |
systemctl enable firewalld | |
systemctl restart firewalld | |
echo 'done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment