Pengenalan
MiniBB, juga dikenali sebagai Mini Bulletin Board, adalah program sumber terbuka yang digunakan untuk membina forum internet anda sendiri. Ia ditulis dalam PHP dan direka khas untuk komuniti forum kecil dan sederhana, yang mempunyai kurang daripada 100 siaran unik setiap hari. Dalam tutorial ini, saya akan menunjukkan kepada anda cara memasang dan mengkonfigurasi forum miniBB di Ubuntu 16.04.
Prasyarat
- Contoh pelayan Vultr Ubuntu 16.04 yang baru dilancarkan.
- Pengguna bukan root dengan persediaan hak istimewa sudo di pelayan anda.
Langkah 1: Kemas kini Sistem
Pertama, kemas kini sistem anda ke versi stabil terbaru dengan menjalankan perintah berikut:
sudo apt-get update -y
sudo apt-get upgrade -y
sudo reboot
Langkah 2: Memasang LAMP stack
Anda perlu memasang timbunan LAMP dan beberapa modul PHP sebelum memasang miniBB. Anda boleh memasangnya dengan arahan berikut:
sudo apt-get install apache2 libapache2-mod-php7.0 mariadb-server php7.0 php7.0-mysql php7.0-curl php7.0-gd php7.0-json php7.0-opcache php7.0-common
Langkah 3: Memasang miniBB
Mula-mula anda perlu memuat turun versi stabil miniBB terkini dari laman web miniBB .
Buat direktori bernama minibb
dan ekstrak arkib yang dimuat turun ke direktori root dokumen Apache.
sudo mkdir /var/www/html/minibb
sudo unzip minibb.zip -d /var/www/html/minibb
Tetapkan kebenaran yang betul pada minibb
direktori.
sudo chown -R www-data:www-data /var/www/html/minibb
Anda juga perlu membuat beberapa perubahan dalam setup_options.php
fail.
sudo nano /var/www/html/minibb/setup_options.php
Tukar fail mengikut keperluan anda.
$DBhost='localhost';
$DBname='minibb';
$DBusr='minibbuser';
$DBpwd='password';
$admin_usr = 'admin';
$admin_pwd = 'admin@123';
$admin_email = '[email protected]';
$main_url='http://example.com';
Setelah selesai, simpan dan tutup fail.
Langkah 4: Mengkonfigurasi MariaDB untuk miniBB
Secara lalai, MariaDB belum diamankan, jadi anda perlu melindunginya terlebih dahulu. Anda boleh mendapatkannya dengan mysql_secure_installation
skrip.
sudo mysql_secure_installation
Jawab semua soalan seperti di bawah:
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):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] n
... skipping.
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
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!
Seterusnya, log masuk ke konsol MariaDB dan buat pangkalan data untuk miniBB:
mysql -u root -p
Masukkan kata laluan root MariaDB anda dan tekan enter. Sebaik sahaja anda log masuk ke MariaDB, anda perlu membuat pangkalan data untuk miniBB:
MariaDB [(none)]> CREATE DATABASE minibb;
MariaDB [(none)]> CREATE USER 'minibbuser'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON `minibb`.* TO 'minibbuser'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q
Langkah 5: Mengkonfigurasi Apache untuk miniBB
Buat fail host maya baru minibb.conf
untuk Apache.
sudo nano /etc/apache2/sites-available/minibb.conf
Tambahkan baris berikut:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/minibb
ServerName 192.168.1.227
ServerAlias www.example.com
<Directory /var/www/html/minibb/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/minibb_log
CustomLog /var/log/apache2/minibb_custom_log common
</VirtualHost>
Setelah selesai, aktifkan hos maya dengan menjalankan arahan berikut:
sudo a2ensite minibb.conf
sudo service apache2 reload
Langkah 6: Mengakses Forum miniBB
Sudah tiba masanya untuk mengakses antara muka web miniBB. Buka penyemak imbas web kegemaran anda dan taipkan URL http://your-server-ip/_index.php
. Selesaikan langkah-langkah yang diperlukan untuk menyelesaikan pemasangan.
Setelah pemasangan selesai, anda boleh log masuk ke panel pentadbir miniBB dengan menavigasi ke http://your-server-ip/bb_admin.php?
. Nikmati miniBB baru anda.