Table of Contents
Was this article helpful?
Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $600 by adding new articles.

How to Install and Configure Open Source Social Network on Ubuntu 16.04

Last Updated: Tue, Dec 20, 2016
Linux Guides Server Apps Ubuntu Web Servers
Archived content

This article is outdated and may not work correctly for current operating systems or software.


Open source social network also known as OSSN is a PHP based social networking tool that allows you to make your own social networking website and build relationship with members.

In this tutorial, we will explain how to install OSSN on your Ubuntu 16.04 server.


  • A newly deployed Vultr Ubuntu 16.04 server instance.

  • A sudo user.

Step 1: Update The System

Before starting, you should update the system to the latest stable version with the following commands:

sudo apt-get update -y

sudo apt-get upgrade -y

sudo reboot

Step 2: Installing LAMP

In order to install OSSN, you will need to install the LAMP stack and some additional PHP modules on your server using the following commands:

sudo apt-get install apache2 libapache2-mod-php7.0 mariadb-server php7.0 php7.0-mysql php7.0-curl php7.0-gd     

php7.0-json php7.0-opcache php7.0-xml mcrypt php7.0-mcrypt php7.0-cgi php7.0-json php7-0-zip

Step 3: Installing Open Source Social Network

First you will need to download the latest stable version of OSSN from OSSN's website

You can download it with the wget command:


Next, unzip the downloaded archive to the /var/www/html directory.

sudo unzip -d /var/www/html

You will need to ensure the correct ownership of the ossn directory:

sudo chown -R www-data.www-data /var/www/html/ossn/

Step 4: Configuring Database for Open Source Social Network

It is recommended that you run the mysql_secure_installation command to improve MySQL’s security:

sudo mysql_secure_installation

You will be presented with a few questions to which you will need to provide an answer. Next, using the MySQL command line, create a database for OSSN:

mysql -u root -p

Enter your MySQL/MariaDB root password and hit enter. Once you are logged in, you can create a database for OSSN as follows:

 MariaDB [(none)]> SET GLOBAL sql_mode='';

 MariaDB [(none)]> CREATE DATABASE ossndb;

 MariaDB [(none)]> CREATE USER 'ossnuser'@'localhost' IDENTIFIED BY 'password-here';

 MariaDB [(none)]> GRANT ALL PRIVILEGES ON ossndb.* TO 'ossnuser'@'localhost';

 MariaDB [(none)]> FLUSH PRIVILEGES; 

 MariaDB [(none)]> \q

Step 5: Configuring Apache for OSSN

Once the database is created, you need to create a new virtual host file, e.g. ossn.conf in the Apache sites’ directory:

 sudo nano /etc/apache2/sites-available/ossn.conf

Add the following lines:

 <VirtualHost *:80>


     DocumentRoot /var/www/html/ossn/



     <Directory /var/www/html/ossn/>

        Options FollowSymLinks

        AllowOverride All

        Order allow,deny

        allow from all


     ErrorLog /var/log/apache2/ossn_log

     CustomLog /var/log/apache2/ossn_custom_log common


Once you are finished, enable virtual host by running the following commands:

 sudo a2ensite ossn.conf

 sudo  service apache2 reload

You will also need to enable rewrite module:

 sudo a2enmod rewrite

You will also need to make some PHP configuration changes by editing php.ini:

 sudo nano /etc/php/7.0/cli/php.ini

Changes the values for allow_url_fopen, file_uploads, and upload_max_filesize as shown below:

 allow_url_fopen = On

 file_uploads = On

 upload_max_filesize = 32M

Next, create a directory named data outside the document root directory for storing the uploaded files:

 sudo mkdir /var/www/ossn_data

Finally, restart Apache service to effect the changes:

 sudo systemctl restart apache2

Step 6: Accessing OSSN Web Interface

Once done, visit in your browser to complete all the required steps to finish your OSSN installation.

Don’t forget to replace and with your actual domain name your server’ IP addresses.

Want to contribute?

You could earn up to $600 by adding new articles.