CentOS7にphpMyFAQをインストール
このブログのモットーは、このページを見ればインストールが成功し、動作することを目指しています。
phpMyFAQのインストールを試みたところ、4 ~ 5サイト参照してやっと出来ました。
動作に成功した手順を、以下に記載します。
1. 使用したCentOS7 インストールメディア
CentOS-7-x86_64-Minimal-1511.iso
2. CentOS7インストール後の設定
- SElinuxの無効化
vi /etc/selinux/config SELINUX=disabled <- disabledに設定
- reboot
reboot
3. PHP5.6, Apache, MariaDB, wgetのインストール及び動作確認
#各モジュールのインストール yum install wget mariadb-server mariadb httpd yum install epel-release rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm yum install --enablerepo=remi-php56 php php-gd php-pecl-jsonc php-common php-mbstring php-xml php-mysql #php.iniファイルの一番最後に以下の設定を追加 vi /etc/php.ini register_globals = off safe_mode = off #Apacheの自動起動及び起動 systemctl enable httpd.service systemctl start httpd.service #テスト用ページの作成 echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
ブラウザから、作成したテスト用ページにアクセスし、phpの情報が表示されることを確認します。
http://your.server.ip.address/phpinfo.php
systemctl enable mariadb.service systemctl start mariadb.service
5. MariaDBの各設定
[root@localhost ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): <- Enterキーを押す OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y <- Yを入力 New password: <- 設定するパスワードを入力 Re-enter new password: <- 再入力 Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] <- Yを入力 ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] <- Yを入力 ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] <- Yを入力 - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] <- Yを入力 ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! [root@localhost ~]#
6. DBの作成
mysql -u root -p Enter password: <- 設定したパスワードを入力 MariaDB [(none)]>create database faqdb; MariaDB [(none)]>GRANT ALL ON faqdb.* TO faqusr@localhost IDENTIFIED BY '******'; <- ******はpasswordを設定 MariaDB [(none)]>flush privileges; MariaDB [(none)]>exit;
7. phpMyFAQのインストール
phpMyFAQサイトより最新ファイルのダウンロードURLを確認します。 wget -c http://download.phpmyfaq.de/phpMyFAQ-2.9.10.tar.gz tar xzvf phpMyFAQ-2.9.10.tar.gz #必要なディレクトリの作成と権限を与えます。 mkdir phpmyfaq/attachments mkdir phpmyfaq/data mkdir phpmyfaq/images chmod 775 phpmyfaq/attachments phpmyfaq/data phpmyfaq/images chown -R apache.apache phpmyfaq/
8. phpMyFAQの初期設定
ブラウザより、初期設定画面へアクセスします。
http://your.server.ip.address/phpmyfaq
以下の設定を行います。
Database server: MariaDB 5.x
Database hostname: localhost
Database user: faqusr
Database password: ***** <- DB作成時に作成したパスワード
Database name: faqdb
Default language: Japanese
Permission level: Basic
Your Name: <-- 名前を設定
Your email address: <- e-mailアドレスを設定
Your login name: <- ログイン名を設定
Your password: <- パスワードを設定
Retype password: <- パスワードを再入力
画面をスクロールし、"Click to install phpMyFAQ 2.9.10"をクリックします。
以下のメッセージが表示されます。
9. 動作確認
トップページへアクセスします。
http://your.server.ip.address/phpmyfaq
右上のログインをクリックし、登録したアカウントでログインできることを確認します。