-
-
Save beansme/83fc48920fa89519cfbd to your computer and use it in GitHub Desktop.
Revisions
-
jtadeulopes revised this gist
Sep 11, 2015 . 1 changed file with 38 additions and 28 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -36,25 +36,23 @@ ubuntu ALL=NOPASSWD: ALL Edit `/etc/profile` ``` export PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin export RAILS_ENV=production export LC_ALL=en_US.UTF-8 ``` Edit `/etc/environment` ``` PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RAILS_ENV=production LC_ALL=en_US.UTF-8 ``` Edit `/etc/sudoers` ``` Defaults secure_path="/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ``` ## Some libraries for Mysql, ImageMagick, Node, etc @@ -67,7 +65,11 @@ sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs npm imagemagi ``` sudo apt-get install libyaml-dev libssl-dev libreadline-dev libxml2-dev libxslt1-dev libffi-dev build-essential ``` Compiled: ``` wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.gz tar xvfz ruby-2.1.4.tar.gz cd ruby-2.1.4/ @@ -77,30 +79,20 @@ sudo make install sudo gem install bundler ``` Package: ``` wget -q -O - http://apt.hellobits.com/hellobits.key | sudo apt-key add - echo 'deb [arch=amd64] http://apt.hellobits.com/ trusty main' | sudo tee /etc/apt/sources.list.d/hellobits.list sudo apt-get update sudo apt-get install ruby-2.2 sudo gem install bundler ``` ## GIT ``` sudo apt-get install git ``` ## VIM @@ -128,12 +120,25 @@ set shiftwidth=4 set expandtab ``` ## OpenSSL ``` cd /opt sudo wget http://www.openssl.org/source/openssl-1.0.1p.tar.gz sudo tar xvfz openssl-1.0.1p.tar.gz sudo mv openssl-1.0.1p openssl cd openssl/ sudo ./config sudo make sudo make install ``` ## Nginx ``` wget http://nginx.org/download/nginx-1.9.4.tar.gz tar xvfz nginx-1.9.4.tar.gz cd nginx-1.9.4/ ./configure --prefix=/opt/nginx --with-http_ssl_module --with-openssl=/opt/openssl sudo make sudo make install @@ -178,11 +183,16 @@ sudo adduser deploy ### SSH keys ``` sudo -iu deploy ssh-keygen -t rsa ``` ### Add authorized keys ``` cd vim .ssh/authorized_keys ``` ### Create folder to deploy the app -
jtadeulopes revised this gist
Nov 5, 2014 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -131,11 +131,11 @@ set expandtab ## Nginx ``` wget http://nginx.org/download/nginx-1.7.6.tar.gz tar xvfz nginx-1.7.6.tar.gz cd nginx-1.7.6/ ./configure --prefix=/opt/nginx --with-http_ssl_module --with-openssl=/opt/openssl sudo make sudo make install ``` -
jtadeulopes revised this gist
Nov 5, 2014 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -68,9 +68,9 @@ sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs npm imagemagi ``` sudo apt-get install libyaml-dev libssl-dev libreadline-dev libxml2-dev libxslt1-dev libffi-dev build-essential wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.gz tar xvfz ruby-2.1.4.tar.gz cd ruby-2.1.4/ ./configure --prefix=/opt/ruby --disable-install-rdoc make sudo make install @@ -94,9 +94,9 @@ sudo make install ``` cd /opt wget http://www.openssl.org/source/openssl-1.0.1j.tar.gz tar xvfz openssl-1.0.1j.tar.gz sudo mv openssl-1.0.1j openssl cd openssl/ ./config make -
jtadeulopes revised this gist
Jul 14, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -218,7 +218,7 @@ sudo (start|restart|stop) project ``` cd my/project/path/config Download the file https://gist.github.com/jtadeulopes/7265503 ``` ## Monit -
jtadeulopes revised this gist
Jul 10, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -244,6 +244,7 @@ Restart monit ``` sudo /etc/init.d/monit restart ``` ## Bower -
jtadeulopes revised this gist
Jul 10, 2014 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -243,4 +243,11 @@ set daemon 60 Restart monit ``` sudo /etc/init.d/monit restart ## Bower ``` sudo ln -s /usr/bin/nodejs /usr/bin/node sudo npm install -g bower ``` -
jtadeulopes revised this gist
Jul 9, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -74,7 +74,7 @@ cd ruby-2.1.2/ ./configure --prefix=/opt/ruby --disable-install-rdoc make sudo make install sudo gem install bundler ``` ## GIT -
jtadeulopes revised this gist
Jul 8, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -179,7 +179,7 @@ sudo adduser deploy ``` su deploy ssh-keygen -t rsa ``` See https://help.github.com/articles/generating-ssh-keys#platform-linux -
jtadeulopes revised this gist
Jul 8, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -74,6 +74,7 @@ cd ruby-2.1.2/ ./configure --prefix=/opt/ruby --disable-install-rdoc make sudo make install sudo gem install bundle ``` ## GIT @@ -176,6 +177,11 @@ sudo adduser deploy ### SSH keys ``` su deploy ssh-keygen -T rsa ``` See https://help.github.com/articles/generating-ssh-keys#platform-linux ### Create folder to deploy the app -
jtadeulopes revised this gist
Jun 20, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -60,7 +60,7 @@ Defaults secure_path="/opt/ruby/bin:/opt/nginx/sbin:/opt/ruby/gems/bin:/usr/loca ## Some libraries for Mysql, ImageMagick, Node, etc ``` sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs npm imagemagick libpq-dev ``` ## Ruby -
jtadeulopes revised this gist
May 23, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -68,9 +68,9 @@ sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs npm imagemagi ``` sudo apt-get install libyaml-dev libssl-dev libreadline-dev libxml2-dev libxslt1-dev libffi-dev build-essential wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz tar xvfz ruby-2.1.2.tar.gz cd ruby-2.1.2/ ./configure --prefix=/opt/ruby --disable-install-rdoc make sudo make install -
jtadeulopes revised this gist
May 6, 2014 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -92,9 +92,11 @@ sudo make install ## OpenSSL ``` cd /opt wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz tar xvfz openssl-1.0.1g.tar.gz sudo mv openssl-1.0.1g openssl cd openssl/ ./config make sudo make install @@ -131,7 +133,7 @@ set expandtab wget http://nginx.org/download/nginx-1.5.10.tar.gz tar xvfz nginx-1.5.10.tar.gz cd nginx-1.5.10/ ./configure --prefix=/opt/nginx --with-http_ssl_module --with-openssl=/opt/openssl make sudo make install ``` -
jtadeulopes revised this gist
Mar 12, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -60,7 +60,7 @@ Defaults secure_path="/opt/ruby/bin:/opt/nginx/sbin:/opt/ruby/gems/bin:/usr/loca ## Some libraries for Mysql, ImageMagick, Node, etc ``` sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs npm imagemagick ``` ## Ruby -
jtadeulopes revised this gist
Feb 24, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -60,7 +60,7 @@ Defaults secure_path="/opt/ruby/bin:/opt/nginx/sbin:/opt/ruby/gems/bin:/usr/loca ## Some libraries for Mysql, ImageMagick, Node, etc ``` sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs npm ``` ## Ruby -
jtadeulopes revised this gist
Feb 24, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -148,6 +148,7 @@ sudo mkdir /var/log/nginx sudo mkdir sites-enabled cd sites-enabled Download the file https://gist.github.com/jtadeulopes/7237731 Or with SSL support https://gist.github.com/jtadeulopes/9189120 ``` ### Upstart script -
jtadeulopes revised this gist
Feb 13, 2014 . 1 changed file with 22 additions and 15 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -68,9 +68,9 @@ sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs ``` sudo apt-get install libyaml-dev libssl-dev libreadline-dev libxml2-dev libxslt1-dev libffi-dev build-essential wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.0.tar.gz tar xvfz ruby-2.1.0.tar.gz cd ruby-2.1.0/ ./configure --prefix=/opt/ruby --disable-install-rdoc make sudo make install @@ -81,9 +81,9 @@ sudo make install ``` sudo apt-get build-dep git-core wget https://git-core.googlecode.com/files/git-1.8.5.4.tar.gz tar xvfz git-1.8.5.4.tar.gz cd git-1.8.5.4/ ./configure make sudo make install @@ -92,9 +92,9 @@ sudo make install ## OpenSSL ``` wget http://www.openssl.org/source/openssl-1.0.1f.tar.gz tar xvfz openssl-1.0.1f.tar.gz cd openssl-1.0.1f/ ./config make sudo make install @@ -104,7 +104,14 @@ sudo make install ### Syntax highlighting for Nginx in VIM ``` sudo mkdir /etc/vim/syntax sudo curl http://www.vim.org/scripts/download_script.php?src_id=14376 -o /etc/vim/syntax/nginx.vim cd /etc/vim Download de the file https://gist.github.com/jtadeulopes/8978872 ``` For more detail, see http://zduck.com/2012/syntax-highlighting-for-nginx-in-vim ### Global settings @@ -121,10 +128,10 @@ set expandtab ## Nginx ``` wget http://nginx.org/download/nginx-1.5.10.tar.gz tar xvfz nginx-1.5.10.tar.gz cd nginx-1.5.10/ ./configure --prefix=/opt/nginx --with-http_ssl_module --with-openssl=/home/ubuntu/src/openssl-1.0.1f/ make sudo make install ``` @@ -227,4 +234,4 @@ set daemon 60 Restart monit ``` sudo /etc/init.d/monit restart -
jtadeulopes revised this gist
Dec 11, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -218,7 +218,7 @@ cd /etc/monit/conf.d Download the file https://gist.github.com/jtadeulopes/7270279 ``` Edit `/etc/monit/monitrc` ``` set daemon 60 -
jtadeulopes revised this gist
Dec 11, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -158,16 +158,16 @@ sudo (start|restart|stop) nginx ## Deploy ### Add user ``` sudo adduser deploy ``` ### SSH keys See https://help.github.com/articles/generating-ssh-keys#platform-linux ### Create folder to deploy the app ``` -
jtadeulopes revised this gist
Dec 11, 2013 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -134,18 +134,20 @@ sudo make install ``` cd /opt/nginx/conf sudo rm nginx.conf Download the file https://gist.github.com/jtadeulopes/7237669 sudo mkdir /var/log/nginx sudo mkdir sites-enabled cd sites-enabled Download the file https://gist.github.com/jtadeulopes/7237731 ``` ### Upstart script ``` cd /etc/init Download the file https://gist.github.com/jtadeulopes/7237115 ``` Now, you can run: -
jtadeulopes revised this gist
Dec 11, 2013 . 1 changed file with 18 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,20 @@ sudo ntpdate ntp.ubuntu.com date ``` ### Create new user ``` sudo adduser ubuntu sudo adduser ubuntu sudo ``` Edit `/etc/sudoers` ``` %sudo ALL=(ALL:ALL) ALL ubuntu ALL=NOPASSWD: ALL ``` ## Environment variables Edit `/etc/profile` @@ -54,7 +68,7 @@ sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs ``` sudo apt-get install libyaml-dev libssl-dev libreadline-dev libxml2-dev libxslt1-dev libffi-dev build-essential wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz tar xvfz ruby-2.0.0-p247.tar.gz cd ruby-2.0.0-p247/ ./configure --prefix=/opt/ruby --disable-install-rdoc @@ -107,9 +121,9 @@ set expandtab ## Nginx ``` wget http://nginx.org/download/nginx-1.5.7.tar.gz tar xvfz nginx-1.5.7.tar.gz cd nginx-1.5.7/ ./configure --prefix=/opt/nginx --with-http_ssl_module --with-openssl=/home/ubuntu/src/openssl-1.0.1e/ make sudo make install @@ -212,4 +226,3 @@ Restart monit ``` sudo /etc/init.d/monit restart -
jtadeulopes revised this gist
Nov 28, 2013 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -198,7 +198,6 @@ sudo apt-get install monit **For each project, you must create the monit confg file** ``` cd /etc/monit/conf.d Download the file https://gist.github.com/jtadeulopes/7270279 ``` -
jtadeulopes revised this gist
Nov 28, 2013 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -173,8 +173,8 @@ https://gist.github.com/jtadeulopes/7249921 ``` cd /etc/init Download the file https://gist.github.com/jtadeulopes/7254953 ``` With the upstart for each project, you can run: @@ -191,15 +191,17 @@ wget https://gist.github.com/jtadeulopes/7265503/raw/25ce868f791fd0f79b7f4fe4be8 ## Monit ``` sudo apt-get install monit ``` **For each project, you must create the monit confg file** ``` sudo apt-get install monit cd /etc/monit/conf.d Download the file https://gist.github.com/jtadeulopes/7270279 ``` Edit `/etc/monitrc` -
jtadeulopes revised this gist
Nov 28, 2013 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -174,7 +174,7 @@ https://gist.github.com/jtadeulopes/7249921 ``` cd /etc/init ``` Download the file https://gist.github.com/jtadeulopes/7254953 With the upstart for each project, you can run: @@ -191,13 +191,16 @@ wget https://gist.github.com/jtadeulopes/7265503/raw/25ce868f791fd0f79b7f4fe4be8 ## Monit **For each project, you must create the monit confg file** ``` sudo apt-get install monit cd /etc/monit/conf.d ``` Download the file https://gist.github.com/jtadeulopes/7270279 Edit `/etc/monitrc` ``` @@ -208,4 +211,4 @@ Restart monit ``` sudo /etc/init.d/monit restart ``` -
jtadeulopes revised this gist
Nov 28, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -173,8 +173,8 @@ https://gist.github.com/jtadeulopes/7249921 ``` cd /etc/init ``` Download the gist https://gist.github.com/jtadeulopes/7254953#file-project-conf With the upstart for each project, you can run: -
jtadeulopes revised this gist
Nov 28, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -173,7 +173,7 @@ https://gist.github.com/jtadeulopes/7249921 ``` cd /etc/init Download the gist https://gist.github.com/jtadeulopes/7254953#file-project-conf ``` With the upstart for each project, you can run: -
jtadeulopes created this gist
Nov 1, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,211 @@ ## Update and upgrade the system ``` sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get autoremove sudo reboot ``` ## Configure timezone ``` sudo dpkg-reconfigure tzdata sudo apt-get install ntp sudo ntpdate ntp.ubuntu.com date ``` ## Environment variables Edit `/etc/profile` ``` export PATH=/opt/ruby/bin:/opt/nginx/sbin:/opt/ruby/gems/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin export RAILS_ENV=production export GEM_HOME=/opt/ruby/gems export LC_ALL=en_US.UTF-8 ``` Edit `/etc/environment` ``` PATH=/opt/ruby/bin:/opt/nginx/sbin:/opt/ruby/gems/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RAILS_ENV=production GEM_HOME=/opt/ruby/gems LC_ALL=en_US.UTF-8 ``` Edit `/etc/sudoers` ``` Defaults secure_path="/opt/ruby/bin:/opt/nginx/sbin:/opt/ruby/gems/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ``` ## Some libraries for Mysql, ImageMagick, Node, etc ``` sudo apt-get install libmagickwand-dev libmysqlclient15-dev nodejs ``` ## Ruby ``` sudo apt-get install libyaml-dev libssl-dev libreadline-dev libxml2-dev libxslt1-dev libffi-dev build-essential wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz tar xvfz ruby-2.0.0-p247.tar.gz cd ruby-2.0.0-p247/ ./configure --prefix=/opt/ruby --disable-install-rdoc make sudo make install ``` ## GIT ``` sudo apt-get build-dep git-core wget https://git-core.googlecode.com/files/git-1.8.4.2.tar.gz tar xvfz git-1.8.4.2.tar.gz cd git-1.8.4.2/ ./configure make sudo make install ``` ## OpenSSL ``` wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz tar xvfz openssl-1.0.1e.tar.gz cd openssl-1.0.1e/ ./config make sudo make install ``` ## VIM ### Syntax highlighting for Nginx in VIM See http://zduck.com/2012/syntax-highlighting-for-nginx-in-vim ### Global settings Edit `/etc/vim/vimrc` and add the lines below ``` set number set smartindent set tabstop=4 set shiftwidth=4 set expandtab ``` ## Nginx ``` wget http://nginx.org/download/nginx-1.4.1.tar.gz tar xvfz nginx-1.4.1.tar.gz cd nginx-1.4.1/ ./configure --prefix=/opt/nginx --with-http_ssl_module --with-openssl=/home/ubuntu/src/openssl-1.0.1e/ make sudo make install ``` ### Nginx settings ``` cd /opt/nginx/conf sudo rm nginx.conf sudo wget https://gist.github.com/jtadeulopes/7237669/raw/0e009788386cc42c6919892f508feb2b72ea991d/nginx.conf sudo mkdir sites-enabled cd sites-enabled sudo wget https://gist.github.com/jtadeulopes/7237731/raw/65ffd7a834c24f389ac06b96bd8492d80cc60259/localhost.conf ``` ### Upstart script ``` cd /etc/init sudo wget https://gist.github.com/jtadeulopes/7237115/raw/594f0904b8e52c7001430727b6925d6298258432/nginx.conf ``` Now, you can run: ``` sudo (start|restart|stop) nginx ``` ## Deploy ### SSH keys See https://help.github.com/articles/generating-ssh-keys#platform-linux ### Add user ``` sudo adduser deploy ``` ### Create folder to deploy the app ``` sudo mkdir /var/www sudo chown deploy:deploy -c -R /var/www ``` ### Capistrano `Capfile` https://gist.github.com/jtadeulopes/7249948 `deploy.rb` https://gist.github.com/jtadeulopes/7249921 ### Puma Upstart script **For each project, you must create the puma upstart file** ``` cd /etc/init sudo wget https://gist.github.com/jtadeulopes/7254953/raw/aa5a32b3713538dd84067e8ca633c5d78e75b3e4/project.conf ``` With the upstart for each project, you can run: ``` sudo (start|restart|stop) project ``` ### Puma config ``` cd my/project/path/config wget https://gist.github.com/jtadeulopes/7265503/raw/25ce868f791fd0f79b7f4fe4be81fd4b31f46b69/puma.rb ``` ## Monit ``` sudo apt-get install monit cd /etc/monit/conf.d wget https://gist.github.com/jtadeulopes/7270279/raw/61f438b221250b5a38dda7d947af03040442349a/project.conf ``` Edit `/etc/monitrc` ``` set daemon 60 ``` Restart monit ``` sudo /etc/init.d/monit restart ```