this link<\/a>. At the moment of writing this tutorial, the latest stable version is Elgg 3.0.3. To download this version on your server, you can run the following command:<\/p>\nsudo wget https:\/\/elgg.org\/download\/elgg-3.0.3.zip<\/pre>\nLet’s extract the files to the \/var\/www<\/code> location on our server with this next line:<\/p>\nsudo unzip elgg-3.0.3.zip -d \/var\/www<\/pre>\nNote:<\/strong> If you don’t have the unzip<\/code> package installed on your server, you can install it with the following command: sudo apt install unzip<\/code><\/p>\nRename the elgg-3.0.3<\/code> directory to elgg<\/code>:<\/p>\nsudo mv \/var\/www\/elgg-3.0.3 \/var\/www\/elgg<\/pre>\nElgg needs a special folder to store uploaded files, such as profile icons and photos. For security reasons, it is also recommended for this directory to be created outside the document root directory of our Elgg installation. The directory will be called data<\/code> and you can create it with the following command:<\/p>\nsudo mkdir -p \/var\/www\/data<\/pre>\nThe owner of all these files needs to be the user of the web server running on your system. In our example, we are using the Nginx web server and Nginx runs under the www-data<\/code> user on Ubuntu 18.04.\u00a0 To change the owner and set the correct permissions for these files, you need to run the following command:<\/p>\nsudo chown -R www-data:www-data \/var\/www\/elgg\r\nsudo chown -R www-data:www-data \/var\/www\/data\r\nsudo chmod -R 750 \/var\/www\/elgg<\/pre>\n<\/span>Step 4: Configure the Database<\/span><\/h2>\nNext, we need to create a new database for our Elgg application. To do this, log in to your MySQL database server as the root user by typing the following command:<\/p>\n
sudo mysql -u root -p<\/pre>\nThen enter the password you made for your MySQL user during step 2<\/strong>. Once you are signed in, create a new database and user by running the following commands on the MySQL shell:<\/p>\nCREATE DATABASE elgg_db<\/span>;\r\nCREATE USER elgg_user<\/span>@localhost IDENTIFIED BY 'strong-password<\/span>';\r\nGRANT ALL PRIVILEGES ON elgg_db<\/span>.* TO elgg_user<\/span>@localhost;\r\nFLUSH PRIVILEGES;<\/pre>\nYou can replace the database and username with your own and also make sure to replace strong-password<\/span> with an actual strong password.<\/p>\nTo exit the MySQL database server command line, type:<\/p>\n
exit<\/pre>\n