Open Source Social Network (OSSN) is a social networking software written in PHP used by website developers to create social networking websites. The installation process is easy and it takes only a couple of minutes.
At the time of writing this tutorial, the latest stable version of Open Source Social Network is 4.2 and it requires:
- PHP 5.4 or higher (preferably the latest), compiled with cURL, mcrypt, MySQLi, ZIP, JSON, XML PHP extensions and GD PHP Library enabled.
- allow_url_fopen option enabled in PHP
- Apache Web Server 2.0 or higher compiled with mod_rewrite module;
This install guide assumes that Apache is already installed and configured on your virtual server.
Let’s start with the installation. Make sure your server OS packages are fully up-to-date:
apt-get update apt-get upgrade
Enable Apache rewrite module if it is not already done so:
Install required PHP packages:
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
Restart the Apache service for the changes to take effect:
service apache2 restart
Download the latest version of Open Source Social Network available at http://www.opensource-socialnetwork.org/download to a directory on the server and extract it using the following commands:
cd /opt/ wget https://www.opensource-socialnetwork.org/downloads/ossn-v4.2-1468404691.zip -O ossn.zip unzip ossn.zip -d /var/www/html/
Create a new MySQL database and user for OSSN:
mysql -u root -p mysql> SET GLOBAL sql_mode=''; mysql> CREATE DATABASE ossndb; mysql> CREATE USER 'ossnuser'@'localhost' IDENTIFIED BY 'y0ur-pAssW0RD'; mysql> GRANT ALL PRIVILEGES ON ossndb.* TO 'ossnuser'@'localhost'; mysql> FLUSH PRIVILEGES; mysql> quit
Do not forget to replace ‘y0ur-pAssW0RD’ with a strong password.
Edit the PHP configuration file (/etc/php/7.0/cli/php.ini):
and modify these lines:
allow_url_fopen = On file_uploads = On upload_max_filesize = 32M
OSSN needs a directory for storing the uploaded files such as images. For security reasons we will create this directory outside of the document root directory:
mkdir -p /var/www/ossndatadir
All files have to be readable by the web server, so set a proper ownership:
chown www-data:www-data -R /var/www/html/ossn/
Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘ossn.conf’ on your virtual server:
touch /etc/apache2/sites-available/ossn.conf ln -s /etc/apache2/sites-available/ossn.conf /etc/apache2/sites-enabled/ossn.conf vi /etc/apache2/sites-available/ossn.conf
Then, add the following lines:
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/html/ossn/ ServerName your-domain.com ServerAlias www.your-domain.com <Directory /var/www/html/ossn/> Options FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/your-domain.com-error_log CustomLog /var/log/apache2/your-domain.com-access_log common </VirtualHost>
Remove the 000-default.conf file:
Restart the Apache web server for the changes to take effect:
service apache2 restart
Open your favorite web browser, navigate to http://your-domain.com/ , verify that all installation prerequisites are met and the OSSN installer should be starting. You should follow the easy instructions on the install screen inserting the necessary information as requested. Do not forget to set data directory to ‘/var/www/ossndatadir’.
That is it. The Open Source Social Network has been installed on your server.
Log in to the OSSN administration back-end at http://your-domain.com/administrator and configure OSSN according to your needs.
Of course, you don’t have to do any of this if you use one of our OSSN VPS Hosting services, in which case you can simply ask our expert Linux admins to install Open Source Social Network for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.