How to Install Friendica on OpenSUSE Latest
Friendica is an open-source social networking platform that supports multiple social networks, including Twitter, Facebook, and Diaspora. In this tutorial, we will explain how to install Friendica on the latest version of OpenSUSE.
Prerequisites
Before we proceed with the installation, make sure you have the following prerequisites already installed:
- A fresh installation of the latest version of OpenSUSE
- Apache web server
- PHP 7.4 or higher
- MariaDB or MySQL database server
- Composer (PHP package manager)
Step 1: Install Apache Web Server
To install the Apache web server, open the terminal and run the following command:
sudo zypper in apache2
Once the installation is complete, start the Apache web server using the following command:
sudo systemctl start apache2
Enable the Apache web server to start at boot time using the following command:
sudo systemctl enable apache2
Step 2: Install PHP
Friendica requires PHP 7.4 or higher to run. To install PHP 7.4 on OpenSUSE, run the following commands:
sudo zypper in php74 php74-mysql php74-mbstring php74-gd php74-zip php74-ldap
Once the installation is complete, restart the Apache web server to apply the changes using the following command:
sudo systemctl restart apache2
Step 3: Install MariaDB
Friendica requires a database server to store its data. In this tutorial, we will use MariaDB as our database server. To install MariaDB on OpenSUSE, run the following command:
sudo zypper in mariadb mariadb-client
Once the installation is complete, start the MariaDB server using the following command:
sudo systemctl start mysql
Enable the MariaDB server to start at boot time using the following command:
sudo systemctl enable mysql
Step 4: Create a Database and User for Friendica
Before we proceed with the Friendica installation, we need to create a database and a user for Friendica in the MariaDB server. Follow the steps below to create a database and user:
Log in to the MariaDB server using the following command:
sudo mysql -u root -pEnter the root user's password when prompted.
Create a new database and user for Friendica using the following commands:
CREATE DATABASE friendica; CREATE USER 'friendicauser'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON friendica.* TO 'friendicauser'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;Replace
your_passwordwith a strong password.Exit the MariaDB server using the following command:
exit
Step 5: Install Composer
Friendica uses Composer as its package manager. To install Composer on OpenSUSE, run the following command:
sudo zypper in composer
Step 6: Download and Install Friendica
To download and install Friendica on OpenSUSE, follow the steps below:
Open the terminal and navigate to the
/srv/www/htdocs/directory using the following command:cd /srv/www/htdocs/Download the Friendica package using the following command:
git clone https://github.com/friendica/friendica.gitNavigate to the Friendica directory using the following command:
cd friendicaInstall the required dependencies using Composer using the following command:
composer installCopy the
config/local.config.php.samplefile toconfig/local.config.phpusing the following command:cp config/local.config.php.sample config/local.config.phpEdit the
config/local.config.phpfile and replace the following lines:// Database configuration $db_type = ""; $db_host = ""; $db_port = ""; $db_name = ""; $db_user = ""; $db_pass = "";With:
// Database configuration $db_type = "mysql"; $db_host = "localhost"; $db_port = "3306"; $db_name = "friendica"; $db_user = "friendicauser"; $db_pass = "your_password";Use the database credentials created in step 4 to replace
friendicauserandyour_password.Change the ownership of the Friendica directory to the Apache web server user using the following command:
sudo chown -R wwwrun:www /srv/www/htdocs/friendica
Step 7: Configure Apache for Friendica
To configure Apache for Friendica, create a new virtual host configuration file using the following command:
sudo nano /etc/apache2/vhosts.d/friendica.conf
Add the following content to the file:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /srv/www/htdocs/friendica
ServerName example.com
ErrorLog /var/log/apache2/friendica_error_log
CustomLog /var/log/apache2/friendica_access_log common
DirectoryIndex index.php
<Directory /srv/www/htdocs/friendica>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Replace example.com with your domain name. Also, make sure to create an A record for your domain name to point to your server IP address.
Save and close the file.
Restart the Apache web server using the following command:
sudo systemctl restart apache2
Step 8: Access Friendica
You can now access your Friendica installation by opening a web browser and navigating to your domain name.
Congratulations! You have successfully installed Friendica on OpenSUSE.