- Log into the Debian device
- Run the following commands in a terminal:
# update software repositories
sudo apt update
# install software updates
sudo apt upgrade -y
# install Apache and MySQL
sudo apt install apache2 mariadb-server mariadb-client -y
# install PHP components
sudo apt install php7.3 libapache2-mod-php7.3 php7.3-curl php7.3-mbstring php7.3-xml php7.3-fpm php7.3-gd php7.3-gmp php7.3-intl php7.3-mysql php7.3-json -y
# download gnu social
wget -O ~/Downloads/gnu-social-master.tar.gz https://git.gnu.io/gnu/gnu-social/-/archive/master/gnu-social-master.tar.gz
# extract the tar.gz
tar zxf ~/Downloads/gnu-social-*.tar.gz --directory ~/Downloads
# move the folder to web root
sudo mv ~/Downloads/gnu-social-*/ /var/www/html/gnusocial
# set permissions
sudo chown -R www-data:www-data /var/www/html/gnusocial/
sudo chmod g+w /var/www/html/gnusocial/
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- Type Y and press Enter to set a root password, type the password twice to confirm
- Type Y and press Enter to remove anonymous users
- Type Y and press Enter to disallow root login remotely
- Type Y and press Enter to remove the test database
- Type Y and press Enter to reload privilege tables
- Run the following command to login into MySQL:
mysql -u root -p
- Authenticate with the root password set earlier
- Run the following commands to create the GNU Social database and database user
CREATE DATABASE gnusocial CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'gnusocial_rw'@'localhost' IDENTIFIED BY 'gnu$ocia1!!';
GRANT ALL PRIVILEGES ON gnusocial.* TO 'gnusocial_rw'@'localhost';
FLUSH PRIVILEGES;
EXIT;
exit - Continue with the following commands:
# edit default apache conf
sudo nano /etc/apache2/sites-available/000-default.conf - Paste the following at the bottom of the .conf file
<Directory /var/www/html/gnusocial/>
AllowOverride all
</Directory> - Press CTRL+O, Enter, CTRL+X to write the changes
- Continue with the following commands:
# enable .htaccess in ./gnusocial
sudo cp /var/www/html/gnusocial/htaccess.sample /var/www/html/gnusocial/.htaccess
# set the relative path in .htaccess
sudo sed -i "s/RewriteBase \//RewriteBase \/gnusocial\//g" /var/www/html/gnusocial/.htaccess
# enable apache2 modules
sudo a2enmod rewrite
# restart apache2
sudo systemctl restart apache2 - Open a web browser and navigate to http://DNSorIP/gnusocial/install.php
- The GNU Social installation screen should be displayed
- Enter a site name and fill out the database connection information as follows
Hostname: localhost
Name: gnusocial
DB username: gnusocial_rw
DB password: gnu$ocia1!! - Enter an administrator username, password and email
- Click the Submit button
- After the installation completes, click the visit your new GNU social site link toward the bottom of the page
- Click Login at the top right of the page
- Login with the administrator user created during initialization
- Welcome to GNU Social
Source: https://git.gnu.io/gnu/gnu-social/blob/master/INSTALL