How to install Open Source Social Network on a CentOS 7 VPS

ossnOpen Source Social Network or simply OSSN is PHP based social networking application. Using OSSN you can create your own social network website and build relationships with your members. In this article we will explain how to install OSSN on a CentOS 7 VPS with Apache, MariaDB and PHP.

The installation is pretty simple. In order to run Open Source Social Network, your server needs to meet the several requirements
– PHP 5.3 or newer
– MySQL 5 or newer
– Apache web server
– Apache mod_rewrite
– PHP Function curl
– PHP GD Library
– JSON Support

Log in to your server as user root and make sure that all service are up to date by executing the following command

yum -y update

Install MariaDB database server on your CentOS 7 machine

yum install mariadb mariadb-server

Start the MariaDB database server and enable it to start on boot

systemctl start mariadb
systemctl enable mariadb

Run the ‘mysql_secure_installation’ script to secure the database server and set your MariaDB root password

Log in to the MariaDB server using the ‘root’ user and create a new database and user for OSSN:

mysql -u root -p
CREATE USER 'ossnuser'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON `ossn`.* TO 'ossnuser'@'localhost';

Next, we will install Apache web server

yum install httpd

Same as we did with MariaDB, start the Apache web server and add it to automatically start on the system start-up

systemctl start httpd
systemctl enable httpd

OSSN is PHP based application, so we need to install PHP among with few PHP modules

yum install php php-gd php-xml php-common

Go to OSSN’s official website and download the latest stable release which currently is OSSN version 2.3


Unpack the OSSN files to the document root directory on your server

unzip -d /var/www/html/

This will create new ‘ossn’ directory inside the document root.

Change the ownership of the directory

chown -R apache:apache /var/www/html/ossn

To find out where is your document root directory you can use the following command

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer

Now just $43 .99

grep -i '^documentroot' /etc/httpd/conf/httpd.conf

OSSN needs a directory for storing the uploaded files such as profile icons and photos. For security reasons we will create this directory outside of the document root directory

mkdir /var/www/ossndata

Next, create Apache virtual host for your domain. Create ‘/etc/httpd/conf.d/vhosts.conf’ directory with the following content

vim /etc/httpd/conf.d/vhosts.conf

IncludeOptional vhosts.d/*.conf

Create the virtual host

vim /etc/httpd/vhosts.d/

<VirtualHost YOUR_SERVER_IP:80>
DocumentRoot "/var/www/html/"
ErrorLog "/var/log/httpd/"
CustomLog "/var/log/httpd/" combined

<Directory "/var/www/html/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted

and finally restart Apache for the changes to take effect.

systemctl restart httpd

Now, open a web browser and head it to to finish the OSSN installation

Of course you don’t have to do any of this if you use one of our Linux 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. You might also want to consider reading How to Install Open Classifieds on CentOS 7.

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.

4 thoughts on “How to install Open Source Social Network on a CentOS 7 VPS”


    i get this error message; i’ve tried to chmod 666 the /var/www/html but no luck; could someone help me with this ? thanks

  2. “/etc/httpd/vhosts.d/” E212: Can’t open file for writing

    i get this error message …could someone help me out!!!!

    • You can get this error if the directory you are trying to create the file does not exist. Also, make sure that you have permissions to write into that directory.


Leave a Comment