8. 8
手順12 Apache、PHP、OpenSSLがインストールされている事を確認して下さい
手順13 httpサービスを起動させ、Active:active(running)である事を確認して下さい
httpd、php、OpenSSLインストールする場合
3つインストールします
【Linux】#7 環境確認(3)Apache、PHP、OpenSSL確認
[root@suzukto ~]# httpd␣-v
Server version: Apache/2.4.37 (centos)
Server built: Jun 8 2020 20:14:33
[root@suzukto ~]# php␣-v
PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologie
[root@suzukto ~]# rpm␣-aq␣|␣grep␣mod_ssl
mod_ssl-2.4.37-21.module_el8.2.0+382+15b0afa8.x86_64
[root@suzukto ~]# systemctl␣start␣httpd
[root@suzukto ~]# systemctl␣status␣httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled;
vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/httpd.service.dmqphp-fpm.conf
Active: active (running) since Wed 2020-12-30 06:09:30 JST; 18s
ago
[root@suzukto ~]# dnf␣-y␣install␣mod_ssl␣php␣httpd
modとsslの間はアンダーバー
9. 9
手順14 mariadbのバージョン確認 mariadbのインストール
mariadbの初期設定 → xxページへ
【Linux】#7 環境確認(4)mariadb確認
[root@Linux7-CentStream ~]# mysql --version
mysql Ver 15.1 Distrib 10.3.27-MariaDB, for Linux (x86_64) using readline 5.1
# dnf␣install␣mariadb-server␣php-mysqlnd
17. 17
手順30 タイムゾーン設定反映、mariadbの再起動
手順31 Cacti用データベース「cacti」を作成、ユーザ「cactiDBuser」、パスワード「cactiDBpass」を作成する。
Cacti用テーブルを110個作成する
【Linux】#7 cactiのインストール(7)mariadb
[root@suzukito my.cnf.d]# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
Enter password:
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
[root@suzukito my.cnf.d]#systemctl restart mariadb
P@ssw0rd
[root@Linux7-CentStream my.cnf.d]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or ¥g.
Your MariaDB connection id is 18
MariaDB [(none)]> create database cacti;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> grant all privileges on cacti.* to cactiDBuser@'localhost' identified by 'cactiDBpass’;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> grant select on mysql.time_zone_name to cactiDBuser@'localhost';
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> exit
Bye
[root@Linux7-CentStream my.cnf.d]# mysql -u cactiDBuser -p cacti < /usr/share/doc/cacti/cacti.sql
Enter password:
P@ssw0rd
cactiDBpass
36. DBサーバーの初期設定(1)
MariaDBのインストール確認
--version
MariaDBの起動
systemctl start
MariaDBの起動確認
Systemctl status
自動起動設定もあわせて設定します。
Systemctl enable
36
手順6 [root@suzukto ~]# systemctl␣start␣mariadb
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2020-12-30 05:50:28 JST; 2s ago
Docs: man:mysqld(8)
手順5 [root@suzukto ~]# mysql␣--version
mysql Ver 15.1 Distrib 10.3.17-MariaDB, for Linux (x86_64) using readline 5.1
手順8 [root@suzukto ~]# systemctl␣enable␣mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service →
/usr/lib/systemd/system/mariadb.service.
手順7 [root@suzukto ~]# systemctl␣status␣mariadb
37. DBサーバーの初期設定(2)
MariaDBの自動起動確認
--version
37
手順9 [root@suzukto ~]# systemctl␣status␣mariadb
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2020-12-30 05:50:28 JST; 15min ago
Docs: man:mysqld(8)
38. DBサーバーの初期設定(3)
MariaDBの初期化
環境によって設定の差異が出ないように初期化します。
mysql_secure_installation
Enter current password for root (enter for none):
Enterを押します。rootの初期パスワードは空です。
Set root password? [Y/n]
「y」で応答し、rootユーザーのパスワードを設定します。
Remove anonymous users? [Y/n]
「y」で応答し、匿名ユーザーを削除します。
38
手順10 [root@suzukto ~]#mysql_secure_installation
Set root password? [Y/n] Y
New password: ←P@ssw0rdを入力します。(表示はされません)
Re-enter new password: ←確認のためもう一度入力します。
Password updated successfully! ←成功しました。
Reloading privilege tables..
... Success!
... Success!
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Enter current password for root (enter for none):
間はアンダーバー
39. DBサーバーの初期設定(4)
Disallow root login remotely? [Y/n]
「y」で応答し、rootユーザーのリモートログインを無効化します。
Remove test database and access to it? [Y/n]
「y」で応答し、デフォルトで作成されているテストデータベースを削除します。
Reload privilege tables now? [Y/n]
「y」で応答し、権限テーブルを再読み込みします
「Cleaning up...」と表示されたら初期化成功です。
39
Disallow root login remotely? [Y/n] Y
... Success!
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
... Success!