Bevezetés
Előfeltételek
1. lépés: Frissítse a rendszert
2. lépés: A LAMP stack telepítése
3. lépés: A miniBB telepítése
4. lépés: A MariaDB konfigurálása miniBB-hez
5. lépés: Az Apache konfigurálása a miniBB-hez
6. lépés: A miniBB fórum elérése
Bevezetés
A MiniBB, más néven Mini Bulletin Board egy nyílt forráskódú program, amelyet saját internetes fórum létrehozására használnak. PHP nyelven íródott, és kifejezetten kis és közepes fórumközösségek számára készült, amelyek naponta kevesebb mint 100 egyedi bejegyzéssel rendelkeznek. Ebben az oktatóanyagban megmutatom, hogyan telepítheti és konfigurálhatja a miniBB fórumot az Ubuntu 16.04 rendszeren.
Előfeltételek
- Egy újonnan elindított Vultr Ubuntu 16.04 szerverpéldány.
- Nem root felhasználó, aki sudo jogosultságokkal rendelkezik a kiszolgálón.
1. lépés: Frissítse a rendszert
Először frissítse a rendszert a legújabb stabil verzióra a következő parancs futtatásával:
sudo apt-get update -y
sudo apt-get upgrade -y
sudo reboot
2. lépés: A LAMP stack telepítése
A miniBB telepítése előtt telepítenie kell a LAMP veremet és néhány PHP modult. Ezeket a következő paranccsal telepítheti:
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
3. lépés: A miniBB telepítése
Először le kell töltenie a miniBB legújabb stabil verzióját a miniBB webhelyéről .
Hozzon létre egy nevű könyvtárat, minibbés bontsa ki a letöltött archívumot az Apache dokumentum gyökérkönyvtárába.
sudo mkdir /var/www/html/minibb
sudo unzip minibb.zip -d /var/www/html/minibb
Állítsa be a megfelelő engedélyeket a minibbkönyvtárban.
sudo chown -R www-data:www-data /var/www/html/minibb
Ezenkívül néhány változtatást kell végrehajtania a setup_options.phpfájlban.
sudo nano /var/www/html/minibb/setup_options.php
Változtassa meg a fájlt igényei szerint.
$DBhost='localhost';
$DBname='minibb';
$DBusr='minibbuser';
$DBpwd='password';
$admin_usr = 'admin';
$admin_pwd = 'admin@123';
$admin_email = 'admin@example.com';
$main_url='http://example.com';
Ha végzett, mentse el és zárja be a fájlt.
4. lépés: A MariaDB konfigurálása a miniBB-hez
Alapértelmezés szerint a MariaDB nem védett, ezért először biztonságossá kell tennie. A mysql_secure_installationszkripttel biztosíthatja.
sudo mysql_secure_installation
Válaszoljon az összes kérdésre az alábbiak szerint:
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!
Ezután jelentkezzen be a MariaDB konzolba, és hozzon létre egy adatbázist a miniBB számára:
mysql -u root -p
Adja meg MariaDB root jelszavát, és nyomja meg az Enter billentyűt. Miután bejelentkezett a MariaDB-be, létre kell hoznia egy adatbázist a miniBB számára:
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
5. lépés: Az Apache konfigurálása a miniBB-hez
Hozzon létre egy új virtuális gazdagép fájlt minibb.confaz Apache számára.
sudo nano /etc/apache2/sites-available/minibb.conf
Adja hozzá a következő sorokat:
<VirtualHost *:80>
ServerAdmin admin@example.com
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>
Ha végzett, engedélyezze a virtuális gazdagépet a következő parancs futtatásával:
sudo a2ensite minibb.conf
sudo service apache2 reload
6. lépés: A miniBB fórum elérése
Itt az ideje, hogy hozzáférjen a miniBB webes felületéhez. Nyissa meg kedvenc webböngészőjét, és írja be az URL-t http://your-server-ip/_index.php. Hajtsa végre a szükséges lépéseket a telepítés befejezéséhez.
A telepítés befejezése után bejelentkezhet a miniBB adminisztrációs paneljére a címre navigálva http://your-server-ip/bb_admin.php?. Élvezze új miniBB-jét.