1
1

MyBBをDebianにインストールする方法

Last updated at Posted at 2024-03-13

今回は MyBBをインストールする方法です。
Debian 11で動くはずです。
インストールしたてのDebianを利用してください。

Let's do it

Apache2やcertbot, php7.4(8.1では動作しないため)とMariaDBをインストールします。
以下のコマンドを実行することで可能です。

sudo apt update -y
sudo apt install -y apache2
sudo rm /var/www/html/index.html
sudo apt install -y certbot python3-certbot-apache
sudo apt  install -y software-properties-common python3-launchpadlib
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt install -y php7.4
sudo apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath
sudo systemctl restart apache2
sudo apt install -y mariadb-server

次にMySQL(mariadb)の初期設定を実行します。

sudo mysql_secure_installation
Enter current password for root (enter for none): [何も入れない]

Switch to unix_socket authentication [Y/n] n
 ... skipping.

Change the root password? [Y/n] n
 ... skipping.

Remove anonymous users? [Y/n] y
 ... Success!

Disallow root login remotely? [Y/n] n
 ... skipping.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reload privilege tables now? [Y/n] y
 ... Success!

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

次にデーターベースをセットアップします。

sudo mysql -u root -p

ここでは mybbと言うデーターベースを作り、
mybbuserというユーザを123456というパスワードで作り、
mybbというデーターベースへのアクセスを与えます。

Enter password: [何も入れない]

MariaDB [(none)]> create database mybb;
Query OK, 1 row affected (0.003 sec)

MariaDB [(none)]> create user 'mybbuser'@localhost identified by '123456';
Query OK, 0 rows affected (0.006 sec)

MariaDB [(none)]> grant all privileges on mybb.* to 'mybbuser'@localhost;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> exit;
Bye

SSLをセットアップします。後からでもできますが、MyBBの設定変更する必要が発生するため、今します。

sudo certbot --apache -d [あなたのドメイン]

次に、MyBBをダウンロードし、解凍します。
また、/var/www/htmlに移動し、権限設定も行います。
以下のコマンドを実行してください。

sudo apt install -y unzip
wget https://resources.mybb.com/downloads/mybb_1838.zip
sudo unzip mybb_1838.zip
sudo mv Upload/* /var/www/html/
sudo a2enmod rewrite
cd /var/www/html/inc
sudo mv config.default.php config.php
cd ..
sudo chmod 666 inc/config.php inc/settings.php
sudo chmod 777 cache/ cache/themes/ uploads/ uploads/avatars/
sudo chmod 666 inc/languages/english/*.php inc/languages/english/admin/*.php
sudo chmod 777 cache/ cache/themes/ uploads/ uploads/avatars/ admin/backups/

終わったら、サイトにアクセスしてください。
Nextを押してください。
Screenshot 2024-03-13 at 17.23.00.png
Nextを押してください。
Screenshot 2024-03-13 at 17.23.32.png
全部、Installed, Writableになっていることを確認してください。
Screenshot 2024-03-13 at 17.24.15.png
次にDBの設定をします。
このチュートリアルの場合は以下の通りです。

database server hostname: localhost
database username: mybbuser
database password: 123456
database name: mybb

Screenshot 2024-03-13 at 17.24.56.png
Nextを押してください。
Screenshot 2024-03-13 at 17.26.22.png
Screenshot 2024-03-13 at 17.26.57.png
フォーラムの名前を設定し、Nextを押してください。
また、ドメインの設定も行なってください。
Photokako-mosaic-r8lTGBbiUjtbHs1s.png
次に、管理者のアカウントを作ります
Screenshot 2024-03-13 at 17.20.26.png
完了です!まだステップが残っています!
Screenshot 2024-03-13 at 17.29.49.png
ホームにアクセスするとエラーが出ますが、安心してください。
Screenshot 2024-03-13 at 17.31.50.png
これは インストーラーが残っているのが理由です。
このコマンドを実行し、削除しましょう。

cd /var/www/html
rm -rf install/

完了です。

Screenshot 2024-03-13 at 17.33.19.png
お疲れ様でした。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1