Xenforo 2.1 Xenforo 2.1 Ubuntu Installation Guide

Skymax

Member
Registered
Joined
May 29, 2020
Messages
5
Points
3

Reputation:

This guide shows you how to install Xenforo 2.1.X on Ubuntu 16.04 (or 17.10, or 18.04) VPS, like DigitalOcean or Amazon Web Server.

Pastebin can be found here: https://pastebin.com/YZsKKR9v

Bash:
# Reconfigure locales:
sudo nano /etc/default/locale

LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8

sudo dpkg-reconfigure locales

# In there choose en_US.UTF-8

sudo reboot

sudo su


# Step 1: Install nginx
sudo apt-get update
sudo apt-get install nginx


# Step 2: Install MariaDB Database Server
sudo apt-get install mariadb-server mariadb-client

# - On Ubuntu 16.04 LTS:
sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service

# - On Ubuntu 17.10 and 18.04 LTS:
sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service


# Step 3: Install PHP 7.4 FPM and Related Modules
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.4-fpm php7.4-common php7.4-mbstring php7.4-xmlrpc php7.4-soap php7.4-gd php7.4-xml php7.4-intl php7.4-mysql php7.4-cli php7.4-zip php7.4-curl


# Step 4: Setting up MariaDB
sudo mysql_secure_installation


# Step 5: Configurate php (for this one I suggest opening it with your code editor on filezilla, because on nano it will take you some time to find the variables)
sudo nano /etc/php/7.4/fpm/php.ini

file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 100M
cgi.fix_pathinfo = 0
max_execution_time = 360
data.timezone = America/Chicago


# Step 6: Create Database
sudo mysql -u root -p
CREATE DATABASE xenforodb;
CREATE USER 'admin'@'localhost' IDENTIFIED BY '<passwordhere>';
GRANT ALL ON xenforodb.* TO 'admin'@'localhost' IDENTIFIED BY '<password_entered_above>' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;


# Step 7: Configure Nginx PHP-FPM Settings
sudo nano /etc/nginx/sites-available/default

Make sure that index.php is on the list, set server_name to your forum domain, and location ~ \.php$ is uncommented and with php7.4:
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;

        server_name myforumdomain.com;

        location / {
                try_files $uri $uri/ =404;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/[COLOR=rgb(41, 105, 176)][B]php7.4[/B][/COLOR]-fpm.sock;
        }
}

sudo systemctl restart nginx.service
sudo systemctl restart php7.4-fpm.service


# Step 8: Set the permissions for the html dir
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html/*


# Step 9: Upload Xenforo zip file on /var/www/html folder (Make sure to remove the default index nginx file)
sudo apt-get install unzip
cd /var/www/html
sudo unzip /var/www/html/upload.zip


# Step 10: Fix Xenforo needed permissions
sudo chmod 777 /var/www/html/data
sudo chmod 777 /var/www/html/internal_data

# - Now go to your forum url on your browser and finish the installation there
 
Last edited:

boo

Active member
Registered
Joined
Aug 29, 2019
Messages
37
Points
18

Reputation:

Why use 7.2? If ya using ppa:eek:ndrej repository wouldn't 7.3 or 4 be better?

You could also use nginx from ppa:eek:ndrej.
 

boo

Active member
Registered
Joined
Aug 29, 2019
Messages
37
Points
18

Reputation:

@Skymax I know, was just surprised the tutorial was recommending 7.2.

No bother, thanks for sharing.
 
Top