FreeBSD in Action - Create Blog With ELGG Development Framework

Elgg is a free, open source social networking platform, which offers blogging, networking, community, news gathering features with feed aggregation and file sharing features. Everything can be shared between users with access control and everything can also be cataloged by tags.

Elgg is a free, open source social collaboration tool for campuses, companies or individuals. Its presence is able to compete with modern hosting, because it has independent hosting capabilities and provides advanced features for building open source social network applications. In addition, this free social networking platform is known to be reliable, lightweight and features a well-documented API that can be easily integrated with third-party applications.

Elgg's free social collaboration tool is written in PHP. Therefore, comprehensive documentation regarding development and implementation is available. So naturally, there are thousands of plugins available that can be easily installed according to functionality requirements. Apart from that, Elgg also provides very strict security and authentication mechanisms using long-lasting techniques.

Elgg's free collaborative platform, offers a variety of features such as an access control system, notification services, an extensible display system, clean file storage, a cacheable static asset system, and more. Therefore, Elgg is easy to set up and provides an intuitive user interface so that users can navigate quickly and easily.



1. Elgg Features

When this article was written the latest version of Elgg was Elgg 5.1.4. Since its inception, Elgg has come with a series of plugins that provide basic functionality for social networks and blogs. Elgg offers the following key features:

  1. Groups: Flexible grouping tool. Includes a profile, forum, pages, message board and RSS feeds.
  2. Diagnostics, an administration tool.
  3. Cryptography Based Security.
  4. Notification Service.
  5. File repository. Allows users to upload any kind of authorized file. Also includes a photo gallery.
  6. Pages: create hierarchically-organized pages of text, and define reading and writing privileges.
  7. Access control system.
  8. Messages: Private "mail".
  9. The Wire, witter-style microblogging plugin that allows users to post notes to the wire.
  10. Documented API.
  11. User validation by e-mail.
  12. Messageboard: Similar to ‘The Wall’ in Facebook or a comment wall in other networks is a plugin that lets users put a messageboard widget on their profile. Other users can then post messages that will appear on the messageboard.
  13. Profile: provides information about a user, which is configurable from the plugin’s start.php. One can change the available fields from the admin panel. Each profile field has its own access restriction, so users can choose exactly who can see each individual element.


2. System Requirements

To run Elgg on a FreeBSD server, several system requirements are required. In this article we have installed some of the dependencies required by Elgg.
  1. OS: FreeBSD 13.2
  2. Database: mysql80-server
  3. PHP version: PHP82
  4. Apache version: apache24
  5. PHP-FPM
  6. mod PHP82 dan PHP82 extension
  7. Composer PHP


3. Install PHP82

In this article, we assume that your FreeBSD server has apache24 and mysql80-server installed. Make sure both applications run perfectly on your FreeBSD server.

Because Elgg is written in PHP, the main requirement is that we have to install PHP to be able to connect to apache24. Here's how to install PHP82 and the PHP dependencies needed to run Elgg.
root@ns3:~ # pkg install php82 php82-tokenizer mod_php82 php82-fileinfo php82-xmlreader php82-xmlwriter php82-mysqli php82-iconv
We continue by installing other PHP dependencies.
root@ns3:~ # pkg install php82-curl php82-dom php82-filter php82-gd php82-intl php82-mbstring php82-pdo_mysql php82-pdo php82-simplexml php82-soap php82-xml php82-pecl-xmlrpc
root@ns3:~ # pkg install libssh2 curl libpsl meson py39-setuptools sqlite3 libedit
Connect PHP with apache24, so that all PHP modules can be run on the apache24 web server. Type the following command in the "/usr/local/etc/apache24/httpd.conf" file.

LoadModule rewrite_module libexec/apache24/mod_rewrite.so
LoadModule php_module         libexec/apache24/libphp.so

<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps

After that, you activate PHP-FPM. In this article we will not discuss PHP-FPM installation. You can read the articles:


Let's assume that PHP-FPM is already running on your FreeBSD server. So we immediately restart apache24 and PHP-FPM.
root@ns3:~ # service php-fpm restart
root@ns3:~ # service apache24 restart


4. Create an Elgg database

Elgg uses databases to store all user information. Elgg can support many databases, in this article we will use MySQL server as the Elgg database.

On the MySQL server we create a database, user and password which we will later connect to the Elgg server. The commands below will guide you in creating an Elgg database.
root@ns3:~ # mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 74
Server version: 8.0.35 Source distribution

root@localhost [(none)]>
The command above is used to login to the MySQL server. To create an Elgg database, use the following command.
root@localhost [(none)]> CREATE DATABASE elgg CHARACTER SET utf8;
root@localhost [(none)]> CREATE USER 'userelgg'@'localhost' IDENTIFIED BY 'router123';
root@localhost [(none)]> GRANT ALL PRIVILEGES ON elgg.* TO 'userelgg'@'localhost';
root@localhost [(none)]> FLUSH PRIVILEGES;
root@localhost [(none)]>
The command above is used to create an "elgg" database with the username "userelgg" and password "router123".


5. Install Elgg and Composer PHP

On FreeBSD Elgg can be installed in various ways, via Github, PHP composer and the FreeBSD PKG package. We will use the standard FreeBSD installation, namely the PKG package. Before we start installing Elgg, we will first install the PHP composer.
root@ns3:~ # pkg install php82-composer php82-ctype php82-phar
After you have successfully installed PHP composer, we continue by installing Elgg.
root@ns3:~ # cd /usr/ports/www/elgg
root@ns3:/usr/ports/www/elgg # make install clean
Build Elgg with PHP composer.
root@ns3:/usr/ports/www/elgg # composer update
root@ns3:/usr/ports/www/elgg # composer install
After that, you run the chmod and chown commands.
root@ns3:/usr/ports/www/elgg # chown -R www:www /usr/local/www/elgg
root@ns3:/usr/ports/www/elgg # chmod -R 775 /usr/local/www/elgg
root@ns3:/usr/ports/www/elgg # chown -R www:www /tmp/elgginstaller
root@ns3:/usr/ports/www/elgg # chmod -R 775 /tmp/elgginstaller
Even though you have installed Elgg, you cannot use Elgg yet. So that you can connect to the Elgg server, connect the MySQL server database with Elgg. There are two ways to connect the MySQL server with Elgg, with the CLI and with the Google Chrome web browser. If you want to use the CLI, type the following command.
root@ns3:/usr/local/www/elgg # vendor/bin/elgg-cli install
We recommend that you use Google Chrome, apart from being more practical, it is easy to use. In the Google Chrome web browser, type "http://192.168.5.2/elgg/install.php". 

If there is nothing wrong with the configuration above, a display like the image below will appear.













Happy! You have successfully installed Elgg on the FreeBSD server. Thank you for using this tutorial to install Elgg on your FreeBSD computer. By mastering the discussion in this article, you have an alternative blog besides Blogspot or WordPress.
Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post