LoginSignup
1
0

More than 5 years have passed since last update.

CentOS6.5でMEAN 環境セットアップ備忘録

Last updated at Posted at 2015-10-06

ユーザー追加とRoot設定

# useradd testuser
# passwd testuser

# visudo
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
testuser ALL=(ALL) ALL

yumのアップデート

# yum update

主要なパッケージをインストール

# yum -y install vim git epel-release openssl-devel readline-devel zlib-devel zlib sqlite-devel gcc-c++ glibc-headers readline libffi-devel wget

最新版のlibyamlはインストール時にエラー吐くのでダウングレード

# yum downgrade libyaml
# yum install libyaml-devel

最新版のrubyをインストール

$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

$ source ~/.bash_profile
$ rbenv --version

$ rbenv install 2.2.3
$ rbenv global 2.2.3

$ ruby -v
インストールしたバージョンが返ってくればOK

sassプラグインをインストール

$ gem install sass

開発ツールをインストール

$ yum -y groupinstall "Development Tools"

Node.js,npmのインストール

gccのアップデート
$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
$ yum install devtoolset-2-gcc devtoolset-2-binutils
$ yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran
cd /opt/rh/devtoolset-2/root/usr/bin/
$ /opt/rh/devtoolset-2/root/usr/bin/gcc --version
$ scl enable devtoolset-2 bash
$ source /opt/rh/devtoolset-2/enable

$ wget http://nodejs.org/dist/node-latest.tar.gz
$ tar xvf node-latest.tar.gz
$ rm node-latest.tar.gz
$ cd node-hoge
$ ./configure
$ make
$ make install
$ node -v

MongoDBのインストール

MongoDBレポジトリの追加

$ vim /etc/yum.repos.d/mongodb.repo

/etc/yum.repos.d/mongodb.repo
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

MongoDBのインストール,起動,自動起動設定

$ yum -y install mongodb-org
$ service mongod start
$ chkconfig mongod on

nginxのインストール

nginxの最新版をインストールできるようにリポジトリを作成

$ rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

インストール

$ yum install nginx

MEAN構成ツールのインストール

$ yum install libpng-devel
$ npm install -g yo grunt-cli gulp bower

Angular-Fullstackジェネレーターのインストール(Grunt用)

$ npm install -g generator-angular-fullstack-jp

generator-gulp-angularジェネレーターのインストール(Gulp用)

$ npm install -g generator-gulp-angular

Appを設置するディレクトリを作成して移動

$ mkdir appName
$ cd appName

YEOMANの実行

yo
こけた場合は
$bower install & npm install

iptableの見直し

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0