우분투에 Ruby / Nginx / Rails 설치하기
#Ruby 관련 라이브러리 설치
sudo -s
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
#Rbenv 설치하기
cd git clone git://github.com/sstephenson/rbenv.git .rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(rbenv init -)"' >> ~/.bash_profile git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile
vi ~/.gemrc
install: --no-rdoc --no-ri update: --no-rdoc --no-ri
rbenv install -v 2.5.0
rbenv global 2.5.0
ruby -v
echo "gem: --no-document" > ~/.gemrc
#Rails 설치하기
gem install bundler
gem install rails
rbenv rehash
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
#Mysql 설치하기
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
#Setting Database
mysql -p
mysql> CREATE DATABASE [database_name] CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
sudo /etc/init.d/mysql start
#Install nginx
sudo apt-get install nginx
#Install ElasticSearch
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo apt-get -y install oracle-java8-installer
java -version
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-2.2.0.deb
sudo dpkg -i elasticsearch-2.2.0.deb
service elasticsearch start
#Install Redis
sudo apt-get install build-essential tcl
cd /tmp
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable
make
sudo make install
cd utils
sudo ./install_server.sh
sudo service redis_6379 start
#Install Sendmail
sudo apt-get install sendmail
sudo vim /etc/hosts
127.0.1.1 yourhost yourhost
127.0.0.1 localhost
sudo sendmailconfig
#마지막 세팅
database.yml & secrets.yml 추가 후 수정하기
mkdir current/shared/sockets
mkdir current/shared/pids
nginx sites-enabled config 추가하기
++ Cert bot 사용 시 16.04 기준
https://certbot.eff.org/#ubuntuxenial-nginx
sudo apt-get install letsencrypt
letsencrypt certonly --standalone -d example.com
++ Rails 서버에서 console 이 실행안될 때
bundle exec rake rails:update:bin
++ Rbenv user 에게도 사용하도록
http://alexanderzagaynov.com/rbenv-shared-install-on-ubuntu-14-04/
sudo vim /etc/profile
export RBENV_ROOT=/usr/local/rbenv
export PATH="$RBENV_ROOT/bin:$PATH"
if which rbenv > /dev/null; then eval "$(rbenv init - --no-rehash)"; fi
'옛글 > Ubuntu' 카테고리의 다른 글
Ubuntu에 Swap memory 설정하기 (0) | 2017.10.19 |
---|---|
Mac -라즈베리파이 USB to USB 시리얼 젠더로 글자 띄우기 (0) | 2017.09.26 |
워드프레스 플러그인 FTP 사용하지 않고 설치하기 (0) | 2015.03.16 |
헷갈리는 Ubuntu 명령어들 (0) | 2015.01.20 |
Ubuntu 글자 다이아몬드 형태 깨짐 해결 (2) | 2015.01.16 |