Skip to content

Instantly share code, notes, and snippets.

@namnv609
Created September 11, 2017 08:40
Show Gist options
  • Save namnv609/3747ad488934fb16caa53399bb435e57 to your computer and use it in GitHub Desktop.
Save namnv609/3747ad488934fb16caa53399bb435e57 to your computer and use it in GitHub Desktop.
Install Ruby on Rails server on CentOS 6

Install system requirements

  • sudo yum install wget git vim

Installation

  • Install Ruby and Bundler

    • sudo yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel readline-devel
    • wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz
    • tar -zxvf ruby-2.3.3.tar.gz
    • cd ruby-2.3.3
    • ./configure
    • make
    • sudo make install
    • gem update --system
    • gem install bundler
  • Install MySQL server 5.6

    • wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
    • rpm -ivh mysql-community-release-el6-5.noarch.rpm
    • yum install mysql-server mysql-devel
    • service mysqld start
      • Fix error /etc/init.d/mysqld: line 16: /etc/sysconfig/network: No such file or directory
        • wget http://elrepo.org/linux/elrepo/el6/x86_64/RPMS/kmod-alx-0.0-8.el6.elrepo.x86_64.rpm
        • rpm -ivh kmod-alx-0.0-8.el6.elrepo.x86_64.rpm
     cat > /etc/sysconfig/network << "EOF"
     > NETWORKING=yes
     > EOF
    
    • mysql_secure_installation
  • Install OpenSSH server

    • yum install openssh-server openssh-clients
    • chkconfig sshd on
    • service sshd start
    • OpenSSH Server Configuration
      • vim /etc/ssh/sshd_config
      • Edit some config same below
     MaxAuthTries 3
     RSAAuthentication yes
     PubkeyAuthentication yes
     ChallengeResponseAuthentication no
     PasswordAuthentication no
     UsePAM no
    
      * `mkdir .ssh`
      * `chmod 700 .ssh`
      * `cd .ssh`
      * `touch authorized_keys`
      * `chmod 600 authorized_keys`
    
    • service sshd restart
  • Install Node.JS

    • yum install epel-release
    • yum install nodejs
    • yum install npm
    • npm update -g npm
  • Install NginX

    • yum install nginx
    • service nginx start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment