Home  >  Article  >  System Tutorial  >  How to install Elgg on Ubuntu 20.04 LTS

How to install Elgg on Ubuntu 20.04 LTS

PHPz
PHPzforward
2024-01-08 15:05:05654browse

Elgg is highly customizable, with a simple yet powerful user interface that makes it easy to build and manage content online over the web. Elgg is managed by the non-profit Elgg Foundation.

Installing Elgg on Ubuntu 20.04 LTS Focal Fossa

step 1.

First, make sure all system packages are up to date by running the following command in the terminal via apt.

sudo apt update

sudo apt upgrade

Step 2.

Install the LAMP stack.

Requires Ubuntu 20.04 LAMP server. If you don't have LAMP installed.

Step 3.

Install Elgg on Ubuntu 20.04.

Now we run the following command to download the latest version of Elgg:

wget https://elgg.org/download/elgg-3.3.20.zip

unzip elgg-*.zip

sudo mv elgg-*/ /var/www/html/elgg/

We need to change the permissions of some folders:

sudo mkdir /var/www/html/data

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

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

sudo chmod -R 755 /var/www/html/elgg

Step 4.

Configure MariaDB for Elgg.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should carefully read each of the following steps, which will set the root password, remove anonymous users, disable remote root logins, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y

- Remove anonymous users? [Y/n] y

- Disallow root login remotely? [Y/n] y

- Remove test database and access to it? [Y/n] y

- Reload privilege tables now? [Y/n] y

Next, we need to log into the MariaDB console and create a database for Elgg. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and press Enter. After logging into the database server, you need to create a database for your Elgg installation:

CREATE DATABASE elgg;

CREATE USER 'elgg'@'localhost' IDENTIFIED BY 'your-secure-password';

GRANT ALL ON elgg.* TO 'elgg'@'localhost' IDENTIFIED BY 'secure-password' WITH GRANT OPTION;

FLUSH PRIVILEGES;

EXIT;

Step 5.

Configure the Apache web server for Elgg.

Now we create a new virtual host directive in Apache. For example, create a new Apache configuration file named " " on your virtual server: elgg.conf

touch /etc/apache2/sites-available/elgg.conf

ln -s /etc/apache2/sites-available/elgg.conf /etc/apache2/sites-enabled/elgg.conf

nano /etc/apache2/sites-available/elgg.conf

Add the following lines:

ServerAdmin admin@your-domain.com

DocumentRoot /var/www/html/elgg/

ServerName your-domain.com

ServerAlias ​​www.your-domain.com

Options FollowSymLinks

AllowOverride All

Order allow,deny

allow from all

ErrorLog /var/log/apache2/your-domain.com-error_log

CustomLog /var/log/apache2/your-domain.com-access_log common

Now we can restart the Apache web server to make the changes:

sudo a2enmod rewrite

sudo a2ensite elgg.conf

sudo systemctl restart apache2.service

Step 6.

Set up HTTPS.

We should enable secure HTTPS connection on PrestaShop. We can get free TLS certificates from Let’s Encrypt. Install the Let’s Encrypt client (certbot) from the Ubuntu 20.04 repository:

sudo apt install certbot python3-certbot-apache

Next, run the following command to obtain a free TLS certificate using the Apache plugin:

sudo certbot --apache --agree-tos --redirect --staple-ocsp --email you@example.com -d example.com

If the test is successful, reload Apache for the changes to take effect:

sudo apache2ctl -t

sudo systemctl reload apache2

Step 7.

Access the Elgg web interface.

By default, Elgg will be available on HTTP port 80. Open your favorite browser and navigate to or and complete the required steps to complete the installation. If you are using a firewall, open port 80 to enable access to the control panel.

如何在 Ubuntu 20.04 LTS上安装 Elgg

The above is the detailed content of How to install Elgg on Ubuntu 20.04 LTS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete