{"id":7239,"date":"2018-11-15T16:33:25","date_gmt":"2018-11-15T13:33:25","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/ubuntu-elgg-social-network-installation\/"},"modified":"2018-11-15T16:33:25","modified_gmt":"2018-11-15T13:33:25","slug":"how-to-install-elgg-social-network-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts\/","title":{"rendered":"How to Install Elgg Social Network on Ubuntu 18.04 LTS"},"content":{"rendered":"<p>Elgg is a free, open source and self-hosted social networking application that can be used to create your own social networking website. You can easily create social networks for your university, organization, school and college using Elgg. Elgg is simple, easy to use and highly customizable. You can extend Elgg functionality with built-in plugins and themes.<\/p>\n<p>In this tutorial, we will\u00a0show you how to install Elgg with Apache web server on Ubuntu 18.04 server.<\/p>\n<h2 id=\"requirements\">Requirements<\/h2>\n<ul>\n<li>A server running Ubuntu 18.04.<\/li>\n<li>A non-root user with sudo privileges.<\/li>\n<\/ul>\n<h2 id=\"getting-started\">Getting Started<\/h2>\n<p>First, update your system with the latest version by running the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo apt-get update -y<br\/>sudo apt-get upgrade -y<\/code><\/pre>\n<p>Once your system is updated, restart your system to apply the changes.<\/p>\n<h2 id=\"install-lamp-server\">Install LAMP Server<\/h2>\n<p>Elgg is written in PHP and uses MariaDB to store their database. So, you will need to install Apache, PHP and MariaDB server to your system.<\/p>\n<p>You can install all the packages by running the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo apt-get install apache2 mariadb-server php7.2 libapache2-mod-php7.2 php7.2-common php7.2-sqlite3 php7.2-curl php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip unzip wget -y<\/code><\/pre>\n<p>Once all the packages are installed, open the PHP default configuration file and make some changes:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo nano \/etc\/php\/7.2\/apache2\/php.ini<\/code><\/pre>\n<p>Make the following changes:<\/p>\n<pre>memory_limit = 256M&#13;\nupload_max_filesize = 100M&#13;\nmax_execution_time = 360&#13;\ndate.timezone = Asia\/Kolkata&#13;\n<\/pre>\n<p>Save and close the file. Then, start Apache and MariaDB service and enable them to start on boot time:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo systemctl start apache2<br\/>sudo systemctl start mariadb<br\/>sudo systemctl enable apache2<br\/>sudo systemctl enable mariadb<\/code><\/pre>\n<h2 id=\"configure-database\">Configure Database<\/h2>\n<p>By default, MariaDB is not secure. So, you will need to secure it first. You can secure it by running the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo mysql_secure_installation<\/code><\/pre>\n<p>Answer all the questions as shown below:<\/p>\n<pre> Enter current password for root (enter for none):&#13; Set root password? [Y\/n]: N&#13; Remove anonymous users? [Y\/n]: Y&#13; Disallow root login remotely? [Y\/n]: Y&#13; Remove test database and access to it? [Y\/n]: Y&#13; Reload privilege tables now? [Y\/n]: Y&#13;\n<\/pre>\n<p>Once the MariaDB is secured, log in to MariaDB shell:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">mysql -u root -p<\/code><\/pre>\n<p>Enter your root password, then create a database and user for Elgg:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">MariaDB [(none)]&gt; CREATE DATABASE elggdb;<br\/>MariaDB [(none)]&gt; CREATE USER 'elgg'@'localhost' IDENTIFIED BY 'howtoforge';<\/code><\/pre>\n<p>Replace the word &#8216;howtoforge&#8217; in the command above with a secure password. Next, grant all the privileges to the Elgg database:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">MariaDB [(none)]&gt; GRANT ALL ON elggdb.* TO 'elgg'@'localhost' IDENTIFIED BY 'howtoforge' WITH GRANT OPTION;<\/code><\/pre>\n<p><span>Replace the word &#8216;howtoforge&#8217; in the command above with a secure password.\u00a0<\/span>Next, flush the privileges and exit from the MariaDB shell:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">MariaDB [(none)]&gt; FLUSH PRIVILEGES;<br\/>MariaDB [(none)]&gt; \\q<\/code><\/pre>\n<h2 id=\"install-elgg-on-ubuntu\">Install Elgg on Ubuntu<\/h2>\n<p>First, download the latest version of Elgg with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">cd \/tmp<br\/>wget https:\/\/elgg.org\/download\/elgg-2.3.9.zip<\/code><\/pre>\n<p>Next, unzip the downloaded file with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">unzip elgg-2.3.9.zip<\/code><\/pre>\n<p>Next, copy the extracted directory to the Apache root directory:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo cp -r elgg-2.3.9 \/var\/www\/html\/elgg<\/code><\/pre>\n<p>Next, create a data directory for Elgg:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo mkdir \/var\/www\/html\/elgg\/data<\/code><\/pre>\n<p>Next, give proper permissions to the Elgg:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo chown -R www-data:www-data \/var\/www\/html\/elgg\/<br\/>sudo chmod -R 755 \/var\/www\/html\/elgg\/<\/code><\/pre>\n<h2 id=\"configure-apache-for-elgg\">Configure Apache for Elgg<\/h2>\n<p>Next, create an Apache virtual host file for Elgg with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo nano \/etc\/apache2\/sites-available\/elgg.conf<\/code><\/pre>\n<p>add the following lines:<\/p>\n<pre>&lt;VirtualHost *:80&gt;&#13;\nServerAdmin <a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"6302070e0a0d23061b020e130f064d000c0e\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>&#13;\nDocumentRoot \/var\/www\/html\/elgg\/&#13;\nServerName example.com&#13;\n&lt;Directory \/var\/www\/html\/elgg\/&gt;&#13;\nOptions FollowSymLinks&#13;\nAllowOverride All&#13;\n&lt;\/Directory&gt;&#13;\nErrorLog \/var\/log\/apache2\/elgg-error_log&#13;\nCustomLog \/var\/log\/apache2\/elgg-access_log common&#13;\n&lt;\/VirtualHost&gt;&#13;\n<\/pre>\n<p>Replace example.com with your domain name. Save and close the file. Then, enable Apache virtual host file with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo a2ensite elgg.conf<\/code><\/pre>\n<p>Next, enable Apache rewrite module and restart Apache web service with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo a2enmod rewrite<br\/>sudo systemctl restart apache2<\/code><\/pre>\n<h2 id=\"access-elgg-web-interface\">Access Elgg Web Interface<\/h2>\n<p>Now, open your web browser and type the URL http:\/\/example.com. You will be redirected to the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page1\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_elgg_on_ubuntu_1804\/big\/page1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts.png\" alt=\"Welcome to Elgg Installer\" width=\"550\" height=\"285\" title=\"\"><\/a><\/p>\n<p>Click on the <strong>Next<\/strong> button. You should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page2\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_elgg_on_ubuntu_1804\/big\/page2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts-1.png\" alt=\"Requirements Check\" width=\"550\" height=\"288\" title=\"\"><\/a><\/p>\n<p>Once all the Elgg requirements are satisfies. Click on the <strong>Next<\/strong> button. You should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page3\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_elgg_on_ubuntu_1804\/big\/page3.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts-2.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p>Provide your database details and click on the <strong>Next<\/strong> button. You should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page4\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_elgg_on_ubuntu_1804\/big\/page4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts-3.png\" alt=\"Configure the site\" width=\"550\" height=\"298\" title=\"\"><\/a><\/p>\n<p>Now, provide your site name, data directory &#8216;<span>\/var\/www\/<\/span>html<span>\/<\/span>elgg<span>\/data&#8217;<\/span>, site URL. Then, click on the <strong>Next<\/strong> button. You should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page5\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_elgg_on_ubuntu_1804\/big\/page5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts-4.png\" alt=\"Create admin account in Elgg\" width=\"550\" height=\"296\" title=\"\"><\/a><\/p>\n<p>Now, provide your admin username and password. Then, click on the <strong>Next<\/strong> button. Once the installation has been finished, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page6\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_elgg_on_ubuntu_1804\/big\/page6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts-5.png\" alt=\"Elgg installation finished\" width=\"550\" height=\"288\" title=\"\"><\/a><\/p>\n<p>Now, click on the <strong>Go to site<\/strong> button. You should see the Elgg dashboard in the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page7\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_elgg_on_ubuntu_1804\/big\/page7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts-6.png\" alt=\"Elgg Administrator dashboard\" width=\"550\" height=\"289\" title=\"\"><\/a><\/p>\n<p>An this is how the Elgg frontend looks like:<\/p>\n<p><a class=\"fancybox\" id=\"img-elgg-frontend\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_elgg_on_ubuntu_1804\/big\/elgg-frontend.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-elgg-social-network-on-ubuntu-18-04-lts-7.png\" alt=\"Elgg Frontend\" width=\"550\" height=\"352\" title=\"\"><\/a><\/p>\n<h2 id=\"virtual-machine-image-download-of-this-tutorial\">Virtual machine image download of this tutorial<\/h2>\n<p>This tutorial is available as ready to use virtual machine image in ovf\/ova format that is compatible with VMWare and Virtualbox for HowtoForge subscribers. The virtual machine image uses the following login details:<\/p>\n<p><strong>SSH \/ Shell Login<\/strong><\/p>\n<p>Username: administrator<br \/>Password: howtoforge<\/p>\n<p>This user has sudo rights.<\/p>\n<p><strong>Elgg Login<\/strong><\/p>\n<p>Username:\u00a0admin<br \/>Password: howtoforge<\/p>\n<p><strong>MySQL Login<\/strong><\/p>\n<p>Username:\u00a0root<br \/>Password: howtoforge<\/p>\n<p>and<\/p>\n<p><span>Username: elgg<\/span><br \/><span>Password: howtoforge<\/span><\/p>\n<p>The IP of the VM is 192.168.1.100, it can be changed in the file \/etc\/netplan\/01-netcfg.yaml. Please change all the above passwords to secure the virtual machine. The Download-Link for the VM is in the menu on the right side, near the top.<\/p>\n<h2 id=\"links\">Links<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Elgg is a free, open source and self-hosted social networking application that can be used to create your own social networking website. You can easily create social networks for your university, organization, school and college using Elgg. Elgg is simple, easy to use and highly customizable. You can extend Elgg functionality with built-in plugins and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-7239","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=7239"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7239\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=7239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=7239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=7239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}