RHEL BasedRocky Linux

How To Install Wallabag on Rocky Linux 9

Install Wallabag on Rocky Linux 9

In this tutorial, we will show you how to install Wallabag on Rocky Linux 9. Are you tired of losing track of all the articles, news, and blog posts you want to read? Do you find yourself bookmarking endless pages and then forgetting about them? If so, you may benefit from Wallabag, a self-hosted open-source application that allows you to save and organize articles for later reading.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Wallabag on Rocky Linux. 9.

Prerequisites

  • A server running one of the following operating systems: Rocky Linux 9.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Wallabag.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Wallabag on Rocky Linux 9

Step 1. The first step is to update your system to the latest version of the package list. To do so, run the following commands:

sudo dnf check-update
sudo dnf install dnf-utils epel-release mod_ssl

Step 2. Installing Apache.

By default, Apache is available on the Rocky Linux 9 base repository. Now we install the latest version of Apache using dnf the command:

sudo dnf install httpd httpd-tools

You can start the httpd service and configure it to run on startup by entering the following commands:

sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl status httpd

To make your pages available to the public, you will have to edit your firewall rules to allow HTTP and HTTPS requests on your web server by using the following commands:

sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https 
sudo firewall-cmd --reload

For additional resources on installing Apache, read the post below:

Step 3. Installing PHP.

PHP is a popular scripting language that powers the dynamic content of millions of websites and apps. Now we run the commands below to install PHP 8 to your Rocky Linux:

sudo dnf epel-release
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
sudo dnf --disablerepo="*" --enablerepo="remi-safe" list available 
sudo dnf module enable php:remi-8.1

Once Remi PHP 8.1 module is enabled, you can now install PHP 8.1 and commonly used PHP extensions as follows:

sudo dnf install php php-cli php-mysqlnd php-opcache php-xml php-gd php-pdo php-bcmath php-intl php-mbstring php-json php-zip unzip

Check and verify the installed version:

php -v

For additional resources on installing PHP, read the post below:

Step 4. Installing MariaDB.

By default, MariaDB is available on the Rocky Linux 9 base repository. Simply install the MariaDB package by using the dnf command:

sudo dnf install mariadb-server mariadb

After the installation is completed, start the service of the Database server and then enable the same, so that it could start itself automatically with the system reboot:

sudo systemctl restart mariadb
sudo systemctl status mariadb
sudo systemctl enable mariadb

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

First, log into the MariaDB shell with the following command:

mysql

Now we create a database and user for Wallabag with the following command:

MariaDB [(none)]> CREATE DATABASE wallabag_db;
MariaDB [(none)]> CREATE USER 'wallabag_user'@'localhost' IDENTIFIED BY 'your-strong-password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wallabag_db.* TO 'wallabag_user'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit

For additional resources on installing MariaDB Database, read the post below:

Step 5. Installing Wallabag on Rocky Linux 9.

Now download the latest version of Wallabag from the official GitHub page using the following command:

cd /var/www/html
sudo git clone https://github.com/wallabag/wallabag.git

Step 6. Configuring Apache.

We need to create a new virtual host configuration file for Wallabag:

nano /etc/httpd/conf.d/wallabag.conf

Add the following lines to the file:

<VirtualHost *:80>
   ServerName your-domain.com
   DocumentRoot /var/www/html/wallabag/web

   <Directory /var/www/html/wallabag/web>
     AllowOverride All
     Order Allow,Deny
     Allow from All
   </Directory>

   ErrorLog /var/log/httpd/wallabag_error.log
   CustomLog /var/log/httpd/wallabag_access.log combined
</VirtualHost>

Save and close the file, then restart the Apache web server for the changes to take effect:

sudo systemctl restart httpd

Step 7. Configure Wallabag.

To configure Wallabag, we need to edit the parameters.yml file located in the /var/www/wallabag/app/config/ directory. We can edit the file using the following command:

nano /var/www/wallabag/app/config/parameters.yml

In the file, find the following lines:

# This file is auto-generated during the composer install
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: null
database_name: wallabag_db
database_user: wallabag_user
database_password: your-strong-password
secret: your_secret_here

Step 8. Initialize Wallabag.

To initialize Wallabag, we need to run the following commands in the /var/www/wallabag/ directory:

sudo php bin/console wallabag:install --env=prod
sudo chown -R www-data:www-data /var/www/wallabag/

The first command will initialize Wallabag and set up the database schema. The second command will change the ownership of the Wallabag files to the Apache user, which is required for proper operation.

Step 9. Secure Wallabag with Let’s Encrypt SSL.

First, install the Certbot client using the following command below:

sudo dnf install certbot python3-certbot-apache

Then, run the following command to generate certificates with Apache:

sudo certbot --apache

Let’s Encrypt certificates have 90 days of validity, and it is highly advisable to renew the certificates before they expire. You can test automatic renewal for your certificates by running this command:

sudo certbot renew --dry-run

Step 10. Accessing Wallabag Web Interface.

Once successfully installed, now open your web browser and access the Wallabag web interface using the URL https://your-domain.com. You will be redirected to the following page:

Install Wallabag on Rocky Linux 9

Congratulations! You have successfully installed Wallabag. Thanks for using this tutorial for installing Wallabag with LAMP on your Rocky Linux 9 system. For additional help or useful information, we recommend you check the official Wallabag website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button