In this post, you will learn how to install Elgg on RHEL and CentOS 8. Elgg is an open source social networking software that provides individuals and organizations with the components needed to create an online social environment. It offers blogging, microblogging, file sharing, networking, groups and a number of other features. It was also the first platform to bring ideas from commercial social networking platforms to educational software.
Step 1: Install LAMP Stack
Elgg requires MySQL, PHP, and a web server. So we need to install LAMP stack before Elgg installation.
i: Install Apache webserver
dnf install httpd -y
Now start and enable apache service on boot.
systemctl start httpd systemctl enable httpd
Adding apache ports in the firewall.
firewall-cmd --add-port={80/tcp,443/tcp} --permanent firewall-cmd --reload
ii: Install PHP
dnf install php php-common php-pecl-apcu php-json php-cli php-pear php-pdo php-mysqlnd php-pgsql php-gd php-mbstring php-xml -y
iii: Install MYSQL
dnf install mysql-server -y
Start and enable MYSQL service on boot.
systemctl start mysqld systemctl enable mysqld
Complete MYSQL installation
mysql_secure_installation
Set root password? [Y/n] Y New password: password Re-enter new password: password 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
Step 2: Create a MySQL database for Elgg
Log in to the MySQL console using below command and type your password when asked.
mysql -u root -p
now create a new database
CREATE DATABASE elgg;
Now create a new MySQL user and grant it privileges on the created database. You can replace username and password with the username and password of your own choice.
CREATE USER 'database_user'@'localhost' IDENTIFIED BY 'user_password'; GRANT ALL PRIVILEGES ON database_name.* TO 'database_user'@'localhost'; FLUSH PRIVILEGES;
Exit the MySQL console.
exit
Step 3: Download and Install Elgg on CentOS 8 / RHEL 8
Download Elgg using below commands
cd /var/www/html wget https://elgg.org/about/getelgg?forward=elgg-3.1.1.zip
Now Unzip the downloaded archive
unzip getelgg?forward=elgg-3.1.1.zip mv ./elgg-3.1.1/* . rm -rf getelgg?forward=elgg-3.1.1.zip rm -rf elgg-3.1.1
Create a data directory for Elgg in /var/www/html directory
mkdir -p /var/www/html/data
Set the appropriate file permissions
chown -R apache:apache /var/www/html/ chmod -R 755 /var/www/html/
Step 4: Apache Configuration for Elgg
Create an Apache virtual hosts configuration file.
vi /etc/httpd/conf.d/vhost.conf
and place below lines in that file.
<VirtualHost *:80> DocumentRoot /var/www/html/ <Directory /var/www/html/> Options FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog /var/log/httpd/elgg_error.log CustomLog /var/log/httpd/elgg_access.log combined </VirtualHost>
Save changes and exit.
Restart Apache server.
systemctl restart httpd.service
Step 5: Install Elgg on CentOS 8 / RHEL 8 (using the web interface)
Finally, browse below URL to access
http://YOUR-SERVER-IP/ OR http://YOUR-DOMAIN-NAME
Click Next and enter the Database and its user details.
Click Next and enter the required details.
Once again click Next button and create your Admin Account.
Finally, you will see below page, Click on “Go to Site” button and start your work.
So, that is it. Hope you like it.
Also, you can read How to create an Nginx Server block on CentOS 8 / RHEL 8 / Oracle Linux 8?
Do not forget to share and join our Telegram Channel.