Last active
August 29, 2015 14:02
-
-
Save fasthold/c1531c634d5867b80f86 to your computer and use it in GitHub Desktop.
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
# 请注意修改部分参数,如安装mysql-server时,设置 MySQL root 密码,以便自动安装 | |
# 更换为aliyun的源镜像 | |
#mkdir ~/installations | |
#mkdir backups | |
#cd ~/installations | |
#https://gist.githubusercontent.com/fasthold/6d0ac7528a7c528eb886/raw/4cbd8f4709c3c4ec1d2fbbb3e4f3dd65e9694aab/ubuntu-12.04-server-aliyun-mirror.sources.list | |
#sudo mv /etc/apt/sources.list ~/installations/backups/sources.list | |
#sudo cp ~/installations/ubuntu-12.04-server-aliyun-mirror.sources.list /etc/apt/sources.list | |
# System related | |
sudo apt-get update | |
sudo apt-get -y install build-essential ssh curl software-properties-common python-software-properties python g++ make | |
# Editor | |
sudo apt-get -y install vim | |
# VCS | |
sudo apt-get -y install subversion git | |
# LAMP | |
## Added the PHP 5.5 repo | |
sudo add-apt-repository ppa:ondrej/php5 | |
sudo apt-get update | |
sudo apt-get upgrade | |
## Install apache2.4 | |
sudo apt-get -y install apache2 | |
sudo chmod 0777 /var/www | |
#sudo apt-get install mysql-server | |
# Install mysql-server and set the mysql root password | |
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password your_password' | |
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password your_password' | |
sudo apt-get -y install mysql-server | |
sudo apt-get -y install php5 php5-cli php5-gd php5-json php5-curl php5-mysql php5-xmlrpc libmcrypt-dev mcrypt php5-mcrypt libgd-tools libapache2-mod-php5 php5-imagick | |
# xdebug is only needed in development environment | |
#sudo apt-get -y install php5-xdebug | |
# Enable apache modules | |
sudo a2enmod rewrite | |
sudo a2enmod proxy | |
sudo a2enmod proxy_http | |
sudo a2enmod proxy_balancer | |
sudo apache2ctl restart | |
# Apps | |
sudo apt-get -y install imagemagick | |
# Install Composer | |
mkdir ~/installations -m 0777 | |
cd ~/installations | |
curl -sS https://getcomposer.org/installer | php | |
mv composer.phar /usr/local/bin/composer | |
# Node.js | |
sudo add-apt-repository -y ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get -y install nodejs | |
# Optional: install Fish shell. lauchpad 连不上的话,采用后面的方法安装 | |
#sudo apt-add-repository -y ppa:fish-shell/release-2 | |
#sudo apt-get update | |
#sudo apt-get -y install fish | |
# 官方deb包安装fish | |
#cd ~/installations | |
#wget http://fishshell.com/files/2.1.0/linux/Ubuntu/fish_2.1.0-1~precise_amd64.deb | |
#sudo dpkg -i fish_2.1.0-1~precise_amd64.deb | |
# configuration | |
# 自动下载一些设置 | |
cd ~/installations | |
mkdir backups | |
# PHP | |
wget https://gist.githubusercontent.com/fasthold/4530f13348e8dbf4b3bc/raw/8d197465aefe497e474efefad8dda14ffdbf1fc9/php-5.3.ini | |
sudo mv /etc/php5/apache2/php.ini ~/installations/backups/php.ini | |
sudo cp php-5.3.ini /etc/php5/apache2/php.ini | |
# Apache2 | |
wget https://gist.githubusercontent.com/fasthold/c97d12eee1027c1f731a/raw/6db6a5d562154f9ab4457d6747ef16ea81165c52/sites-enabled.conf | |
sudo cp /etc/apache2/sites-enabled/000-default ~/installations/backups/000-default | |
sudo cp -rf ~/installations/sites-enabled.conf /etc/apache2/sites-enabled/000-default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment