How to Install Foswiki on AlmaLinux, Rocky Linux, Debian, and Ubuntu

Foswiki is an open-source wiki software that allows users to create and manage content collaboratively. In this guide, we’ll walk you through the process of installing Foswiki on AlmaLinux, Rocky Linux, Debian, and Ubuntu.


Prerequisites:

Before starting the installation, ensure the following:

  • A server running AlmaLinux, Rocky Linux, Debian, or Ubuntu.
  • Root or sudo access to your server.
  • A LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) installed.
  • A domain or subdomain pointing to your server.

Step 1: Update the System

Start by updating the server to make sure all system packages are up to date.

  • On Ubuntu/Debian:
 
sudo apt update && sudo apt upgrade -y
  • On AlmaLinux/Rocky Linux:
 
sudo dnf update -y

Step 2: Install Required Software

Foswiki requires Apache, MySQL/MariaDB, and Perl. Install the necessary packages.

  • For Ubuntu/Debian:
 
sudo apt install apache2 mariadb-server perl libapache2-mod-perl2 libdbi-perl libdbd-mysql-perl php php-mysql unzip wget -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf install httpd mariadb-server perl mod_perl perl-DBI perl-DBD-MySQL php php-mysqlnd unzip wget -y

Step 3: Configure the Database

Foswiki requires a MySQL or MariaDB database for storing content. Let’s create a database for Foswiki.

  1. Log in to MariaDB:
 
sudo mysql -u root -p
  1. Create a database and user:
sql
 
CREATE DATABASE foswiki_db; CREATE USER 'foswiki_user'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON foswiki_db.* TO 'foswiki_user'@'localhost'; FLUSH PRIVILEGES; EXIT;

Step 4: Download and Extract Foswiki

  1. Download the latest version of Foswiki from the official website or by running:
 
wget https://foswiki.org/Download/FoswikiRelease/latest/tar.gz
  1. Extract the downloaded file:
 
tar -xzvf foswiki-latest.tar.gz -C /var/www/html/
  1. Set proper permissions:
 
sudo chown -R www-data:www-data /var/www/html/foswiki # For Ubuntu/Debian sudo chown -R apache:apache /var/www/html/foswiki # For AlmaLinux/Rocky Linux

Step 5: Configure Apache (for AlmaLinux/Rocky Linux)

  1. Create a new virtual host configuration for Foswiki:
 
sudo nano /etc/httpd/conf.d/foswiki.conf
  1. Add the following content:
 
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/foswiki ServerName yourdomain.com ErrorLog /var/log/httpd/error_log CustomLog /var/log/httpd/access_log combined </VirtualHost>
  1. Restart Apache:
 
sudo systemctl restart httpd

Step 6: Configure Apache (for Ubuntu/Debian)

  1. Create a new virtual host configuration:
 
sudo nano /etc/apache2/sites-available/foswiki.conf
  1. Add the following content:
 
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/foswiki ServerName yourdomain.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
  1. Enable the new site and restart Apache:
 
sudo a2ensite foswiki.conf sudo systemctl restart apache2

Step 7: Complete the Foswiki Web Installation

  1. Open your browser and navigate to your server's IP address or domain name (e.g., http://yourdomain.com).

  2. The Foswiki installation page will appear. Enter your database details:

    • Database type: MySQL
    • Database name: foswiki_db
    • Database username: foswiki_user
    • Database password: your_password
  3. Complete the installation process by following the instructions on the screen.


Step 8: Clean Up

  1. Remove the installation file for security:
 
sudo rm -rf /var/www/html/foswiki/bin/configure
  1. Set proper permissions for Foswiki directories:
 
sudo chmod -R 755 /var/www/html/foswiki

Conclusion

You have successfully installed Foswiki on your AlmaLinux, Rocky Linux, Debian, or Ubuntu server. You can now access your Foswiki instance and start creating content at http://yourdomain.com

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution