How to install Open Source Social Network in Ubuntu

To install Open Source Social Network in Ubuntu

Open Source Social Network is an CMS Applications that permits the user to develop our own social media website like facebook, twitter etc. This tool is programmed in PHP. In this article we will learn the procedure to install Open Source Social Network in Ubuntu. Inorder to install this application you would probably need to set up the LAMP environment for your server.

To install Open Source Social Network

Run the below command to Setup the LAMP Server.

root@linuxhelp:~# apt-get install lamp-server^ -y 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting ' libhttp-message-perl'  for task ' lamp-server' 
Note, selecting ' libencode-locale-perl'  for task ' lamp-server' 
Note, selecting ' php7.0-cli'  for task ' lamp-server' 
Note, selecting ' mysql-client-5.7'  for task ' lamp-server' 
Note, selecting ' libapache2-mod-php'  for task ' lamp-server' 
Note, selecting ' rename'  for task ' lamp-server' 
Note, selecting ' mysql-server-5.7'  for task ' lamp-server' 
Note, selecting ' php-common'  for task ' lamp-server' 
Note, selecting ' libaprutil1'  for task ' lamp-server' 
.
.
.
Creating config file /etc/php/7.0/mods-available/pdo_mysql.ini with new version
Setting up php-mysql (1:7.0+35ubuntu6) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.2) ...


Then install the following PHP extensions required for open source social network.

root@linuxhelp:~# apt-get install php7.0-cli php7.0-common php7.0-json php7.0-mcrypt php7.0-mysql php7.0-xml php7.0-curl php7.0-zip php7.0-gd -y 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php7.0-cli is already the newest version (7.0.8-0ubuntu0.16.04.2).
php7.0-common is already the newest version (7.0.8-0ubuntu0.16.04.2).
php7.0-json is already the newest version (7.0.8-0ubuntu0.16.04.2).
php7.0-mysql is already the newest version (7.0.8-0ubuntu0.16.04.2).
.
.
.
Creating config file /etc/php/7.0/mods-available/xmlwriter.ini with new version

Creating config file /etc/php/7.0/mods-available/xsl.ini with new version
Setting up php7.0-zip (7.0.8-0ubuntu0.16.04.2) ...

Creating config file /etc/php/7.0/mods-available/zip.ini with new version
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.2) ...


Enable the apache rewrite module by running the following command.

root@linuxhelp:~# a2enmod rewrite 
Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart


After enabling the module, restart the apache service as shown below.

root@linuxhelp:~# systemctl restart apache2 


Then start downloading the package for open source social network by running the below command.

root@linuxhelp:~# wget https://www.opensource-socialnetwork.org/downloads/ossn-v4.2-1468404691.zip -O ossn.zip 
--2016-09-22 01:46:12--  https://www.opensource-socialnetwork.org/downloads/ossn-v4.2-1468404691.zip
Resolving www.opensource-socialnetwork.org (www.opensource-socialnetwork.org)... 104.27.133.60, 104.27.132.60, 2400:cb00:2048:1::681b:843c, ...
Connecting to www.opensource-socialnetwork.org (www.opensource-socialnetwork.org)|104.27.133.60|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1722062 (1.6M) [application/zip]
Saving to: ‘ ossn.zip’ 

ossn.zip                                      100%[===============================================================================================> ]   1.64M   478KB/s    in 3.5s    

2016-09-22 01:46:17 (478 KB/s) - ‘ ossn.zip’  saved [1722062/1722062]


Extract the downloaded package by using the unzip command.

root@linuxhelp:~# unzip ossn.zip -d /var/www/html/ 
Archive:  ossn.zip
   creating: /var/www/html/ossn/
  inflating: /var/www/html/ossn/.gitignore  
  inflating: /var/www/html/ossn/.travis.yml  
   creating: /var/www/html/ossn/actions/
   creating: /var/www/html/ossn/actions/administrator/
   creating: /var/www/html/ossn/actions/administrator/cache/
  inflating: /var/www/html/ossn/actions/administrator/cache/create.php  
  inflating: /var/www/html/ossn/actions/administrator/cache/flush.php  
   creating: /var/www/html/ossn/actions/administrator/component/
  inflating: /var/www/html/ossn/actions/administrator/component/com_install.php  
  inflating: /var/www/html/ossn/actions/administrator/component/delete.php  
  inflating: /var/www/html/ossn/actions/administrator/component/disable.php  
  inflating: /var/www/html/ossn/actions/administrator/component/enable.php  
  inflating: /var/www/html/ossn/actions/administrator/login.php
