Last active
January 4, 2016 19:50
-
-
Save roscius/8670446 to your computer and use it in GitHub Desktop.
Provision Ubuntu LAMP server
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 | |
| export LANGUAGE=en_US.UTF-8 | |
| export LANG=en_US.UTF-8 | |
| export LC_ALL=en_US.UTF-8 | |
| locale-gen en_US.UTF-8 | |
| dpkg-reconfigure locales | |
| sudo apt-get update | |
| sudo apt-get dist-upgrade -y | |
| sudo apt-get install -y python-software-properties python g++ make | |
| sudo add-apt-repository -y ppa:chris-lea/node.js | |
| # For 5.5, needs Apache 2.4 | |
| sudo add-apt-repository -y ppa:ondrej/php5 | |
| #php 5.4 | |
| #sudo add-apt-repository -y ppa:ondrej/php5-oldstable | |
| sudo apt-get update | |
| sudo apt-get dist-upgrade -y | |
| sudo apt-get install -y build-essential apache2 php5 php5-dev php-pear php5-json php5-sqlite \ | |
| php5-mysql php5-gd curl php5-curl memcached php5-memcached libmcrypt4 php5-mcrypt \ | |
| git vim nodejs php5-cli php-apc imagemagick php5-imagick | |
| sudo a2enmod rewrite | |
| sudo a2enmod headers | |
| sudo a2enmod expires | |
| #sudo a2enmod auth_basic | |
| #sudo a2enmod auth_digest | |
| sudo useradd -d /home/www -m www | |
| sudo chsh -s /bin/bash www | |
| #Change Apache to run as the www user | |
| sudo useradd -d /home/dave-m dave | |
| sudo chsh -s /bin/bash dave | |
| sudo mkdir /home/dave/.ssh | |
| sudo cp /root/.ssh/authorized_keys /home/dave/.ssh/authorized_keys | |
| sudo chown -R dave:dave /home/dave/ | |
| sudo sed -i "s/export APACHE_RUN_GROUP=www-data.*/export APACHE_RUN_GROUP=www/" /etc/apache2/envvars | |
| sudo sed -i "s/export APACHE_RUN_USER=www-data.*/export APACHE_RUN_USER=www/" /etc/apache2/envvars | |
| sudo chown www:root /var/lock/apache2/ | |
| sudo sed -i "s/#ServerRoot.*/ServerName ubuntu/" /etc/apache2/apache2.confsudo | |
| service apache2 restart | |
| sudo mkdir /home/projects/ | |
| sudo chown www:www /home/projects/ | |
| curl -sS https://getcomposer.org/installer | php | |
| sudo mv composer.phar /usr/local/bin/composer | |
| sudo wget http://laravel.com/laravel.phar | |
| sudo mv laravel.phar /usr/local/bin/laravel | |
| sudo npm install -g grunt-cli | |
| sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
| sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' | |
| sudo apt-get -y install mysql-server | |
| #create ssh key | |
| #cd ~ | |
| #mkdir .ssh | |
| #cd .ssh | |
| #ssh-keygen -f id_rsa -t rsa -N '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment