Skip to content

Instantly share code, notes, and snippets.

@lucassrg
Created March 20, 2018 06:13
Show Gist options
  • Save lucassrg/e136490a0b3da7de2620b71fd130340f to your computer and use it in GitHub Desktop.
Save lucassrg/e136490a0b3da7de2620b71fd130340f to your computer and use it in GitHub Desktop.
Install Apache on OL7.x
#!/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