Apache AWS Ubuntu Install Script in Shell

#!/bin/bash # Set up our command aliases . /home/ubuntu/_install/sh/_alias.sh _update #_upgrade sudo apt-get install -y apache2 php5 libapache2-mod-php5 subversion ## # Bounce apache only if it's running ## SERVICE='apache' if ps ax | grep -v grep | grep $SERVICE > /dev/null then _bounce_web fi _update ## # Clean up and start the races for the app build ## _rm -rf /tmp/* _rm -f /var/www/html/index.html _write /var/www/html/index.php <<< '<?php' _append /var/www/html/index.php <<< "if($_SERVER['REMOTE_ADDR'] == '127.0.0.1') { phpinfo(); } else { echo 'Success!'; phpinfo(); }"

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.