NODE.JSインストール
①nodejsのインストール
yum install nodejs npm --enablerepo=epel npm install -g n n stable
Apache Small lightの設定
CloudFrontとS3で画像配信をするにあたり、間にリサイズ処理を挟みたい。nginxを使った例も多々あったが、ミドルウェアの管理コストをかけたくないのでapacheで実現することにした。
①Image Magicのインストール
sudo yum install ImageMagick ImageMagick-devel
②imlib2のインストール
sudo yum install yum-plugin-priorities sudo yum install http://pkgs.repoforge.org/imlib2/imlib2-1.4.4-1.el6.rf.x86_64.rpm http://pkgs.repoforge.org/imlib2/imlib2-devel-1.4.4-1.el6.rf.x86_64.rpm
③httpd-develのインストール //apxs
sudo yum install httpd-devel
④small lightのインストール
cd /usr/local/src/ sudo wget http://smalllight.googlecode.com/files/mod_small_light-1.1.1.tar.gz sudo tar xvzf mod_small_light-1.1.1.tar.gz cd mod_small_light-1.1.1 sudo ./configure \ --with-apxs=/usr/sbin/apxs \ --with-imlib2-config=/usr/bin/imlib2-config \ --with-Wand-config=/usr/bin/Wand-config sudo make sudo make install chmod 755 /usr/lib64/httpd/modules/mod_small_light.so httpd -M
◻︎参考
Apacheの動的画像リサイズモジュール「smalllight」のmakeが通らなかったのを直してみた。 - コロタエンヂニアリング
yamac/smalllight · GitHub
AmazonLinuxにMronngaを入れる。
centos7だとyumで一発だけど。
Amazonlinuxだとなかなか入らず。。
結局ソースからビルドして入れることにした。
①ビルド環境の準備
$ sudo yum install gcc gcc-c++ make cmake
②Groongaのインストール
$ sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm $ sudo yum install mecab-devel $ sudo yum install groonga groonga-devel groonga-tokenizer-mecab groonga-normalizer-mysql groonga-normalizer-mysql-devel
※/etc/yum.repos.d/groonga.repoのbaseurlをhttp://packages.groonga.org/centos/6/$basearch/に変更
③Mysqlのビルド
1.グループとユーザを作成 $ sudo groupadd mysql $ sudo useradd -g mysql -d /usr/local/mysql mysql 2.ソースコードのダウンロード&展開 $ cd /usr/local/src $ sudo wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24.tar.gz $ sudo tar zxvf mysql-5.6.24.tar.gz 3.ソースのビルド $ sudo yum install ncurses-devel $ cd /usr/local/build/mysql-5.6.24 $ sudo cmake /usr/local/src/mysql-5.6.24 -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DWITH_EXTRA_CHARSETS=all -DDEFAULT_COLLATION=utf8_general_ci -DWITH_PIC=1 $ sudo make $ sudo make install 4.Mysqlの初期設定 $ sudo chown -R mysql:mysql /usr/local/mysql $ sudo yum install perl-ExtUtils-MakeMaker perl-Data-Dumper $ sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data $ sudo cp /usr/local/build/mysql-5.6.24/support-files/mysql.server /etc/init.d/mysql $ sudo chmod +x /etc/init.d/mysql $ sudo chkconfig --add mysql $ sudo chkconfig --list | grep mysql $ sudo vim /etc/init.d/mysql basedir=/usr/local/mysql datadir=/usr/local/mysql/data $ sudo cp /usr/local/build/mysql-5.6.24/support-files/my-default.cnf /etc/my.cnf
④Mronngaのビルド
$ sudo wget http://packages.groonga.org/source/mroonga/mroonga-5.01.tar.gz $ sudo tar xvzf mroonga-5.01.tar.gz $ cd mroonga-5.01 $ sudo ./configure --with-mysql-source=/usr/local/src/mysql-5.6.24 --with-mysql-build=/usr/local/build/mysql-5.6.24 --with-mysql-config=/usr/local/mysql/bin/mysql_config $ sudo make $ sudo make install $ sudo /usr/local/mysql/bin/mysql -u root < /usr/local/share/mroonga/install.sql $ mysql> SHOW ENGINES;
AWSでLAMP環境構築④
次はユーザ管理方法をまとめる。
1.ユーザの追加
$ sudo adduser <username>
2.ユーザの確認
$ cat /etc/passwd | grep home ec2-user:x:500:500::/home/ec2-user:/bin/bash <username>:x:501:501::/home/<username>:/bin/bash
3.ユーザのパスワードとsudo権限付与
$ sudo passwd <username> ユーザー <username> のパスワードを変更。 新しいパスワード: 新しいパスワードを再入力してください: passwd: 全ての認証トークンが正しく更新できました。 $ sudo visudo <username> ALL=(ALL) ALL // この行を追加
4.ユーザがログインできるようにする
$ sudo su - <username> // ユーザ切り替え $ mkdir .ssh // .sshディレクトリ作成 $ ls -al $ chmod 700 .ssh/ $ cd .ssh/ $ touch .ssh/authorized_keys $ chmod 600 .ssh/authorized_keys // 後は公開鍵の中身をログインしたい方から貰って貼り付ければOK
5.削除の手順 ※この機会なのでついでに
$ sudo userdel -r <username>
セキュリティは初めから意識しないと、後から大変。
AWSでLAMP環境構築③
前回に引き続きMysqlのセットアップを行う。
1.gronnga のインストール
$ sudo yum install -y http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm 読み込んだプラグイン:priorities, update-motd, upgrade-helper groonga-release-1.1.0-1.noarch.rpm | 6.2 kB 00:00 /var/tmp/yum-root-se6CaG/groonga-release-1.1.0-1.noarch.rpm を調べています: groonga-release-1.1.0-1.noarch /var/tmp/yum-root-se6CaG/groonga-release-1.1.0-1.noarch.rpm をインストール済みとして設定しています 依存性の解決をしています amzn-main/latest | 2.1 kB 00:00 amzn-updates/latest | 2.3 kB 00:00 --> トランザクションの確認を実行しています。 ---> パッケージ groonga-release.noarch 0:1.1.0-1 を インストール --> 依存性解決を終了しました。 依存性を解決しました ==================================================================================================================================== Package アーキテクチャー バージョン リポジトリー 容量 ==================================================================================================================================== インストール中: groonga-release noarch 1.1.0-1 /groonga-release-1.1.0-1.noarch 3.6 k トランザクションの要約 ==================================================================================================================================== インストール 1 パッケージ 合計容量: 3.6 k インストール容量: 3.6 k Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : groonga-release-1.1.0-1.noarch 1/1 検証中 : groonga-release-1.1.0-1.noarch 1/1 インストール: groonga-release.noarch 0:1.1.0-1 完了しました!
2.0.パッケージの更新前準備
sudo vim /etc/yum.repos.d/groonga.repo [groonga] name= for CentOS $releasever - $basearch baseurl=http://packages.groonga.org/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-groonga ここのbaseurlをいかに書き換える baseurl=http://packages.groonga.org/centos/6/$basearch/
2.パッケージの更新
$ sudo yum makecache 読み込んだプラグイン:priorities, update-motd, upgrade-helper amzn-main/latest | 2.1 kB 00:00 amzn-main/latest/filelists_db | 4.7 MB 00:00 amzn-main/latest/other_db | 16 MB 00:00 amzn-updates/latest | 2.3 kB 00:00 amzn-updates/latest/filelists_db | 215 kB 00:00 amzn-updates/latest/other_db | 729 kB 00:00 groonga/x86_64 | 2.5 kB 00:00 groonga/x86_64/filelists_db | 284 kB 00:00 groonga/x86_64/primary_db | 190 kB 00:00 groonga/x86_64/other_db | 239 kB 00:00 メタデータのキャッシュを作成しました
3.mysqlのインストール
$ sudo yum install -y mysql55-server 読み込んだプラグイン:priorities, update-motd, upgrade-helper 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ mysql55-server.x86_64 0:5.5.42-1.4.amzn1 を インストール --> 依存性の処理をしています: real-mysql55-common(x86-64) = 5.5.42-1.4.amzn1 のパッケージ: mysql55-server-5.5.42-1.4.amzn1.x86_64 --> 依存性の処理をしています: real-mysql55(x86-64) = 5.5.42-1.4.amzn1 のパッケージ: mysql55-server-5.5.42-1.4.amzn1.x86_64 --> 依存性の処理をしています: real-mysql55-libs(x86-64) = 5.5.42-1.4.amzn1 のパッケージ: mysql55-server-5.5.42-1.4.amzn1.x86_64 --> 依存性の処理をしています: perl(Data::Dumper) のパッケージ: mysql55-server-5.5.42-1.4.amzn1.x86_64 --> 依存性の処理をしています: perl(DBI) のパッケージ: mysql55-server-5.5.42-1.4.amzn1.x86_64 --> 依存性の処理をしています: perl-DBI のパッケージ: mysql55-server-5.5.42-1.4.amzn1.x86_64 --> 依存性の処理をしています: perl-DBD-MySQL のパッケージ: mysql55-server-5.5.42-1.4.amzn1.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ mysql55.x86_64 0:5.5.42-1.4.amzn1 を インストール ---> パッケージ mysql55-common.x86_64 0:5.5.42-1.4.amzn1 を インストール ---> パッケージ mysql55-libs.x86_64 0:5.5.42-1.4.amzn1 を インストール ---> パッケージ perl-DBD-MySQL.x86_64 0:4.023-5.17.amzn1 を インストール ---> パッケージ perl-DBI.x86_64 0:1.627-4.8.amzn1 を インストール --> 依存性の処理をしています: perl(RPC::PlClient) >= 0.2000 のパッケージ: perl-DBI-1.627-4.8.amzn1.x86_64 --> 依存性の処理をしています: perl(RPC::PlServer) >= 0.2001 のパッケージ: perl-DBI-1.627-4.8.amzn1.x86_64 ---> パッケージ perl-Data-Dumper.x86_64 0:2.145-3.5.amzn1 を インストール --> トランザクションの確認を実行しています。 ---> パッケージ perl-PlRPC.noarch 0:0.2020-14.7.amzn1 を インストール --> 依存性の処理をしています: perl(Net::Daemon) >= 0.13 のパッケージ: perl-PlRPC-0.2020-14.7.amzn1.noarch --> 依存性の処理をしています: perl(Compress::Zlib) のパッケージ: perl-PlRPC-0.2020-14.7.amzn1.noarch --> 依存性の処理をしています: perl(Net::Daemon::Test) のパッケージ: perl-PlRPC-0.2020-14.7.amzn1.noarch --> 依存性の処理をしています: perl(Net::Daemon::Log) のパッケージ: perl-PlRPC-0.2020-14.7.amzn1.noarch --> トランザクションの確認を実行しています。 ---> パッケージ perl-IO-Compress.noarch 0:2.061-2.12.amzn1 を インストール --> 依存性の処理をしています: perl(Compress::Raw::Zlib) >= 2.061 のパッケージ: perl-IO-Compress-2.061-2.12.amzn1.noarch --> 依存性の処理をしています: perl(Compress::Raw::Bzip2) >= 2.061 のパッケージ: perl-IO-Compress-2.061-2.12.amzn1.noarch ---> パッケージ perl-Net-Daemon.noarch 0:0.48-5.5.amzn1 を インストール --> トランザクションの確認を実行しています。 ---> パッケージ perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.11.amzn1 を インストール ---> パッケージ perl-Compress-Raw-Zlib.x86_64 1:2.061-4.1.amzn1 を インストール --> 依存性解決を終了しました。 依存性を解決しました ==================================================================================================================================== Package アーキテクチャー バージョン リポジトリー 容量 ==================================================================================================================================== インストール中: mysql55-server x86_64 5.5.42-1.4.amzn1 amzn-main 13 M 依存性関連でのインストールをします: mysql55 x86_64 5.5.42-1.4.amzn1 amzn-main 7.5 M mysql55-common x86_64 5.5.42-1.4.amzn1 amzn-main 48 k mysql55-libs x86_64 5.5.42-1.4.amzn1 amzn-main 813 k perl-Compress-Raw-Bzip2 x86_64 2.061-3.11.amzn1 amzn-main 33 k perl-Compress-Raw-Zlib x86_64 1:2.061-4.1.amzn1 amzn-main 61 k perl-DBD-MySQL x86_64 4.023-5.17.amzn1 amzn-main 148 k perl-DBI x86_64 1.627-4.8.amzn1 amzn-main 855 k perl-Data-Dumper x86_64 2.145-3.5.amzn1 amzn-main 49 k perl-IO-Compress noarch 2.061-2.12.amzn1 amzn-main 298 k perl-Net-Daemon noarch 0.48-5.5.amzn1 amzn-main 58 k perl-PlRPC noarch 0.2020-14.7.amzn1 amzn-main 39 k トランザクションの要約 ==================================================================================================================================== インストール 1 パッケージ (+11 個の依存関係のパッケージ) 総ダウンロード容量: 23 M インストール容量: 80 M Downloading packages: (1/12): mysql55-5.5.42-1.4.amzn1.x86_64.rpm | 7.5 MB 00:00 (2/12): mysql55-common-5.5.42-1.4.amzn1.x86_64.rpm | 48 kB 00:00 (3/12): mysql55-libs-5.5.42-1.4.amzn1.x86_64.rpm | 813 kB 00:00 (4/12): mysql55-server-5.5.42-1.4.amzn1.x86_64.rpm | 13 MB 00:00 (5/12): perl-Compress-Raw-Bzip2-2.061-3.11.amzn1.x86_64.rpm | 33 kB 00:00 (6/12): perl-Compress-Raw-Zlib-2.061-4.1.amzn1.x86_64.rpm | 61 kB 00:00 (7/12): perl-DBD-MySQL-4.023-5.17.amzn1.x86_64.rpm | 148 kB 00:00 (8/12): perl-DBI-1.627-4.8.amzn1.x86_64.rpm | 855 kB 00:00 (9/12): perl-Data-Dumper-2.145-3.5.amzn1.x86_64.rpm | 49 kB 00:00 (10/12): perl-IO-Compress-2.061-2.12.amzn1.noarch.rpm | 298 kB 00:00 (11/12): perl-Net-Daemon-0.48-5.5.amzn1.noarch.rpm | 58 kB 00:00 (12/12): perl-PlRPC-0.2020-14.7.amzn1.noarch.rpm | 39 kB 00:00 ------------------------------------------------------------------------------------------------------------------------------------ 合計 30 MB/s | 23 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : mysql55-libs-5.5.42-1.4.amzn1.x86_64 1/12 インストール中 : perl-Data-Dumper-2.145-3.5.amzn1.x86_64 2/12 インストール中 : mysql55-common-5.5.42-1.4.amzn1.x86_64 3/12 インストール中 : mysql55-5.5.42-1.4.amzn1.x86_64 4/12 インストール中 : perl-Compress-Raw-Bzip2-2.061-3.11.amzn1.x86_64 5/12 インストール中 : perl-Net-Daemon-0.48-5.5.amzn1.noarch 6/12 インストール中 : 1:perl-Compress-Raw-Zlib-2.061-4.1.amzn1.x86_64 7/12 インストール中 : perl-IO-Compress-2.061-2.12.amzn1.noarch 8/12 インストール中 : perl-PlRPC-0.2020-14.7.amzn1.noarch 9/12 インストール中 : perl-DBI-1.627-4.8.amzn1.x86_64 10/12 インストール中 : perl-DBD-MySQL-4.023-5.17.amzn1.x86_64 11/12 インストール中 : mysql55-server-5.5.42-1.4.amzn1.x86_64 12/12 検証中 : mysql55-server-5.5.42-1.4.amzn1.x86_64 1/12 検証中 : perl-DBI-1.627-4.8.amzn1.x86_64 2/12 検証中 : mysql55-common-5.5.42-1.4.amzn1.x86_64 3/12 検証中 : perl-IO-Compress-2.061-2.12.amzn1.noarch 4/12 検証中 : mysql55-libs-5.5.42-1.4.amzn1.x86_64 5/12 検証中 : perl-DBD-MySQL-4.023-5.17.amzn1.x86_64 6/12 検証中 : 1:perl-Compress-Raw-Zlib-2.061-4.1.amzn1.x86_64 7/12 検証中 : perl-Net-Daemon-0.48-5.5.amzn1.noarch 8/12 検証中 : perl-Compress-Raw-Bzip2-2.061-3.11.amzn1.x86_64 9/12 検証中 : perl-PlRPC-0.2020-14.7.amzn1.noarch 10/12 検証中 : perl-Data-Dumper-2.145-3.5.amzn1.x86_64 11/12 検証中 : mysql55-5.5.42-1.4.amzn1.x86_64 12/12 インストール: mysql55-server.x86_64 0:5.5.42-1.4.amzn1 依存性関連をインストールしました: mysql55.x86_64 0:5.5.42-1.4.amzn1 mysql55-common.x86_64 0:5.5.42-1.4.amzn1 mysql55-libs.x86_64 0:5.5.42-1.4.amzn1 perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.11.amzn1 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.1.amzn1 perl-DBD-MySQL.x86_64 0:4.023-5.17.amzn1 perl-DBI.x86_64 0:1.627-4.8.amzn1 perl-Data-Dumper.x86_64 0:2.145-3.5.amzn1 perl-IO-Compress.noarch 0:2.061-2.12.amzn1 perl-Net-Daemon.noarch 0:0.48-5.5.amzn1 perl-PlRPC.noarch 0:0.2020-14.7.amzn1 完了しました!
4.mysqlサーバ起動
$ sudo /etc/init.d/mysql.d start MySQL データベースを初期化中: Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h ip-172-31-36-70 password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems at http://bugs.mysql.com/ [ OK ] mysqld を起動中: [ OK ]
5.mronngaのインストール
sudo yum install -y mysql55-mroonga
読み込んだプラグイン:priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
依存性の解決をしています
-
- > トランザクションの確認を実行しています。
- > パッケージ mysql55-mroonga.x86_64 0:5.01-1.el6 を インストール
- > 依存性の処理をしています: mysql55-mysql-server = 5.5.41-2.el6.centos.alt のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > 依存性の処理をしています: mysql55-mysql = 5.5.41-2.el6.centos.alt のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > 依存性の処理をしています: groonga-libs >= 5.0.0 のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > 依存性の処理をしています: mysql55-runtime のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > 依存性の処理をしています: groonga-normalizer-mysql のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > 依存性の処理をしています: libgroonga.so.0()(64bit) のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > トランザクションの確認を実行しています。
- > 依存性の処理をしています: mysql55-mysql-server = 5.5.41-2.el6.centos.alt のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > 依存性の処理をしています: mysql55-mysql = 5.5.41-2.el6.centos.alt のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > 依存性の処理をしています: mysql55-runtime のパッケージ: mysql55-mroonga-5.01-1.el6.x86_64
- > 依存性解決を終了しました。
- > トランザクションの確認を実行しています。
エラー: パッケージ: mysql55-mroonga-5.01-1.el6.x86_64 (groonga)
要求: mysql55-mysql = 5.5.41-2.el6.centos.alt
エラー: パッケージ: mysql55-mroonga-5.01-1.el6.x86_64 (groonga)
要求: mysql55-mysql-server = 5.5.41-2.el6.centos.alt
エラー: パッケージ: mysql55-mroonga-5.01-1.el6.x86_64 (groonga)
要求: mysql55-runtime
問題を回避するために --skip-broken を用いることができます。
これらを試行できます: rpm -Va --nofiles --nodigestyum
AWSでLAMP環境構築②
Webサーバの構築に取り掛かる。
EC2でインスタンスを作成する。
OSはCentOSを選択。
1.まずはパッケージの最新化。
$ sudo yum update 読み込んだプラグイン:amazon-id, rhui-lb, security 更新処理の設定をしています rhui-REGION-client-config-server-6 | 2.9 kB 00:00 rhui-REGION-client-config-server-6/primary_db | 4.7 kB 00:00 rhui-REGION-rhel-server-releases | 3.7 kB 00:00 rhui-REGION-rhel-server-releases/primary_db | 31 MB 00:00 rhui-REGION-rhel-server-rh-common | 1.9 kB 00:00 rhui-REGION-rhel-server-rh-common/primary | 24 kB 00:00 rhui-REGION-rhel-server-rh-common 90/90 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> Package at.x86_64 0:3.1.10-44.el6_4.1 will be 更新 ---> Package at.x86_64 0:3.1.10-44.el6_6.2 will be an update ---> Package busybox.x86_64 1:1.15.1-20.el6 will be 更新 ---> Package busybox.x86_64 1:1.15.1-21.el6_6 will be an update ---> Package curl.x86_64 0:7.19.7-40.el6_6.3 will be 更新 ---> Package curl.x86_64 0:7.19.7-40.el6_6.4 will be an update ---> Package kpartx.x86_64 0:0.4.9-80.el6_6.2 will be 更新 ---> Package kpartx.x86_64 0:0.4.9-80.el6_6.3 will be an update ---> Package libcurl.x86_64 0:7.19.7-40.el6_6.3 will be 更新 ---> Package libcurl.x86_64 0:7.19.7-40.el6_6.4 will be an update ---> Package libssh2.x86_64 0:1.4.2-1.el6 will be 更新 ---> Package libssh2.x86_64 0:1.4.2-1.el6_6.1 will be an update ---> Package libyaml.x86_64 0:0.1.3-1.4.el6 will be 更新 ---> Package libyaml.x86_64 0:0.1.3-4.el6_6 will be an update ---> Package nss-softokn.x86_64 0:3.14.3-19.el6_6 will be 更新 ---> Package nss-softokn.x86_64 0:3.14.3-22.el6_6 will be an update ---> Package nss-softokn-freebl.x86_64 0:3.14.3-19.el6_6 will be 更新 ---> Package nss-softokn-freebl.x86_64 0:3.14.3-22.el6_6 will be an update ---> Package ql2400-firmware.noarch 0:7.03.00-1.el6 will be 更新 ---> Package ql2400-firmware.noarch 0:7.03.00-1.el6_5 will be an update ---> Package ql2500-firmware.noarch 0:7.03.00-1.el6 will be 更新 ---> Package ql2500-firmware.noarch 0:7.03.00-1.el6_5 will be an update ---> Package tcsh.x86_64 0:6.17-24.el6 will be 更新 ---> Package tcsh.x86_64 0:6.17-25.el6_6 will be an update ---> Package tzdata.noarch 0:2014j-1.el6 will be 更新 ---> Package tzdata.noarch 0:2015a-1.el6 will be an update ---> Package tzdata-java.noarch 0:2014j-1.el6 will be 更新 ---> Package tzdata-java.noarch 0:2015a-1.el6 will be an update ---> Package yum-rhn-plugin.noarch 0:0.9.1-50.el6 will be 更新 ---> Package yum-rhn-plugin.noarch 0:0.9.1-52.el6_6 will be an update --> 依存性解決を終了しました。 依存性を解決しました =============================================================================================================================== パッケージ アーキテクチャ バージョン リポジトリー 容量 =============================================================================================================================== 更新: at x86_64 3.1.10-44.el6_6.2 rhui-REGION-rhel-server-releases 61 k busybox x86_64 1:1.15.1-21.el6_6 rhui-REGION-rhel-server-releases 612 k curl x86_64 7.19.7-40.el6_6.4 rhui-REGION-rhel-server-releases 194 k kpartx x86_64 0.4.9-80.el6_6.3 rhui-REGION-rhel-server-releases 63 k libcurl x86_64 7.19.7-40.el6_6.4 rhui-REGION-rhel-server-releases 166 k libssh2 x86_64 1.4.2-1.el6_6.1 rhui-REGION-rhel-server-releases 123 k libyaml x86_64 0.1.3-4.el6_6 rhui-REGION-rhel-server-releases 52 k nss-softokn x86_64 3.14.3-22.el6_6 rhui-REGION-rhel-server-releases 262 k nss-softokn-freebl x86_64 3.14.3-22.el6_6 rhui-REGION-rhel-server-releases 167 k ql2400-firmware noarch 7.03.00-1.el6_5 rhui-REGION-rhel-server-releases 94 k ql2500-firmware noarch 7.03.00-1.el6_5 rhui-REGION-rhel-server-releases 118 k tcsh x86_64 6.17-25.el6_6 rhui-REGION-rhel-server-releases 414 k tzdata noarch 2015a-1.el6 rhui-REGION-rhel-server-releases 440 k tzdata-java noarch 2015a-1.el6 rhui-REGION-rhel-server-releases 175 k yum-rhn-plugin noarch 0.9.1-52.el6_6 rhui-REGION-rhel-server-releases 80 k トランザクションの要約 =============================================================================================================================== アップグレード 15 パッケージ 総ダウンロード容量: 2.9 M これでいいですか? [y/N]y パッケージをダウンロードしています: (1/15): at-3.1.10-44.el6_6.2.x86_64.rpm | 61 kB 00:00 (2/15): busybox-1.15.1-21.el6_6.x86_64.rpm | 612 kB 00:00 (3/15): curl-7.19.7-40.el6_6.4.x86_64.rpm | 194 kB 00:00 (4/15): kpartx-0.4.9-80.el6_6.3.x86_64.rpm | 63 kB 00:00 (5/15): libcurl-7.19.7-40.el6_6.4.x86_64.rpm | 166 kB 00:00 (6/15): libssh2-1.4.2-1.el6_6.1.x86_64.rpm | 123 kB 00:00 (7/15): libyaml-0.1.3-4.el6_6.x86_64.rpm | 52 kB 00:00 (8/15): nss-softokn-3.14.3-22.el6_6.x86_64.rpm | 262 kB 00:00 (9/15): nss-softokn-freebl-3.14.3-22.el6_6.x86_64.rpm | 167 kB 00:00 (10/15): ql2400-firmware-7.03.00-1.el6_5.noarch.rpm | 94 kB 00:00 (11/15): ql2500-firmware-7.03.00-1.el6_5.noarch.rpm | 118 kB 00:00 (12/15): tcsh-6.17-25.el6_6.x86_64.rpm | 414 kB 00:00 (13/15): tzdata-2015a-1.el6.noarch.rpm | 440 kB 00:00 (14/15): tzdata-java-2015a-1.el6.noarch.rpm | 175 kB 00:00 (15/15): yum-rhn-plugin-0.9.1-52.el6_6.noarch.rpm | 80 kB 00:00 ------------------------------------------------------------------------------------------------------------------------------- 合計 2.8 MB/s | 2.9 MB 00:01 rpm_check_debug を実行しています トランザクションのテストを実行しています トランザクションのテストを成功しました トランザクションを実行しています 更新 : libssh2-1.4.2-1.el6_6.1.x86_64 1/30 更新 : libcurl-7.19.7-40.el6_6.4.x86_64 2/30 更新 : nss-softokn-freebl-3.14.3-22.el6_6.x86_64 3/30 更新 : nss-softokn-3.14.3-22.el6_6.x86_64 4/30 更新 : curl-7.19.7-40.el6_6.4.x86_64 5/30 更新 : ql2400-firmware-7.03.00-1.el6_5.noarch 6/30 更新 : tcsh-6.17-25.el6_6.x86_64 7/30 更新 : at-3.1.10-44.el6_6.2.x86_64 8/30 更新 : yum-rhn-plugin-0.9.1-52.el6_6.noarch 9/30 更新 : kpartx-0.4.9-80.el6_6.3.x86_64 10/30 更新 : 1:busybox-1.15.1-21.el6_6.x86_64 11/30 更新 : ql2500-firmware-7.03.00-1.el6_5.noarch 12/30 更新 : tzdata-2015a-1.el6.noarch 13/30 更新 : libyaml-0.1.3-4.el6_6.x86_64 14/30 更新 : tzdata-java-2015a-1.el6.noarch 15/30 整理中 : ql2400-firmware-7.03.00-1.el6.noarch 16/30 整理中 : yum-rhn-plugin-0.9.1-50.el6.noarch 17/30 整理中 : 1:busybox-1.15.1-20.el6.x86_64 18/30 整理中 : ql2500-firmware-7.03.00-1.el6.noarch 19/30 整理中 : tzdata-2014j-1.el6.noarch 20/30 整理中 : tzdata-java-2014j-1.el6.noarch 21/30 整理中 : curl-7.19.7-40.el6_6.3.x86_64 22/30 整理中 : libcurl-7.19.7-40.el6_6.3.x86_64 23/30 整理中 : nss-softokn-3.14.3-19.el6_6.x86_64 24/30 整理中 : nss-softokn-freebl-3.14.3-19.el6_6.x86_64 25/30 整理中 : libssh2-1.4.2-1.el6.x86_64 26/30 整理中 : tcsh-6.17-24.el6.x86_64 27/30 整理中 : at-3.1.10-44.el6_4.1.x86_64 28/30 整理中 : kpartx-0.4.9-80.el6_6.2.x86_64 29/30 整理中 : libyaml-0.1.3-1.4.el6.x86_64 30/30 Verifying : tzdata-java-2015a-1.el6.noarch 1/30 Verifying : libyaml-0.1.3-4.el6_6.x86_64 2/30 Verifying : tzdata-2015a-1.el6.noarch 3/30 Verifying : curl-7.19.7-40.el6_6.4.x86_64 4/30 Verifying : libcurl-7.19.7-40.el6_6.4.x86_64 5/30 Verifying : nss-softokn-3.14.3-22.el6_6.x86_64 6/30 Verifying : ql2500-firmware-7.03.00-1.el6_5.noarch 7/30 Verifying : nss-softokn-freebl-3.14.3-22.el6_6.x86_64 8/30 Verifying : 1:busybox-1.15.1-21.el6_6.x86_64 9/30 Verifying : kpartx-0.4.9-80.el6_6.3.x86_64 10/30 Verifying : yum-rhn-plugin-0.9.1-52.el6_6.noarch 11/30 Verifying : at-3.1.10-44.el6_6.2.x86_64 12/30 Verifying : libssh2-1.4.2-1.el6_6.1.x86_64 13/30 Verifying : tcsh-6.17-25.el6_6.x86_64 14/30 Verifying : ql2400-firmware-7.03.00-1.el6_5.noarch 15/30 Verifying : 1:busybox-1.15.1-20.el6.x86_64 16/30 Verifying : ql2400-firmware-7.03.00-1.el6.noarch 17/30 Verifying : kpartx-0.4.9-80.el6_6.2.x86_64 18/30 Verifying : libssh2-1.4.2-1.el6.x86_64 19/30 Verifying : at-3.1.10-44.el6_4.1.x86_64 20/30 Verifying : yum-rhn-plugin-0.9.1-50.el6.noarch 21/30 Verifying : tcsh-6.17-24.el6.x86_64 22/30 Verifying : tzdata-java-2014j-1.el6.noarch 23/30 Verifying : libyaml-0.1.3-1.4.el6.x86_64 24/30 Verifying : libcurl-7.19.7-40.el6_6.3.x86_64 25/30 Verifying : ql2500-firmware-7.03.00-1.el6.noarch 26/30 Verifying : nss-softokn-freebl-3.14.3-19.el6_6.x86_64 27/30 Verifying : curl-7.19.7-40.el6_6.3.x86_64 28/30 Verifying : tzdata-2014j-1.el6.noarch 29/30 Verifying : nss-softokn-3.14.3-19.el6_6.x86_64 30/30 更新: at.x86_64 0:3.1.10-44.el6_6.2 busybox.x86_64 1:1.15.1-21.el6_6 curl.x86_64 0:7.19.7-40.el6_6.4 kpartx.x86_64 0:0.4.9-80.el6_6.3 libcurl.x86_64 0:7.19.7-40.el6_6.4 libssh2.x86_64 0:1.4.2-1.el6_6.1 libyaml.x86_64 0:0.1.3-4.el6_6 nss-softokn.x86_64 0:3.14.3-22.el6_6 nss-softokn-freebl.x86_64 0:3.14.3-22.el6_6 ql2400-firmware.noarch 0:7.03.00-1.el6_5 ql2500-firmware.noarch 0:7.03.00-1.el6_5 tcsh.x86_64 0:6.17-25.el6_6 tzdata.noarch 0:2015a-1.el6 tzdata-java.noarch 0:2015a-1.el6 yum-rhn-plugin.noarch 0:0.9.1-52.el6_6 完了しました!
2.次にhttpdのインストール
$ sudo yum install httpd 読み込んだプラグイン:amazon-id, rhui-lb, security インストール処理の設定をしています 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> Package httpd.x86_64 0:2.2.15-39.el6 will be インストール --> 依存性の処理をしています: httpd-tools = 2.2.15-39.el6 のパッケージ: httpd-2.2.15-39.el6.x86_64 --> 依存性の処理をしています: apr-util-ldap のパッケージ: httpd-2.2.15-39.el6.x86_64 --> 依存性の処理をしています: libaprutil-1.so.0()(64bit) のパッケージ: httpd-2.2.15-39.el6.x86_64 --> 依存性の処理をしています: libapr-1.so.0()(64bit) のパッケージ: httpd-2.2.15-39.el6.x86_64 --> トランザクションの確認を実行しています。 ---> Package apr.x86_64 0:1.3.9-5.el6_2 will be インストール ---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be インストール ---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be インストール ---> Package httpd-tools.x86_64 0:2.2.15-39.el6 will be インストール --> 依存性解決を終了しました。 依存性を解決しました =============================================================================================================================== パッケージ アーキテクチャ バージョン リポジトリー 容量 =============================================================================================================================== インストールしています: httpd x86_64 2.2.15-39.el6 rhui-REGION-rhel-server-releases 825 k 依存性関連でのインストールをします。: apr x86_64 1.3.9-5.el6_2 rhui-REGION-rhel-server-releases 123 k apr-util x86_64 1.3.9-3.el6_0.1 rhui-REGION-rhel-server-releases 87 k apr-util-ldap x86_64 1.3.9-3.el6_0.1 rhui-REGION-rhel-server-releases 15 k httpd-tools x86_64 2.2.15-39.el6 rhui-REGION-rhel-server-releases 75 k トランザクションの要約 =============================================================================================================================== インストール 5 パッケージ 総ダウンロード容量: 1.1 M インストール済み容量: 3.6 M これでいいですか? [y/N]y パッケージをダウンロードしています: (1/5): apr-1.3.9-5.el6_2.x86_64.rpm | 123 kB 00:00 (2/5): apr-util-1.3.9-3.el6_0.1.x86_64.rpm | 87 kB 00:00 (3/5): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm | 15 kB 00:00 (4/5): httpd-2.2.15-39.el6.x86_64.rpm | 825 kB 00:00 (5/5): httpd-tools-2.2.15-39.el6.x86_64.rpm | 75 kB 00:00 ------------------------------------------------------------------------------------------------------------------------------- 合計 3.2 MB/s | 1.1 MB 00:00 rpm_check_debug を実行しています トランザクションのテストを実行しています トランザクションのテストを成功しました トランザクションを実行しています インストールしています : apr-1.3.9-5.el6_2.x86_64 1/5 インストールしています : apr-util-1.3.9-3.el6_0.1.x86_64 2/5 インストールしています : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 3/5 インストールしています : httpd-tools-2.2.15-39.el6.x86_64 4/5 インストールしています : httpd-2.2.15-39.el6.x86_64 5/5 Verifying : apr-1.3.9-5.el6_2.x86_64 1/5 Verifying : httpd-2.2.15-39.el6.x86_64 2/5 Verifying : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 3/5 Verifying : apr-util-1.3.9-3.el6_0.1.x86_64 4/5 Verifying : httpd-tools-2.2.15-39.el6.x86_64 5/5 インストール: httpd.x86_64 0:2.2.15-39.el6 依存性関連をインストールしました: apr.x86_64 0:1.3.9-5.el6_2 apr-util.x86_64 0:1.3.9-3.el6_0.1 apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 httpd-tools.x86_64 0:2.2.15-39.el6 完了しました!
3.httpdのスタート
$ sudo /etc/init.d/httpd start httpd を起動中: [ OK ] $ ps aux | grep httpd root 1606 0.0 0.3 177340 3856 ? Ss 03:10 0:00 /usr/sbin/httpd apache 1608 0.0 0.2 177340 2444 ? S 03:10 0:00 /usr/sbin/httpd apache 1609 0.0 0.2 177340 2444 ? S 03:10 0:00 /usr/sbin/httpd apache 1610 0.0 0.2 177340 2444 ? S 03:10 0:00 /usr/sbin/httpd apache 1611 0.0 0.2 177340 2444 ? S 03:10 0:00 /usr/sbin/httpd apache 1612 0.0 0.2 177340 2444 ? S 03:10 0:00 /usr/sbin/httpd apache 1613 0.0 0.2 177340 2444 ? S 03:10 0:00 /usr/sbin/httpd apache 1614 0.0 0.2 177340 2444 ? S 03:10 0:00 /usr/sbin/httpd apache 1615 0.0 0.2 177340 2444 ? S 03:10 0:00 /usr/sbin/httpd ec2-user 1618 0.0 0.0 107460 940 pts/0 S+ 03:11 0:00 grep httpd
4./var/www/html/index.htmlの作成
5.インスタンスの「Public DNS」へアクセス。
※注意:インスタンスのインバウンドにHTTPを設定していないとアクセスできません。
6.PHPのインストール
$ sudo yum install php php-mbstring php-mysql php-xml 読み込んだプラグイン:amazon-id, rhui-lb, security インストール処理の設定をしています 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> Package php.x86_64 0:5.3.3-40.el6_6 will be インストール --> 依存性の処理をしています: php-common(x86-64) = 5.3.3-40.el6_6 のパッケージ: php-5.3.3-40.el6_6.x86_64 --> 依存性の処理をしています: php-cli(x86-64) = 5.3.3-40.el6_6 のパッケージ: php-5.3.3-40.el6_6.x86_64 --> トランザクションの確認を実行しています。 ---> Package php-cli.x86_64 0:5.3.3-40.el6_6 will be インストール ---> Package php-common.x86_64 0:5.3.3-40.el6_6 will be インストール --> 依存性解決を終了しました。 依存性を解決しました =============================================================================================================================== パッケージ アーキテクチャ バージョン リポジトリー 容量 =============================================================================================================================== インストールしています: php x86_64 5.3.3-40.el6_6 rhui-REGION-rhel-server-releases 1.1 M 依存性関連でのインストールをします。: php-cli x86_64 5.3.3-40.el6_6 rhui-REGION-rhel-server-releases 2.2 M php-common x86_64 5.3.3-40.el6_6 rhui-REGION-rhel-server-releases 527 k トランザクションの要約 =============================================================================================================================== インストール 3 パッケージ 総ダウンロード容量: 3.8 M インストール済み容量: 13 M これでいいですか? [y/N]y パッケージをダウンロードしています: (1/3): php-5.3.3-40.el6_6.x86_64.rpm | 1.1 MB 00:00 (2/3): php-cli-5.3.3-40.el6_6.x86_64.rpm | 2.2 MB 00:00 (3/3): php-common-5.3.3-40.el6_6.x86_64.rpm | 527 kB 00:00 ------------------------------------------------------------------------------------------------------------------------------- 合計 14 MB/s | 3.8 MB 00:00 rpm_check_debug を実行しています トランザクションのテストを実行しています トランザクションのテストを成功しました トランザクションを実行しています インストールしています : php-common-5.3.3-40.el6_6.x86_64 1/3 インストールしています : php-cli-5.3.3-40.el6_6.x86_64 2/3 インストールしています : php-5.3.3-40.el6_6.x86_64 3/3 Verifying : php-5.3.3-40.el6_6.x86_64 1/3 Verifying : php-cli-5.3.3-40.el6_6.x86_64 2/3 Verifying : php-common-5.3.3-40.el6_6.x86_64 3/3 インストール: php.x86_64 0:5.3.3-40.el6_6 依存性関連をインストールしました: php-cli.x86_64 0:5.3.3-40.el6_6 php-common.x86_64 0:5.3.3-40.el6_6 完了しました!
7.PHPバージョンの確認
$ php -v PHP 5.3.3 (cli) (built: Oct 23 2014 06:58:46) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
8./etc/httpd/conf/httpd.confの編集
402 DirectoryIndex index.html index.html.var index.php // index.phpの追加 779 AddType application/x-compress .Z 780 AddType application/x-gzip .gz .tgz 781 AddType application/x-httpd-php .php // application/x-httpd-php .php の追加
9./var/www/html/test.phpの作成
10.httpdの再起動
$ sudo /etc/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: [ OK ]