Last active
August 29, 2015 14:23
-
-
Save ellipsonic/4c3983417f9f14096779 to your computer and use it in GitHub Desktop.
Base apache shell
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 | |
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 | |
# Cleanup the default HTML file created by Apache | |
# rm /var/www/html/index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment