Introducció
Requisits previs
Pas 1: actualitzeu el sistema
Pas 2: instal·lació de la pila LAMP
Pas 3: instal·lació de miniBB
Pas 4: Configuració de MariaDB per a miniBB
Pas 5: Configuració d'Apache per a miniBB
Pas 6: Accés al fòrum miniBB
Introducció
MiniBB, també conegut com a Mini Bulletin Board, és un programa de codi obert utilitzat per crear el vostre propi fòrum d'Internet. Està escrit en PHP i dissenyat especialment per a comunitats de fòrums petites i mitjanes, que tenen menys de 100 publicacions úniques per dia. En aquest tutorial, us mostraré com instal·lar i configurar el fòrum miniBB a Ubuntu 16.04.
Requisits previs
- Una instància del servidor Vultr Ubuntu 16.04 recentment llançada.
- Un usuari no root amb privilegis sudo configurats al vostre servidor.
Pas 1: actualitzeu el sistema
Primer, actualitzeu el vostre sistema a la darrera versió estable executant l'ordre següent:
sudo apt-get update -y
sudo apt-get upgrade -y
sudo reboot
Pas 2: instal·lació de la pila LAMP
Haureu d'instal·lar la pila LAMP i alguns mòduls PHP abans d'instal·lar miniBB. Podeu instal·lar-los amb l'ordre següent:
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
Pas 3: instal·lació de miniBB
Primer haureu de descarregar la darrera versió estable de miniBB des del lloc web de miniBB .
Creeu un directori anomenat minibbi extreu l'arxiu descarregat al directori arrel del document Apache.
sudo mkdir /var/www/html/minibb
sudo unzip minibb.zip -d /var/www/html/minibb
Establiu els permisos adequats al minibbdirectori.
sudo chown -R www-data:www-data /var/www/html/minibb
També haureu de fer alguns canvis al setup_options.phpfitxer.
sudo nano /var/www/html/minibb/setup_options.php
Canvieu el fitxer segons les vostres necessitats.
$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';
Un cop hàgiu acabat, deseu i tanqueu el fitxer.
Pas 4: Configuració de MariaDB per a miniBB
De manera predeterminada, MariaDB no s'ha assegurat, de manera que primer haureu de protegir-lo. Podeu assegurar-lo amb l' mysql_secure_installationscript.
sudo mysql_secure_installation
Respon totes les preguntes tal com es mostra a continuació:
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!
A continuació, inicieu sessió a la consola MariaDB i creeu una base de dades per a miniBB:
mysql -u root -p
Introduïu la vostra contrasenya d'arrel de MariaDB i premeu Intro. Un cop hàgiu iniciat sessió a MariaDB, heu de crear una base de dades per a 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
Pas 5: Configuració d'Apache per a miniBB
Creeu un fitxer d'amfitrió virtual nou minibb.confper a Apache.
sudo nano /etc/apache2/sites-available/minibb.conf
Afegiu les línies següents:
<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>
Un cop hàgiu acabat, activeu l'amfitrió virtual executant l'ordre següent:
sudo a2ensite minibb.conf
sudo service apache2 reload
Pas 6: Accés al fòrum miniBB
És hora d'accedir a la interfície web miniBB. Obriu el vostre navegador web preferit i escriviu l'URL http://your-server-ip/_index.php. Completeu els passos necessaris per acabar la instal·lació.
Un cop finalitzada la instal·lació, podeu iniciar sessió al tauler d'administració de miniBB navegant a http://your-server-ip/bb_admin.php?. Gaudeix del teu nou miniBB.