Vanilla ist ein einfaches Diskussionsforum, das in PHP geschrieben wurde. Vanilla-Quellcode wird öffentlich auf Github gehostet . Dieses Handbuch führt Sie durch den Vanilla-Installationsprozess auf einer neuen Debian 9 Vultr-Serverinstanz mit PHP, MariaDB als Datenbank und Nginx als Webserver.
Bedarf
Vom Vanilla Forum empfohlener Software-Stack:
- PHP Version 7.2 oder höher mit folgenden Erweiterungen:
mbstring
curl
gd
PDO
mysqli
openssl
- MySQL Version 5.7 oder höher oder MariaDB-Äquivalent. In diesem Handbuch wird MariaDB 10.2.x verwendet.
- Webserver-Software wie Nginx oder Apache. In diesem Handbuch wird Nginx verwendet.
- SSL-Verschlüsselung
Bevor Sie beginnen
Überprüfen Sie die Debian-Version.
lsb_release -ds
# Debian GNU/Linux 9.7 (stretch)
Stellen Sie sicher, dass Ihr System auf dem neuesten Stand ist.
apt update && apt upgrade -y
Installieren Sie einige grundlegende Systemverwaltungspakete, wenn sie nicht installiert sind.
apt install -y vim sudo curl wget git unzip bash-completion apt-transport-https lsb-release ca-certificates dirmngr
Erstellen Sie ein neues non-rootBenutzerkonto mit sudoZugriff und wechseln Sie zu diesem.
adduser johndoe --gecos "John Doe"
usermod -aG sudo johndoe
su - johndoe
HINWEIS : Ersetzen Sie johndoedurch Ihren Benutzernamen .
Richten Sie die Zeitzone ein.
sudo dpkg-reconfigure tzdata
Installieren Sie PHP
Installieren Sie PHP 7.2 und PHP-Erweiterungen.
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update && sudo apt upgrade -y
sudo apt install -y php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-curl php7.2-gd php7.2-mysql php7.2-json
Überprüfe die Version.
php -v
# PHP 7.2.14-1+0~20190113100742.14+stretch~1.gbpd83c69 (cli) (built: Jan 13 2019 10:07:43) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
# with Zend OPcache v7.2.14-1+0~20190113100742.14+stretch~1.gbpd83c69, Copyright (c) 1999-2018, by Zend Technologies
Überprüfen Sie die installierten PHP-Erweiterungen.
php -m
# mbstring
# curl
# gd
# PDO
# mysqli
# openssl
# . . .
Installieren Sie MariaDB
Installieren Sie MariaDB 10.2.
sudo apt install -y software-properties-common dirmngr
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] https://mirrors.nxthost.com/mariadb/repo/10.2/debian stretch main'
sudo apt update
sudo apt install -y mariadb-server
Überprüfe die Version.
mysql --version
# mysql Ver 15.1 Distrib 10.2.21-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Führen Sie das mysql_secure_installationSkript aus, um die Sicherheit Ihrer Installation zu verbessern.
sudo mysql_secure_installation
Melden Sie sich bei MariaDB als Root an.
sudo mysql -u root -p
# Enter password:
Erstellen Sie eine neue Datenbank und einen neuen Benutzer und merken Sie sich die Anmeldeinformationen.
CREATE DATABASE dbname;
GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;
Installieren Sie Nginx
Installieren Sie Nginx.
sudo apt install -y nginx
Überprüfe die Version.
sudo nginx -v
# nginx version: nginx/1.10.3
Konfigurieren Sie Nginx für die Verwendung mit dem Vanilla-Forum.
sudo vim /etc/nginx/sites-available/vanilla.conf
Füllen Sie die Datei wie folgt aus.
server {
listen 80;
server_name example.com;
root /var/www/vanilla;
index index.php;
location ~* /\.git { deny all; return 403; }
location /build/ { deny all; return 403; }
location /cache/ { deny all; return 403; }
location /cgi-bin/ { deny all; return 403; }
location /uploads/import/ { deny all; return 403; }
location /conf/ { deny all; return 403; }
location /tests/ { deny all; return 403; }
location /vendor/ { deny all; return 403; }
location ~* ^/index\.php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;
fastcgi_param X_REWRITE 1;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~* \.php(/|$) {
rewrite ^ /index.php$uri last;
}
location / {
try_files $uri $uri/ @vanilla;
}
location @vanilla {
rewrite ^ /index.php$uri last;
}
}
Aktivieren Sie die neue vanilla.confKonfiguration, indem Sie die Datei mit dem sites-enabledVerzeichnis verknüpfen .
sudo ln -s /etc/nginx/sites-available/vanilla.conf /etc/nginx/sites-enabled
Testen Sie die Konfiguration.
sudo nginx -t
Laden Sie Nginx neu.
sudo systemctl reload nginx.service
Installieren Sie das Vanilla-Forum
Erstellen Sie ein Dokumentstammverzeichnis.
sudo mkdir -p /var/www/vanilla
Ändern Sie den Besitz des /var/www/vanillaVerzeichnisses in johndoe.
sudo chown -R johndoe:johndoe /var/www/vanilla
Navigieren Sie zum Dokumentstammverzeichnis.
cd /var/www/vanilla
Laden Sie das neueste Vanilla-Forum herunter .
wget https://open.vanillaforums.com/get/vanilla-core-2.6.4.zip
Entpacken Sie es und entfernen Sie das Zip-Archiv.
unzip vanilla-core-2.6.4.zip
rm vanilla-core-2.6.4.zip
Geben Sie das entsprechende Eigentum an.
sudo chown -R www-data:www-data /var/www/vanilla
Navigieren Sie in Ihrem Webbrowser zu dem Ordner, in den Sie Vanilla hochgeladen haben, und befolgen Sie die Anweisungen auf dem Bildschirm, um die Einrichtung abzuschließen.