Install GNU social on Debian 8

GNU social is an open source social media platform. Users on your own server can follow users on other servers and vice versa, essentially making it a distributed social media platform. It doesn’t do a whole lot but what it does it does well.

I’m installing on Debian 8.

Install Debian with the web server role installed. If you are installing on an existing server without a web server do
[code]
# tasksel, select web server and choose Ok.
[/code]

Create the database

Create a database for GNU social:
[code]
# mysql -u root -p
CREATE DATABASE gnusocial;
CREATE USER gnusocial;
SET PASSWORD FOR gnusocial=PASSWORD("Passw0rd");
GRANT ALL PRIVILEGES on gnusocial.* TO gnusocial@localhost IDENTIFIED BY "Passw0rd";
FLUSH PRIVILEGES;
EXIT
[/code]

Download the code

At the moment GNU social is being packaged for Debian so for the time being we should use git to download the code.

Install git:
[code]
# aptitude install git
[/code]

Change to the web root and download GNU social:
[code]
# cd /var/www
# git clone https://git.gnu.io/gnu/gnu-social.git
[/code]

Configure Apache

In /etc/apache2/sites-available/000-default.conf change
[code]
# ServerName www.example.com
DocumentRoot /var/www/html
[/code]
to
[code]
ServerName www.example.com
DocumentRoot /var/www/gnu-social
<Directory /var/www/gnu-social/>
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
[/code]

Replace www.example.com by your own domain name.

Enable pretty URL’s: enable the rewrite mod in Apache and copy the htaccess file:
[code]
# a2enmod rewrite
# mv /var/www/gnu-social/htaccess.sample /var/www/gnu-social/.htaccess
[/code]

Set permissions on the GNU social folder:
[code]
# chown -R www-data:www-data /var/www/gnu-social
[/code]

Reload Apache to reflect the changes:
[code]
# service apache2 reload
[/code]

Configuration via browser

Open the site in your browser: http://www.example.com/install.php

Database settings:
Hostname: localhost
Name: gnusocial
DB username: gnusocial
DB password: Passw0rd

After this setup GNU social throws me a bunch of errors but it works anyway.

Tweaks

To install a theme check /var/www/gnu-social/theme/ to see which themes are available. Pick one and in /var/www/gnu-social/config.php add the line
[code]
$config[‘site’][‘theme’] = ‘yourthemename’;
[/code]

Back to Top