How to install Elgg on Clear Linux Latest

Elgg is an open-source social networking platform that allows users to create their social network. In this tutorial, we will guide you on how to install Elgg on Clear Linux Latest.

Prerequisites

Before we begin, make sure you have the following available:

Step 1: Update the System

Before installing Elgg, update your system:

swupd update

Step 2: Install Required Packages

Elgg requires the following packages to be installed. Use the following command to install:

sudo swupd bundle-add php-basic
sudo swupd bundle-add php-mysqlnd
sudo swupd bundle-add php-curl
sudo swupd bundle-add nginx
sudo swupd bundle-add mysql

Step 3: Configure Nginx

Configure Nginx for Elgg by creating a new server block:

sudo nano /etc/nginx/sites-available/elgg

Add the following to the file:

server {
    listen 80;
    server_name example.com;
    root /var/www/elgg/;
    index index.php;

    # Elgg needs rewrites
    location / {
        rewrite ^/(.*)$ /index.php?__elgg_uri=$1 last;
        break;
    }

    location ~ /\.ht {
        deny all;
    }

    # Pass PHP to PHP FastCGI
    location ~ \.php$ {
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }   
}

Save and close the file.

Now create a symbolic link for the server block:

sudo ln -s /etc/nginx/sites-available/elgg /etc/nginx/sites-enabled/

Remove the default Nginx server block:

sudo rm /etc/nginx/sites-enabled/default

Finally, restart Nginx:

sudo systemctl restart nginx

Step 4: Install Elgg

Download the latest version of Elgg by running the following command:

cd /opt
sudo wget https://elgg.org/download/elgg-4.0.zip

Extract the downloaded file:

sudo apt install unzip
sudo unzip elgg-4.0.zip -d /var/www/elgg/

Change the ownership of the Elgg directory:

sudo chown -R www-data:www-data /var/www/elgg

Step 5: Configure MySQL

Create a MySQL database and user for Elgg:

sudo mysql -u root -p

Once logged in, run the following SQL command:

CREATE DATABASE elgg;
CREATE USER 'elgg'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL PRIVILEGES ON elgg.* TO 'elgg'@'localhost';
FLUSH PRIVILEGES;
exit

Replace "your_password_here" with a strong password.

Step 6: Configure Elgg

Navigate to Elgg installation directory:

cd /var/www/elgg/

Rename the file htaccess_dist to .htaccess:

sudo mv htaccess_dist .htaccess

Open the file elgg-config/settings.php:

sudo nano elgg-config/settings.php

Update the following lines:

$CONFIG->sitename = 'My Elgg Site';
$CONFIG->dbuser = 'elgg';
$CONFIG->dbpass = 'your_password_here';
$CONFIG->dbname = 'elgg';

Save and close the file.

Step 7: Complete the Installation

Open your web browser and navigate to your server's IP address, or domain name if you have one, followed by /install.php.

Follow the installation wizard to complete the installation.

Conclusion

You have now successfully installed Elgg on Clear Linux Latest. You can now start customizing and using the social network platform to create your social network.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!