Skip to content

Instantly share code, notes, and snippets.

@edhuardus
Created June 13, 2014 18:34
Show Gist options
  • Save edhuardus/f7d3bb00bcf3d83fd2df to your computer and use it in GitHub Desktop.
Save edhuardus/f7d3bb00bcf3d83fd2df to your computer and use it in GitHub Desktop.
Script-nginx RoR
comandos que se ejecutaron para instalar el servidor de linux:
Convertir en chef
sudo apt-get update
timezone=America/Mexico_City
sudo apt-get install ntp -y
sudo echo $timezone | sudo tee /etc/timezone
export LC_ALL=C
sudo dpkg-reconfigure --frontend noninteractive tzdata
sudo apt-get install git git-core mongodb htop libcurl4-openssl-dev imagemagick libmagics++-dev libmagickwand-dev nodejs -y
sudo mkdir /srv/www
sudo chgrp ubuntu /srv/www
sudo chmod 775 /srv/www
\curl -sSL https://get.rvm.io | bash
source /home/ubuntu/.rvm/scripts/rvm
rvm requirements
rvm install 1.9.3
git clone https://github.com/edhuardus/app.git
bundle install
##### only aap to login e.firma ####
1. https://github.com/jedisct1/libsodium
2. Download https://download.libsodium.org/libsodium/releases/libsodium-0.4.5.tar.gz
3. untar downloaded file
4. Run ./configure inside the folder extracted.
5. make && make check
6. sudo make install
7. Run ldconfig
#Para Ubuntu < 14.04
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
#Para Ubuntu 14.04
sudo gpg --export --armor 561F9B9CAC40B2F7 | sudo apt-key add -
sudo apt-get install apt-transport-https ca-certificates
sudo vim /etc/apt/sources.list.d/passenger.list
## add this
##### !!!! Only add ONE of these lines, not all of them !!!! #####
# Ubuntu 14.04
deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main
# Ubuntu 13.10
deb https://oss-binaries.phusionpassenger.com/apt/passenger saucy main
# Ubuntu 12.04
deb https://oss-binaries.phusionpassenger.com/apt/passenger precise main
# Ubuntu 10.04
deb https://oss-binaries.phusionpassenger.com/apt/passenger lucid main
# Debian 7
deb https://oss-binaries.phusionpassenger.com/apt/passenger wheezy main
# Debian 6
deb https://oss-binaries.phusionpassenger.com/apt/passenger squeeze main
sudo chown root: /etc/apt/sources.list.d/passenger.list
sudo chmod 600 /etc/apt/sources.list.d/passenger.list
sudo apt-get update
sudo apt-get install nginx-extras passenger -y
sudo service nginx restart
gem install passenger
sudo vim /etc/nginx/nginx.conf
add in the file nginx.conf
passenger_root /home/ubuntu/.rvm/gems/ruby-1.9.3-p545@app/gems/passenger-4.0.37;
/home/ubuntu/.rvm/gems/ruby-1.9.3-p545@app_two/gems/passenger-4.0.40
passenger_ruby /home/ubuntu/.rvm/wrappers/ruby-1.9.3-p545@app/ruby;
/home/ubuntu/.rvm/wrappers/ruby-1.9.3-p545@app_two/ruby;
passenger-config --root
cd /home/ubuntu/.rvm/gems/ruby-1.9.3-p545@app/gems/passenger-4.0.38
rake nginx
sudo vim /etc/nginx/sites-enabled/default
agregar
server {
listen 80;
server_name localhost;
root /srv/www/app/public;
passenger_enabled on;
rails_spawn_method smart;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
sudo service nginx restart
# install elasticsearch
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
sudo update-rc.d elasticsearch defaults 95 10
sudo mkdir /usr/share/elasticsearch
sudo /etc/init.d/elasticsearch start
curl -XGET 'localhost:9200/_analyze?analyzer=standard' -d 'this is a test'
###### Pastorinni Ochoa ####
## Eduardo Miramontes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment