Last active
August 29, 2015 14:23
-
-
Save ellipsonic/51533b197b1fc8b3f927 to your computer and use it in GitHub Desktop.
Apache with sample free HTML template shell
This file contains hidden or 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 | |
php_config_file="/etc/php5/apache2/php.ini" | |
xdebug_config_file="/etc/php5/mods-available/xdebug.ini" | |
mysql_config_file="/etc/mysql/my.cnf" | |
# Update the server | |
apt-get update | |
apt-get -y upgrade | |
apt-get install sudo | |
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://') | |
sed -i "s/^${IPADDR}.*//" /etc/hosts | |
echo $IPADDR ubuntu.localhost >> /etc/hosts # Just to quiet down some error messages | |
# Install basic tools | |
apt-get -y install build-essential binutils-doc git | |
# Install Apache | |
apt-get -y install apache2 | |
apt-get -y install php5 php5-curl php5-mysql php5-sqlite php5-xdebug | |
sed -i "s/display_startup_errors = Off/display_startup_errors = On/g" ${php_config_file} | |
sed -i "s/display_errors = Off/display_errors = On/g" ${php_config_file} | |
cat << EOF > ${xdebug_config_file} | |
zend_extension=xdebug.so | |
xdebug.remote_enable=1 | |
xdebug.remote_connect_back=1 | |
xdebug.remote_port=9000 | |
xdebug.remote_host=10.0.2.2 | |
EOF | |
# Restart Services | |
service apache2 restart | |
sudo add-apt-repository ppa:git-core/ppa | |
apt-get update | |
apt-get -y install git | |
apt-get -y install unzip | |
# Cleanup the default HTML file created by Apache | |
rm /var/www/html/index.html | |
cd /tmp | |
wget https://dl.dropboxusercontent.com/u/105401917/BlackTie/basic.zip | |
unzip basic.zip -d /var/www/html/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment