スポンサーリンク

CentOS7.2でruby本番環境try6回目?

Windows8.1, VirtualBox2上のCentOS7.2で、やってみる。何回目かな?

http://tech-blog.gc-story.com/centos7-%E3%81%A7rails%E3%81%AE%E7%92%B0%E5%A2%83%E6%A7%8B%E7%AF%89

を見ながら。

(1)Windows8.1, VirtualBox, CentOS7.2

DVD-iso を、サーバーGUI(MariaDB2入り)をインストール。

ちなみに、isoは、

http://ftp.riken.jp/Linux/centos/7.2.1511/isos/x86_64/

image

から、.torrentをダウンロードして、Bit torrentでダウンロード?するほうが早い。(安全性についてはよくわかりません。)

ネットワークの設定は、VirtualBoxの法で、NATと、ホストオンリーアダプター を設定。

(2)『Guest Additions CD イメージの挿入』

http://qiita.com/100/items/80a899fbaeb1e82b3f67

を見ながら、

sudo yum -y upgrade
sudo yum -y install kernel-devel gcc
Guest Additionsのインストール

ここまで終わったところで、「centos72_mariadb」のクローンを作っておいた。

(3)そして、

http://tech-blog.gc-story.com/centos7-%E3%81%A7rails%E3%81%AE%E7%92%B0%E5%A2%83%E6%A7%8B%E7%AF%89

の再try。

mariadb-serverはインストールされているはずなので、インストールせず。

・・・

(4)また、mariaDBのところでエラー。

MysqlじゃなくてMariaDBだからかなと思い、下記のページを見ながらやってみる

——————
http://www.unix-power.net/centos7/mariadb.html
■MariaDBのインストール
——————

rpm -qa | grep maria

vim /etc/my.cnf

i

# instructions in http://fedoraproject.org/wiki/Systemd
の下に、
character-set-server=utf8

「Esc」:wq! 「Enter」

systemctl enable mariadb.service
systemctl start mariadb.service

mysql_secure_installation

とやったら、MariaDBできた。

ここで、MariaDBのrootのパスワードを設定。

image

(5)気を取り直して、

http://tech-blog.gc-story.com/centos7-%E3%81%A7rails%E3%81%AE%E7%92%B0%E5%A2%83%E6%A7%8B%E7%AF%89

を見ながら、

mysql –uroot –p

で上記で設定したパスワードを入力してログイン

select Host, User,Password from mysql.user;
create user ‘rails’@’localhost’ identified by ‘パスワード’;
grant all privileges on rails_app.* to ‘rails’@’localhost’ identified by ‘パスワード’;

quit

パスワード のところは英数字を入力する。

(6)どきどきしながら、nginxを起動しようとすると、

curl localhost

と入力すると、

image

エラーでアウト。

http://senoway.hatenablog.com/entry/2015/02/11/142139

を参考にしつつ、

firewall-cmd –add-port=80/tcp –zone=public –permanent

これでもダメ。

あれ、nginxをインストールしていなかったか?

sudo yum --enablerepo=epel -y install nginx $ systemctl start nginx.service

これがエラー。

image

http://www.server-memo.net/centos-settings/centos7/add-repo.html

を見て、、、

yum -y install epel-release
image
大丈夫だろうか。。。もう一度、
sudo yum --enablerepo=epel -y install nginx
$ systemctl start nginx.service
したら、動き出した。
image
でも、やっぱり、
curl localhost

をすると、エラー。しかし、

sudo systemctl enable nginx

sudo systemctl start nginx

すると、CentOS内から、localhostでも、

image

の画面を見ることはできた。

(7)

mkdir sample_app

sudo git clone https://adash333@bitbucket.org/adash333/sample_app.git

bitbucketのパスワードを聞かれるので入力すると、

image

cd sample_app

bundle install

ああ、エラー

image

gem install pg -v ‘0.17.1’

なんかまたグダグダになってきた。。。

とりあえず、ここで、

centos72_mariadb_nginxのクローン

で保存。

スポンサーリンク