Warning: Declaration of FeedWordPie_Item::get_id($hash = false) should be compatible with SimplePie_Item::get_id($hash = false, $fn = 'md5') in /home/nekyo/nekyo.wp.xdomain.jp/public_html/wp-content/plugins/feedwordpress/feedwordpie_item.class.php on line 0

Warning: Declaration of FeedWordPress_Parser::parse(&$data, $encoding) should be compatible with SimplePie_Parser::parse(&$data, $encoding, $url = '') in /home/nekyo/nekyo.wp.xdomain.jp/public_html/wp-content/plugins/feedwordpress/feedwordpress_parser.class.php on line 0

Warning: Cannot modify header information - headers already sent by (output started at /home/nekyo/nekyo.wp.xdomain.jp/public_html/wp-content/plugins/feedwordpress/feedwordpie_item.class.php:0) in /home/nekyo/nekyo.wp.xdomain.jp/public_html/wp-includes/feed-rss2.php on line 8
Vagrant – 日々のできごと http://nekyo.wp.xdomain.jp きがついたこと、みたこと、やったこと、かんじたこと Thu, 14 Dec 2017 02:17:39 +0000 ja hourly 1 Vagrant(CentOS7編) http://nekyo.wp.xdomain.jp/2017/12/08/vagrant/ http://nekyo.wp.xdomain.jp/2017/12/08/vagrant/#respond Fri, 08 Dec 2017 02:59:38 +0000 http://nekyo.wp.xdomain.jp/?p=2146 続きを読む Vagrant(CentOS7編) ]]> Vagrant環境構築

Centos7のボックス追加から立ち上げ

> vagrant box add Centos/7
> cd \vagrant\centos7
> vagrant init Centos/7
> vagrant up
> vagrant ssh
$ sudo su -

SELinuxオフ

$ vi /etc/selinux/config
- SELINUX=enforcing
+ SELINUX=disabled

アップデート・アップグレード

$ yum update
$ yum upgrade

Webサーバー

apache2

$ yum install httpd

ファイヤーウォール設定

$ firewall-cmd --add-service=http --zone=public --permanent
$ firewall-cmd --add-service=https --zone=public --permanent
$ firewall-cmd --reload

DB

MySQL

mariaDBライブラリとデータフォルダの削除

$ yum remove -y mariadb-libs
$ rm -rf /var/lib/mysql/

リポジトリ追加

$ yum localinstall –y http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

インストール

$ yum -y install mysql-community-server
$ systemctl enable mysqld
$ systemctl start mysqld
/var/log/mysqld.log に root の初期パスワードが出力される。
$ cat /var/log/mysqld.log | grep root
[Note] A temporary password is generated for root@localhost: **********
********* 部分を控えて、下記を実行する。
$ mysql_secure_installation

ユーザ作成

$ mysql -p
Enter password: 
mysql> CREATE USER ユーザ名;
mysql> CREATE USER user IDENTIFIED BY [PASSWORD] ‘パスワード’;
MySQL> CREATE DATABASE DB名 CHARACTER SET utf8;
MySQL> GRANT ALL ON DB名.* to ユーザ名;
MySQL> FLUSH PRIVILEGES;
mysql> \q

PHP

リポジトリインストール

$ yum install -y epel-release
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

PHP 7.2 インストール

$ yum install --enablerepo=remi,remi-php72 php php-opcache php-mbstring php-xml php-gd php-mysqli php-fpm php-zip

トラシュー

MySQLのパスワードを変更しようとしたらエラー

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> SHOW VARIABLES LIKE 'validate_password%'; # 再度パスワードの設定を確認
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
6 rows in set (0.01 sec)
mysql> SET GLOBAL validate_password_length=4;
mysql> SET GLOBAL validate_password_policy=LOW;

Vagrant 1.9.8 から vagrant up が固まる。

Vagrantのバージョンの問題。
1.9.7 から PowerShell5.x が必要なので(Windows7 に入っているのは PowerShell2) PowerShell5.x を入れる。
Cygwinを使っている場合は、Vagrantを1.9.6、VirtualBoxを5.1.30にダウングレードするか、Cygwinターミナルを使わず、コマンドプロンプトを使う。

Implementation of the USB 2.0 controller not found!

Extention Packが必要
1. 最新のVirtual Boxをインストール。
http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html#vbox
2. VirtualBox Extension PackをVirtual Boxに追加。
http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html?ssSourceSiteId=otnjp#extpack

Authentication failure. Retrying…

  • Vagrantfile に以下を追記して上書きされないようにする。

+ config.ssh.insert_key = false

  • vagrant ssh でゲストOSに入って、デフォルトの公開キーを上書き、属性も変更しておく。

$ mkdir -p /home/vagrant/.ssh
$ wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys
$ chmod 0700 /home/vagrant/.ssh
$ chmod 0600 /home/vagrant/.ssh/authorized_keys
$ chown -R vagrant /home/vagrant/.ssh

  • VMを再起動して確認

$ vagrant reload

参考:vagrant upコマンド実行時にAuthentication failure.エラーが発生する

]]>
http://nekyo.wp.xdomain.jp/2017/12/08/vagrant/feed/ 0