内容
やりたいことは、Rails(Productionモード)、Apache、Passenger、MYSQLで環境を構築すること
<1月24日からの記録パート1>
AWSでRubyとRailsで環境を構築するときのメモです。だらだらと書いてるだけなので、よみにくいです。
ただ、こういった読みにくいながらも色々と試した記録がたまにためになるときや参考になるときがあります。できればきちんとしたいけど、そんなエネルギーがないです。
AWSのアカウントを作成して、PUTTYで接続を確認した。
本当poderosaのほうがよかったけど、Ver5からシェアウェアになったので、フリーを使うことにした
その後
WEBサービスを開設する予定
まずは、EC2のセットアップでIAMユーザが必要らしい
AWS アカウントのメールアドレスとパスワードを使用して、AWS マネジメントコンソール に AWS アカウントのルートユーザーとしてサインインしてください。
キーペアまで作成したので、このキーでPUTTYで接続をします。
次はここから。2018年1月20日 11時30分
そして、PUTTYGENでキーを読み込んで秘密鍵を作成して、
PUTTYで設定をすればIAMユーザでのSSH接続ができるみたい。
Disconnected:No supported authentication methods available
IAMユーザでLINUXにログインできない
原因の一つは
IPアドレスの制限を解除する設定、セキュリティのところでアイフォンを使ってテザリングをしていたので、アイフォンのIPアドレスろ
設定した。これでROOT権限は接続できたけどIAMユーザではだめ
2つめは、IAMユーザのSSH接続を許可するのだそうです。
これで試してみる。
今はここから
AWS画面から
OpsWorksを選択しまs
というかIAMユーザがSSHでログインするためにはStackを追加してからでないとPermission
にIAMユーザのSSHの許可を設定できないみたい。
難しい。
その後
https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/managing-users.html
を読むとLinuxでルート権限(最初のアカウント)でまず、Linuxにログインをして新しいユーザを作成した。
ここではmaseではなくて、jhonとした。
sudo adduser jhone
sudo su -jhon
chmod 700 .ssh
touch .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
vi .ssh/authorized_keys
ここに、maseのパブリックキーをPuttyegenを起動して
貼り付ける。
そして、PuttyでJhonユーザログインしたらできた。
いままでmaseユーザでログインしようとしたのだけど
AWSの画面のユーザとLinuxのユーザは違うらしい。
知らんぞ。そんなのーーーーーーー
PODEROSA5が使いにくかったので、poderosa4.4にしようとしたら。.net3必要らしいので
コンパネから設定する方法(有効化とか無効)にしてもだめ。
更にネット検索をするとなんと一旦USBとかにZIPを展開してから
再度Cドライブにコピーするとよいと書いてあった。
試してみると本当だった。
なんだそりゃって感じ。セキュリティソフトが邪魔をしてるそうな。
—
その後
ユーザjhonでSUDOで実行しようとすると権限がなかった。
そこで、権限を与えようとしてもJhonへSUDOグループになっていない。
そこでJhonをSUDOグループに参加させる必要がある。
SUDOERSにWHEEL(SUDO)グループを設定するらしい。
一旦、JhonのパスワードをSUDOと同じにしておいた
次の作業は、
sudo yum install -y httpd
(この途中が保存できてない)
**************************************************************
会社と同じブラウザのエラー、secerts.ymlにキーを入れる
またログを見る。調べる
$ bundle exec rake secret
qnaiglfmugm82487yfam7y4qixm8734pt7bfdac6622(サンプルなので実際のものとは違う)
そして環境変数に
$export SECRET_KEY_BASE=
qnaiglfmugm82487yfam7y4qixm8734pt7bfdac662
これでもOK
$export SECRET_KEY_BASE=bundle exec rake secret
しかし、だめ
RAILS_ENV=production rake secret
を実行してみる 伏せ字
ed48dd0c73fe69371ac2d854257ad4a538118b44*****3a857888b6dd8c8eaf0f623800ccc859ec3b4193d86ee30abe7511dfbe2d92d96
だめ
こっちに入れてみることにした
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<VirtualHost *:80> ServerName foo-app.mkt-sys.jp:80 DocumentRoot /var/lib/rails/foo-app/public <Directory /var/lib/rails/foo-app/public/> SetEnv SECRET_KEY_BASE abcdefg...xyz #←ココ Options FollowSymLinks AllowOverride None Require all granted </Directory> PassengerEnabled on </VirtualHost> *** <VirtualHost *:80> ServerName 18.218.231.15 DocumentRoot /var/www/html/hiyoko/public <Directory /var/www/html/hiyoko/public/> SetEnv SECRET_KEY_BASE ed48dd0c73fe69371ac2d854257ad4a538118b4475404fecc810b72fb4ed7153a857888b6dd8c8eaf0f623800ccc859ec3b4193d86ee30abe7511dfbe2d92d96 Options FollowSymLinks AllowOverride None Require all granted </Directory> PassengerEnabled on </VirtualHost> |
とりあえず、バーチャルで次の段階へ進むが、今度はインターナル500エラーになった。
AM8:27 今日は有給休み
今度はパッセンジャーpassengerの権限がROOTではだめらしいが、他のファイルやパスはjhonがルート権限でいい場合と悪い場合があるらしい
error_logを調べると
[ W 2018-01-24 08:26:20.8109 13901/T1 age/Cor/CoreMain.cpp:897 ]: WARNING: potential privilege escalation vulnerability. Passenger is running as root, and part(s) of the passenger root path (/home/jhon/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/passenger-5.1.12) can be changed by non-root user(s):
「/home/jhon/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/passenger-5.1.12」:non-root user(s)
jhonがルート権限でいい場合と悪い場合があるらしい。じゃなくて、ROOT権限にしろということか。
apacheUserにしてみる
[ W 2018-01-24 08:26:20.8109 13901/T1 age/Cor/CoreMain.cpp:897 ]: WARNING: potential privilege escalation vulnerability. Passenger is running as root, and part(s) of the passenger root path
/home/jhon/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/passenger-5.1.12) can be changed by non-root user(s):
The path ”
/home/jhon/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/passenger-5.1.12″ can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems” can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0″ can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon/.rbenv/versions/2.4.3/lib/ruby/gems” can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon/.rbenv/versions/2.4.3/lib/ruby” can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon/.rbenv/versions/2.4.3/lib” can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon/.rbenv/versions/2.4.3″ can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon/.rbenv/versions” can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon/.rbenv” can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
The path ”
/home/jhon” can be modified by user “jhon” (or applications running as that user).
Change the owner of the path to root, or avoid running Passenger as root.
よくみるとJhonまでROOTにしろと言っているのはおかしい
なので、まずは.rbenvまでをROOTにしてみた
[root@ip-172-31-33-76 jhon]# chown root:root .rbenv
[root@ip-172-31-33-76 jhon]# ls -al
一応これも入れておく
httpd.confに
PassengerUserSwitching off
PassengerDefaultUser apache
だめ
だが、以前のようなROOT権限のエラーは消えた
次は
configuration error: couldn’t perform authentication. AuthType not set!
のエラーになった。
…
…
Require GET POST <<<これを削除すればよいらしい
でも今のAWSにその設定がない
と思ったら、自分でバーチャル設定をしたところに
あった
Require all granted <<<これをコメントにする
別のエラーがブラウザで出たが多分これは、一歩前進したほうだ。
多分パスの設定か何かがおかしい
「We’re sorry, but something went wrong.」
If you are the application owner check the logs for more information.
AM9時44分
次はここからだ
エラーログを見ると
Rails Error: Unable to access log fileのアクセス権の問題があるみたい
[ N 2018-01-24 09:41:36.7566 14397/T7 age/Cor/SecurityUpdateChecker.h:374 ]: Security update check: no update found (next check in 24 hours)
App 14425 stdout:
App 14425 stderr: Rails Error: Unable to access log file. Please ensure that /home/jhon/hiyoko/log/production.log exists and is writable (ie, make it writable for user and group: chmod 0664 /home/jhon/hiyoko/log/production.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
App 14441 stdout:
App 14425 stderr: Started GET “/users/show” for 110.3.248.146 at 2018-01-24 09:43:01 +0900
App 14425 stderr:
App 14425 stderr: Mysql2::Error (Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)):
まず、production.logの権限を666にしておく
1 2 |
[jhon@ip-172-31-33-76 log]$ chmod 666 production.log [jhon@ip-172-31-33-76 log]$ ls -al |
ログを見るとこのエラーは解消したみたい。
エラーがなかったので。
次は、mysql2のソケットエラーのようです。
そういえばMYSQLをインストールしたけど接続をしていない。
接続すれば、このソケットファイルが作成されるらしい。
だからだ。
まずはMYSQLに接続して、ちゃんとMYSQLのUserを作成しよう。
mysqlをインストールしたけれど、AWS設定でポートを開けなナイトいけないらしい
セキュリティグループでMYSQLのポートがあるのでそこを開ける
どうやらAWSのRDSでMYSQLを使う方法と、MYSQLをインストールして使う方法があるらしい。
今回は、MYSQLをインストールして使用する方法で進める
しかし
[jhon@ip-172-31-33-76 hiyoko]$ mysql -u root
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
[jhon@ip-172-31-33-76 hiyoko]$
単純に接続できてない。
MySQL を起動する
1 2 3 4 5 6 |
sudo service mysqld start 起動設定も入れる [jhon@ip-172-31-33-76 hiyoko]$ sudo chkconfig --add mysqld [jhon@ip-172-31-33-76 hiyoko]$ sudo chkconfig mysqld on [jhon@ip-172-31-33-76 hiyoko]$ |
ポートを確認
netstat で 3306 ポートが開放されているか確認。
sudo netstat -antu
その後再度
[jhon@ip-172-31-33-76 hiyoko]$ mysql -u root
とすると ちゃんと接続できた。
なんのことはない。MYSQLが起動していない。
だけだった。
次に
ROOTにパスワードを設定する
1 2 3 4 5 6 7 8 9 10 |
# mysql -u root mysql> update mysql.user set password=password('root用の任意パスワード') where user = 'root'; mysql> flush privileges; ← 変更を反映 mysql> exit; mysql -u rootで接続する ↓パスワードの***は伏せ字 mysql> update mysql.user set password=password('Mimata****') where user='root'; Query OK, 4 rows affected (0.01 sec) Rows matched: 4 Changed: 4 Warnings: 0 |
[jhon@ip-172-31-33-76 hiyoko]$ mysql -u root -p
これで先程のパスワードを入れる
今度はUserを設定してみる。ひよこと自分のUserを追加した(これだけではログインはできないので、
下の@localhostにも与える必要があることを忘れない)
GRANT ALL PRIVILEGES ON *.* TO hiyoko IDENTIFIED BY ‘Mimata1**’ WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO maseda IDENTIFIED BY ‘Mimata1**’ WITH GRANT OPTION
しかし、
mysql -u maseda -p
でログインできない。
アクセス拒否のエラーになる
[jhon@ip-172-31-33-76 hiyoko]$ mysql -u hiyoko -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘hiyoko’@’localhost’ (using password: YES)
[jhon@ip-172-31-33-76 hiyoko]$
こっちも実行しないといけないらしい
grant select on *.* to hiyoko@’localhost’ identified by ‘Mimata1****’;
grant select on *.* to maseda@’localhost’ identified by ‘Mimata1*’;
これで入れた。
MYSQLのUserも追加できた。
これでもう一度ブラウザにアクセスする。
次は
エラーログを見るとブラウザのエラーは同じで
エラーログは
今度は別のアクセス拒否になった
App 14425 stderr: Started GET “/users/show” for 110.3.248.146 at 2018-01-24 12:46:37 +0900
App 14425 stderr:
App 14425 stderr: Mysql2::Error (Access denied for user ‘hiyoko’@’localhost’ (using password: NO)):
App 14425 stderr: mysql2 (0.4.10) lib/mysql2/client.rb:89:in connect'
initialize’
App 14425 stderr: mysql2 (0.4.10) lib/mysql2/client.rb:89:in
ちなみにmysql -u hiyoko -p
では接続可能
もしかして、RAILS
のバージョンが上がってDBの作成まで進めないとだめなのかな?
config/database.yml
にパスワードが設定されていないから
production:
<<: *default
database: hiyoko_production
username: hiyoko >>あとでahiruにした
password: <%= ENV['HIYOKO_DATABASE_PASSWORD'] %>
見たらこんな感じで環境変数だった
defaultとproductionにパスワードを設定する。できれば違うパスワードが望ましいが、、、
パスワードの***は伏せ字です
export HIYOKO_DATABASE_PASSWORD=Mimata1***
実行する
これでまた実行してみる
これでもまだだめ。
またログを見る
同じエラーでアクセス拒否になる
rake db:create RAILS_ENV=production 実行すると同じアクセス拒否になった。
[jhon@ip-172-31-33-76 hiyoko]$ rake db:create RAILS_ENV=production
Mysql2::Error: Access denied for user ‘hiyoko’@’localhost’ to database ‘hiyoko_production’: CREATE DATABASE hiyoko_production
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci
ということは、DBの設定がおかしいのか?
ちゃんとproductionを見ていることは正しい。
もしかして、MYSQLですでにhiyokoを作ったことがいけないのか?
ということで、database.ymlに別のUserを設定してみる。
username:ahiruにしてから
rake db:create RAILS_ENV=production
を実行するとちょっと違う感じがでてきたが、これで良かったみたい
[jhon@ip-172-31-33-76 hiyoko]$ rake db:create RAILS_ENV=production
Access denied for user ‘ahiru’@’localhost’ (using password: YES)Please provide the root password for your MySQL installation
>Mimata** <<<パスワードを求められた。これってパスワードだよね
[jhon@ip-172-31-33-76 hiyoko]$ mysql -u root -p
Enter password:
これでDBを見ると
mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| hiyoko_production |
| mysql |
| performance_schema |
| test |
+——————–+
5 rows in set (0.00 sec)
mysql>
これでhiyoko_productionができたってことか?
mysql> use hiyoko_production;
Database changed
mysql> show tables;
Empty set (0.00 sec)
まだテーブルはない。確かにまだテーブルを作っていないから。
ということはアクセスができるようになったということか?
でもまだ改善されない。
エラーログを見ると
hiyokoがいる
App 14425 stderr: Started GET “/users/show” for 110.3.248.146 at 2018-01-24 13:27:32 +0900
App 14425 stderr:
App 14425 stderr: Mysql2::Error (Access denied for user ‘hiyoko’@’localhost’ (using password: NO)):
App 14425 stderr: mysql2 (0.4.10) lib/mysql2/client.rb:89:in connect'
MYSQLを見るとちゃんとアヒルもひよこもいる。これをみると別にRAILSで使うときは事前にUserを作る必要はないみたい
パスワードは伏せ字
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
mysql> select host,user,password from mysql.user; +-----------------+--------+-------------------------------------------+ | host | user | password | +-----------------+--------+-------------------------------------------+ | localhost | root | *ADD84DCE0***3D34**12A04 | | ip-172-31-33-76 | root | *ADD84DCE07896F8***D304DB3D**1E0412A04 | | 127.0.0.1 | root | *ADD84CE078****53FD30**4F1E0412A04 | | ::1 | root | *ADD84DCE07896F87A53F***4F1E0412A04 | | localhost | | | | ip-172-31-33-76 | | | | % | hiyoko | *ADD84D8***DB3D34F1E0412A04 | | % | maseda | *ADD84DCE896***DB3D34F1412A04 | | localhost | hiyoko | *ADD84DCE07896***3D34F10412A04 | | localhost | maseda | *ADD84CE0789***412A04 | | localhost | ahiru | *ADD84DCE07896F87***F1E0412A04 | +-----------------+--------+-------------------------------------------+ 11 rows in set (0.00 sec) |
困ったときの再起動
[jhon@ip-172-31-33-76 config]$ sudo su
[sudo] password for jhon:
[root@ip-172-31-33-76 config]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@ip-172-31-33-76 config]#
これで念のためにアクセスする
あれ。アクセス拒否のエラーがない
/etc/httpd/logs/error_log
[ N 2018-01-24 13:42:45.4718 21251/T7 age/Cor/SecurityUpdateChecker.h:374 ]: Security update check: no update found (next check in 24 hours)
App 21282 stdout:
App 21298 stdout:
でも、画面上の表示はだめ。
ままMYSQL周りはHTTPDの再起動でよくなったということだね。
なんかうまく行っているが、結果的な部分であともう少しかな
アクセスログでは
500エラー
500 1447は変わらない。
110.3.248.146 - - [24/Jan/2018:13:43:15 +0900] "GET /users/show HTTP/1.1" 500 1477 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
他のエラーログを探して見るか。
hiyoko folderのproduction.logだ
で見ると
今度は
ahiruユーザでアクセス拒否だ
Mysql2::Error (Access denied for user 'ahiru'@'localhost' (using password: NO)): mysql2 (0.4.10) lib/mysql2/client.rb:89:in connect’
もしかして、チュートリアルを進めればいいのかな。
>>>MYSQLで権限を与えるGrantする必要がありました。
ということでまずはすすめる
[jhon@ip-172-31-33-76 hiyoko]$ rails g model user name:string username:string location:string about:text
invoke active_record
create db/migrate/20180124050132_create_users.rb
create app/models/user.rb
invoke test_unit
create test/models/user_test.rb
create test/fixtures/users.yml
rake db:migrate RAILS_ENV=production
これでUserテーブルが作成されたみたい
[jhon@ip-172-31-33-76 hiyoko]$ rake db:migrate RAILS_ENV=production
== 20180124050132 CreateUsers: migrating ======================================
— create_table(:users)
-> 0.0047s
== 20180124050132 CreateUsers: migrated (0.0049s) =============================
[jhon@ip-172-31-33-76 hiyoko]$
MYSQLで作成されたかをahiruユーザで調べてみます
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
[jhon@ip-172-31-33-76 hiyoko]$ mysql -u ahiru -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 26 Server version: 5.5.58 MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | hiyoko_production | | test | +--------------------+ 3 rows in set (0.00 sec) mysql> use hiyoko_production; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +-----------------------------+ | Tables_in_hiyoko_production | +-----------------------------+ | schema_migrations | | users | +-----------------------------+ 2 rows in set (0.00 sec) mysql> select * from users; Empty set (0.00 sec) mysql> |
ちゃんとUsersテーブルが作成されていました。
hiyoko/log/production.logでエラーがわかります。
やっぱり同じエラーですね。あひるさんがアクセスできない。
今度はここだ。なにか設定がおかしい。時刻14時13分
I, [2018-01-24T14:09:31.475359 #21298] INFO — : Started GET “/users/show” for 110.3.248.146 at 2018-01-24 14:09:31 +0900
F, [2018-01-24T14:09:31.476865 #21298] FATAL — :
Mysql2::Error (Access denied for user ‘ahiru’@’localhost’ (using password: NO)):
もうちょっとだと思うんだけど、ユーザ設定だけだし。
もう一度Apache再起動とする
だめ
次は
config/database.ymlに以下のSOCKETを入れてみて(PRODUCTIONに)
development:
adapter: mysq2
encoding: utf8
username: ahiru(or hiyoko)
database: myapp_development
socket: /var/lib/mysql/mysql.sockこっちかも。こっちだね
または socket: ‘/tmp/mysql.sock’
変更した後に
service httpd restartをすると
今まで見なかったエラーになる。
make_sockでパーミッションのエラーだ。
[jhon@ip-172-31-33-76 config]$ service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
[jhon@ip-172-31-33-76 config]$
ソケットを書かなければ別のエラーになるので、接続自体はOKのはずなので、
この部分は削除して元に戻す。
それがだめなら、
MYSQLにROOTでログインしてから
SET PASSWORD FOR ‘username’@’localhost’ = PASSWORD(‘[password]’);
↓
SET PASSWORD FOR ‘ahiru’@’localhost’ = PASSWORD(‘Mima***’);
としてやってみる
mysql> SET password for ahiru@localhost = password(‘Mimata***’);(あえてシングルクォーテーションは入れていない)
Query OK, 0 rows affected (0.00 sec)
mysql>
これでまたHTTPDを再起動した。
だめ
なぜだ???
ahiruじゃなくてhiyokoにしてみる
またHTTPDを再起動してみる
だめ
I, [2018-01-24T16:12:59.777289 #25618] INFO — : Started GET “/users/show” for 110.3.248.146 at 2018-01-24 16:12:59 +0900
F, [2018-01-24T16:12:59.780950 #25618] FATAL — :
Mysql2::Error (Access denied for user ‘hiyoko’@’localhost’ (using password: NO)):
今度はhiyokoになっているので、ちゃんとdatabase.ymlの記述をチェックしているのは確か
ちゃんとMYSQLでログインできるのに、なぜかアクセスできない。
次は
パスワードを直打ちにしてみる。
パスワードを直打ちにしてみたら、さっきソケットをYMLに入力したときの
エラーと同じだ。>>結果はSUDOでHTTPDを再起動しなかっただけl
ということは、パスワードが消えた?だからログインできなかったんだ。
それで今度はパスワードが設定されたので次のエラーとなった。
TIME時刻午後4時32分
[jhon@ip-172-31-33-76 config]$ vi database.yml
[jhon@ip-172-31-33-76 config]$ service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
[jhon@ip-172-31-33-76 config]$
と思ったらSUDOでHTTPDを起動していないだけだった。
SUDO SERVICE HTTPD restartしたら起動した。
16:39
だめなら
ユーザをROOTに変えてみる
と思ったが、パスワードの直打ちでOKだった。
出たー!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
やっと
http://18.218.231.15/users/show
で
Users#show
Find me in app/views/users/show.html.erb」
が、画面に出た。
画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。
画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。画面に出た。
やっほーい。
今日お休みしたかいがありました。