{"id":7212,"date":"2018-11-09T17:35:23","date_gmt":"2018-11-09T14:35:23","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/how-to-install-open-source-social-network-ossn-on-ubuntu\/"},"modified":"2018-11-09T17:35:23","modified_gmt":"2018-11-09T14:35:23","slug":"how-to-install-open-source-social-network-ossn-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-open-source-social-network-ossn-on-ubuntu-18-04-lts\/","title":{"rendered":"How to Install Open Source Social Network (OSSN) on Ubuntu 18.04 LTS"},"content":{"rendered":"<p>Open Source Social Network (OSSN) is a free and open source social networking software written in PHP. It is used to create your own social network website and build relationships with your members. Ossn can also be used to build different types of social apps like Private Intranets, Public Networks, and Community. OSSN comes with a powerful user and admin dashboard that can help you build and manage your content on every device. OSSN comes with lots of features including, Photos, Profile, Friends, Smileys, Search, Chat and much more.<\/p>\n<p>In this tutorial, we will be going to learn how to install Open Source Social Network on Ubuntu 18.04 LTS server.<\/p>\n<h2 id=\"requirements\">Requirements<\/h2>\n<ul>\n<li>A server running Ubuntu 18.04 LTS<\/li>\n<li>A non-root user with sudo privileges.<\/li>\n<\/ul>\n<h2 id=\"install-lamp-server\">Install LAMP Server<\/h2>\n<p>OSSN runs on the web server, written in PHP and uses MariaDB for the database. So, you will need to install Apache, PHP, and MariaDB to your system. OSSN does not support PHP 7.2 yet, so we will install PHP 7.1 from Ondrej repository.<\/p>\n<p>You can add the repository with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo add-apt-repository ppa:ondrej\/php<\/code><\/pre>\n<p>Once the repository is added, install Apache, MariaDB, PHP, and all required PHP libraries by running the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo apt-get install apache2 mariadb-server php7.1 php7.1-mysql php7.1-curl php7.1-json php7.1-cgi libapache2-mod-php7.1 php7.1-mcrypt php7.1-xmlrpc php7.1-gd php7.1-mbstring php7.1 php7.1-common php7.1-xmlrpc php7.1-soap php7.1-xml php7.1-intl php7.1-cli php7.1-ldap php7.1-zip php7.1-readline php7.1-imap php7.1-tidy php7.1-recode php7.1-sq php7.1-intl wget unzip -y<\/code><\/pre>\n<p>Once all the packages are installed, start Apache and MariaDB service and enable them to start on boot time with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo systemctl start apache2<br\/>sudo systemctl enable apache2<br\/>sudo systemctl start mariadb<br\/>sudo systemctl enable mariadb<\/code><\/pre>\n<h2 id=\"configure-database\">Configure Database<\/h2>\n<p>By default, MariaDB installation is not secured. You can secure it by running the following script:<\/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 and press Enter, then create a database and user with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">MariaDB [(none)]&gt; CREATE DATABASE ossndb;<br\/>MariaDB [(none)]&gt; CREATE USER ossn;<\/code><\/pre>\n<p>Next, grant privileges to the OSSN database with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">MariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON ossndb.* TO 'ossn'@'localhost' IDENTIFIED BY 'password';<\/code><\/pre>\n<p>Replace &#8216;password&#8217; with a secure password in the above SQL command and note it down, we need it later during OSSN installation. Next, you will need to run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MySQL and we can use new credentia$<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">MariaDB [(none)]&gt; FLUSH PRIVILEGES;<\/code><\/pre>\n<p>Next, exit from the MariaDB console with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">MariaDB [(none)]&gt; EXIT;<\/code><\/pre>\n<h2 id=\"install-ossn\">Install OSSN<\/h2>\n<p>First, download the latest version of the OSSN with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">cd \/tmp<br\/>wget https:\/\/www.opensource-socialnetwork.org\/download_ossn\/latest\/build.zip<\/code><\/pre>\n<p>After downloading, unzip the downloaded file with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">unzip build.zip<\/code><\/pre>\n<p>Next, copy the extracted directory to the Apache root directory, create a data directory for OSSN and give proper permissions with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo cp -r ossn \/var\/www\/html\/<br\/>sudo mkdir \/var\/www\/html\/ossn_data<br\/>sudo chown -R www-data:www-data \/var\/www\/html\/ossn\/<br\/>sudo chmod -R 755 \/var\/www\/html\/ossn\/<br\/>sudo chown -R www-data:www-data \/var\/www\/html\/ossn_data<\/code><\/pre>\n<p>Next, create an Apache configuration file for OSSN with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo nano \/etc\/apache2\/sites-available\/ossn.conf<\/code><\/pre>\n<p>Add the following lines:<\/p>\n<pre>&lt;VirtualHost *:80&gt;&#13; ServerAdmin <a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"f293969f9b9cb2978a939f829e97dc919d9f\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>&#13; DocumentRoot \/var\/www\/html\/ossn&#13; ServerName example.com&#13;\n&#13; &lt;Directory \/var\/www\/html\/ossn\/&gt;&#13; Options FollowSymlinks&#13; AllowOverride All&#13; Require all granted&#13; &lt;\/Directory&gt;&#13;\n&#13; ErrorLog ${APACHE_LOG_DIR}\/ossn_error.log&#13; CustomLog ${APACHE_LOG_DIR}\/ossn_access.log combined&#13;\n&#13;\n&lt;\/VirtualHost&gt;&#13;\n<\/pre>\n<p>Replace the domain name example.com with your own domain name. Save and close the file, then enable virtual host file and Apache rewrite module with the following command:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo a2ensite ossn.conf<br\/>sudo a2enmod rewrite<\/code><\/pre>\n<p>Finally, restart Apache to apply all the changes:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">sudo systemctl restart apache2<\/code><\/pre>\n<p>OSSN will try to access itself by HTTP on the server to check mod_rewrite, this requires that the domain which you use for the installation in the virtual host file\u00a0<span>\/etc\/apache2\/sites-available\/ossn.conf exists in DNS. If you are using a non-existing domain like I&#8217;ll do it here with example.com, then this domain needs to be configured in the \/etc\/hosts file of the server like this:<\/span><\/p>\n<pre class=\"command\"><code spellcheck=\"false\"><span>nano \/etc\/hosts<\/span><\/code><\/pre>\n<p><span>the file should contain a line starting with the IP of the server, followed by the domain name. Example:<\/span><\/p>\n<pre><code spellcheck=\"false\">192.168.1.100 example.com www.example.com<\/code><\/pre>\n<p>Save the hosts file. Otherwise, you will get an error &#8220;MOD_REWRITE REQUIRED&#8221;.<\/p>\n<h2 id=\"access-ossn-web-installer\">Access OSSN web installer<\/h2>\n<p>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_open_source_social_network_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-open-source-social-network-ossn-on-ubuntu-18-04-lts.png\" alt=\"All requirements are met\" width=\"550\" height=\"314\" title=\"\"><\/a><\/p>\n<p>Make sure all the requirements are met. Then, click on the Next 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_open_source_social_network_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-open-source-social-network-ossn-on-ubuntu-18-04-lts-1.png\" alt=\"Enter database settings\" width=\"550\" height=\"316\" title=\"\"><\/a><\/p>\n<p>Here, provide your Site name and Database details. Then, click on the Install 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_open_source_social_network_on_ubuntu_1804\/big\/page3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-open-source-social-network-ossn-on-ubuntu-18-04-lts-2.png\" alt=\"Create an admin account\" width=\"550\" height=\"313\" title=\"\"><\/a><\/p>\n<p>Here, provide your admin user credentials. Then, click on the Create button. Once the installation has been finished, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page4\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_open_source_social_network_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-open-source-social-network-ossn-on-ubuntu-18-04-lts-3.png\" alt=\"OSSN installation finished\" width=\"550\" height=\"318\" title=\"\"><\/a><\/p>\n<p>Now, click on the Finish button. You will be redirected to the OSSN log in screen as shown below:<\/p>\n<p><a class=\"fancybox\" id=\"img-page5\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_open_source_social_network_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-open-source-social-network-ossn-on-ubuntu-18-04-lts-4.png\" alt=\"Login as admin user\" width=\"550\" height=\"315\" title=\"\"><\/a><\/p>\n<p>Now, provide your admin username and password. Then, click on the Login button. You should see the OSSN dashboard in the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-ossn-dashboard\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_open_source_social_network_on_ubuntu_1804\/big\/ossn-dashboard.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-open-source-social-network-ossn-on-ubuntu-18-04-lts-5.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p>When you click on &#8216;view site&#8217; in the menu, you will see the OSSN frontend.<\/p>\n<p><a class=\"fancybox\" id=\"img-ossn-frontend\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_open_source_social_network_on_ubuntu_1804\/big\/ossn-frontend.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/how-to-install-open-source-social-network-ossn-on-ubuntu-18-04-lts-6.png\" alt=\"OSSN Frontend view\" width=\"550\" height=\"353\" title=\"\"><\/a><\/p>\n<p>OSSN has been successfully installed on Ubuntu 18.04 LTS.<\/p>\n<h2 id=\"g0.0.23\">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. 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>OSSN Login<\/strong><\/p>\n<p>Username: admin<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: ossn<\/span><br \/><span>Password: password<\/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.<\/p>\n<h2 id=\"links\">Links<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Open Source Social Network (OSSN) is a free and open source social networking software written in PHP. It is used to create your own social network website and build relationships with your members. Ossn can also be used to build different types of social apps like Private Intranets, Public Networks, and Community. OSSN comes with [&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-7212","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7212","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=7212"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7212\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=7212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=7212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=7212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}