.
.
.
extracting: /var/www/html/ossn/vendors/tinymce/skins/lightgray/img/object.gif  
  inflating: /var/www/html/ossn/vendors/tinymce/skins/lightgray/img/trans.gif  
  inflating: /var/www/html/ossn/vendors/tinymce/skins/lightgray/img/wline.gif  
  inflating: /var/www/html/ossn/vendors/tinymce/skins/lightgray/skin.ie7.min.css  
  inflating: /var/www/html/ossn/vendors/tinymce/skins/lightgray/skin.min.css  
   creating: /var/www/html/ossn/vendors/tinymce/themes/
   creating: /var/www/html/ossn/vendors/tinymce/themes/modern/
  inflating: /var/www/html/ossn/vendors/tinymce/themes/modern/theme.min.js  
  inflating: /var/www/html/ossn/vendors/tinymce/tinymce.min.js


Create Database and Database user for open source social network in Mysql database as shown below.

root@linuxhelp:~# mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with   or g.
Your MySQL connection id is 4
Server version: 5.7.15-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.

mysql>  SET GLOBAL sql_mode=' '  
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql>  CREATE DATABASE ossn_db 
Query OK, 1 row affected (0.02 sec)

mysql>  CREATE USER ' ossn_user' @' localhost'  IDENTIFIED BY ' 123'  
Query OK, 0 rows affected (0.07 sec)

mysql>  GRANT ALL PRIVILEGES ON ossn_db.* TO ' ossn_user' @' localhost'  
Query OK, 0 rows affected (0.02 sec)

mysql>  FLUSH PRIVILEGES 
Query OK, 0 rows affected (0.03 sec)

mysql>  exit
Bye


Open the php.ini file and then verify that the following parameters are correctly set on this file.

root@linuxhelp:~# vim /etc/php/7.0/cli/php.ini 


Now modify the following parameters on the php.ini file.

allow_url_fopen = On
file_uploads = On
upload_max_filesize = 32M


Create a new directory for upload and set the ownership for the directory.

root@linuxhelp:~# mkdir -p /var/www/ossndatadir 
root@linuxhelp:~# chown www-data:www-data -R /var/www/html/ossn/ 


Finally we need to create virtual host entry for apache. Create a new apache configuration file for the virtual host and then create a soft link for the config file as shown below.

root@linuxhelp:~# touch /etc/apache2/sites-available/ossn.conf
root@linuxhelp:~# ln -s /etc/apache2/sites-available/ossn.conf /etc/apache2/sites-enabled/ossn.conf
root@linuxhelp:~# vim /etc/apache2/sites-available/ossn.conf 


Add the following entry into it.

< VirtualHost *:80> 

ServerAdmin admin@linuxhelp.com
DocumentRoot /var/www/html/ossn/
ServerName linuxhelp.com
ServerAlias www.linuxhelp.com

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

Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

< /Directory> 

ErrorLog /var/log/apache2/linuxhelp.com-error_log
CustomLog /var/log/apache2/linuxhelp.com-access_log common

< /VirtualHost> 

Finally restart the apache service by running the following command.

root@linuxhelp:~# systemctl restart apache2 

To launch Open Source Social Network

Open the browser and navigate to http://< IP_address>

Click next to proceed further.

Fill all the requirements and click install.

Then start creating the Admin account.

Enter the Username and Password.

FAQ
Q
Hello, i'd like to add some new fields on the registration form (city, mobile number, interest, etc...) and this must be present also in the "users" table on MySql database...

it is possible in OSSN v.4 ?
A
It wont store in user table , but you can store it in metadata and retrieve it .
Q
How to entry to the site hostfile in ossn?
A
Run the following method,
# vim /etc/hosts
ip address domainname
Q
How to enable the site access in ossn?
A
Run the following command,
# a2ensite file.conf
Q
I would like to know if ossn it made to work with a email() function. If not, can I change it myself ? In this case, where to change it ?
A
Install the SMTP component and configure it to establish a working mail channel by entering the same credentials you would normally use for sending mails with Mozilla Thunderbird, MS-Outlook, or any other mail client. In doubt ask your provider for the necessary details.

The component is available here:
https://github.com/opensource-socialnetwork/SMTP
Q
Do I have to make web configuration too?
A
Yes inorder to lauch you need pre installation setup