How to Install GNU Social on Fedora Server
Introduction
GNU Social is an open-source social networking platform that is similar to Twitter. It is written in PHP and is compatible with the OStatus standard. In this tutorial, we will guide you on how to install GNU Social on the latest version of Fedora Server.
Prerequisites
Before proceeding with the installation, make sure your server has the following components installed:
- Apache: This is the web server used to host the GNU Social web application.
- PHP: GNU Social is a PHP-based application, and PHP is required to run it.
- MariaDB/MySQL: This is the database server that GNU Social uses to store data.
Installation Steps
Step 1: Update Fedora System
First, update the operating system to the latest version by running the following command:
sudo dnf update
Step 2: Install Required Packages
Next, install the required packages for GNU Social by running the following command:
sudo dnf install httpd mariadb mariadb-server php php-common php-json php-xml php-mysqli php-mbstring php-gd php-dom unzip wget
Step 3: Start and Enable Services
Start the Apache and MariaDB services by running the following commands:
sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl start mariadb
sudo systemctl enable mariadb
Step 4: Configuring MySQL/MariaDB
Now we need to secure the MariaDB installation by running the following command:
sudo mysql_secure_installation
You will be asked several questions to configure the MariaDB installation. Follow the prompts on the screen and configure the database server according to your requirements.
Step 5: Create a Database for GNU Social
Log in to the MySQL shell with the following command:
mysql -u root -p
Enter the password you set in the previous step. Now create a new database for GNU Social using the following command:
CREATE DATABASE socialdb;
Create a new MySQL user with the following command:
CREATE USER 'socialuser'@'localhost' IDENTIFIED BY 'password';
Replace 'password' with a strong password.
Grant appropriate privileges to the socialuser with the following command:
GRANT ALL PRIVILEGES ON socialdb.* TO 'socialuser'@'localhost' IDENTIFIED BY 'password';
Step 6: Download and Install GNU Social
Next, download the latest version of GNU Social from the official website, https://gnu.io/social/. You can download it to the /var/www/html directory using the following commands:
cd /var/www/html
sudo wget https://ftp.gnu.org/gnu/social/social-1.3.3.tar.gz
sudo tar xvf social-1.3.3.tar.gz
Rename the extracted directory to social:
sudo mv social-1.3.3 social
Set the appropriate permission to the GNU Social directory:
sudo chown -R apache:apache /var/www/html/social
sudo chmod -R 755 /var/www/html/social
Step 7: Configure GNU Social
Now we need to configure GNU Social. Navigate to /var/www/html/social/config/ directory:
cd /var/www/html/social/config/
Copy the example configuration file and make it writable using the following commands:
sudo cp config.php.example config.php
sudo chmod 777 config.php
Open the config.php file and set the appropriate values for the following configurations:
$_config['site']['name'] = 'Your Site Name';
$_config['db']['database'] = 'socialdb';
$_config['db']['user'] = 'socialuser';
$_config['db']['pass'] = 'password';
Save the file and change the permission to the config.php file to the default state:
sudo chmod 644 config.php
Step 8: Accessing GNU Social
Finally, you can access GNU Social by opening your browser and navigating to http://your_ip_address/social. Replace 'your_ip_address' with the actual IP address of your server.
Conclusion
Congratulations! You have successfully installed GNU Social on Fedora Server. You can now create your account and start using the open-source social media platform.