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
apache2
$ yum install httpd
ファイヤーウォール設定
$ firewall-cmd --add-service=http --zone=public --permanent $ firewall-cmd --add-service=https --zone=public --permanent $ firewall-cmd --reload
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
リポジトリインストール
$ 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
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.7 から PowerShell5.x が必要なので(Windows7 に入っているのは PowerShell2) PowerShell5.x を入れる。
Cygwinを使っている場合は、Vagrantを1.9.6、VirtualBoxを5.1.30にダウングレードするか、Cygwinターミナルを使わず、コマンドプロンプトを使う。
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
+ config.ssh.insert_key = false
$ 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
$ vagrant reload]]>