How to Install Elgg on Alibaba Cloud ECS

Prerequisites

Setting Up Your Server

# sudo apt update && sudo apt upgrade
# sudo apt-get install unzip

Install PHP:

# sudo apt-get install software-properties-common python-software-properties
# sudo add-apt-repository ppa:ondrej/php
# sudo apt update
# sudo apt install -y php7.2
# sudo apt install -y php7.2-json php7.2-zip php7.2-cli php7.2-mysql php7.2-gd php7.2-xml php7.2-mbstring php7.2-xmlrpc php7.2-intl php7.2-curl php7.2-sqlite3 php7.2-common libapache2-mod-php7.2
# php --version

Install MariaDB

# sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
# sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.nodesdirect.com/mariadb/repo/10.2/ubuntu xenial main'
# sudo apt update
# sudo apt install -y mariadb-server
# sudo systemctl start mariadb
# sudo systemctl enable mariadb
# sudo mysql_secure_installation
# sudo mysql -u root -p
CREATE DATABASE elggdb;
CREATE USER 'aareez'@'localhost' IDENTIFIED BY '654321Ab';
GRANT ALL PRIVILEGES ON elggdb.* TO 'aareez'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Install Elgg:

# cd /var/www
# sudo wget https://elgg.org/download/elgg-2.3.7.zip
# sudo unzip elgg-2.3.7.zip
# sudo rm -r elgg-2.3.7.zip
# sudo mv elgg-2.3.7 elgg
# cd elgg
# sudo mkdir -p /var/www/elgg/data
# sudo chown -R www-data:www-data /var/www/elgg
# sudo chmod -R 755 /var/www/elgg

Configure Apache Server:

# sudo nano /etc/apache2/sites-available/elgg.conf
<VirtualHost *:80> 
ServerAdmin admin@xyz.com
ServerName softpedia.xyz
DocumentRoot /var/www/elgg
DirectoryIndex index.php index.htm index.html
<Directory /var/www/elgg>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/Elgg_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/Elgg_access.log combined
</VirtualHost>
# sudo a2dissite 000-default.conf
# sudo a2ensite elgg
# sudo a2enmod rewrite
# sudo a2enmod ssl
# sudo service apache2 restart

Configure Database:

Install SSL Certificate:

# sudo apt-get update
# sudo apt-get install software-properties-common
# sudo add-apt-repository ppa:certbot/certbot
# sudo apt-get update
# sudo systemctl stop apache2
# sudo apt-get install python-certbot-apache
# sudo certbot --apache -d softpedia.xyz
# sudo systemctl start apache2

Set Up Firewalls and Ports

Original Source

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store