قالب وردپرس درنا توس
Home / How To / How to install Wallabag on Ubuntu 18.04 LTS

How to install Wallabag on Ubuntu 18.04 LTS



Wallabag is a reading of the latter type of service. It lets you save web pages so you can read it later at your own leisure pace. There are many services that allow you to do it like Pocket, Instapaper etc. But having a service installed on a server you own is advantageous. First, it will not run and remove the links with it. And you get to keep your surfing data private.

This tutorial will cover how to install and install Wallabag on a server running on Ubuntu 18.04 and later. It will also cover how to install Nginx, MariaDB, Git, Postfix, Composer and PHP all required by Wallabag to run.

Prerequisites

You would need the following before proceeding with our tutorial.

  • An Ubuntu 1

    8.04-based server that has a non-root user with sudo privileges.

  • You also need the Make tool. To install it, just use the command

      $ sudo apt install make
    

Installing git

The first step is to install Git which we will later use to copy the wallabag installation files from its git repository. Git will usually be installed on most web servers. If it is not, continue with the following commands.

  $ sudo apt install git 
$ git config - global user.name "Your name"
$ git config - global user.email "[email protected]"

Install Nginx

  $ sudo apt install nginx 

If you are using Ubuntu's firewall, then add the following rules to its list.

  $ sudo ufw allow "Nginx HTTP" 

Check status too.

  $ sudo ufw status 

You should see something like this

  Status: active

For action from
- ------ ----
OpenSSH ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)

Try accessing the server's IP address in the browser. You should see the following standard Nginx page that confirms that Nginx is installed.

 Nginx Welcome Page

Install MariaDB

MariaDB is a drop-in replacement for MySQL which means commands for running and using MariaDB are the same as for MySQL. To install MariaDB, issue the following commands

  $ sudo apt install mariadb server 

Run the following command to perform the default configuration such as providing a root password, removing anonymous users, removing root logins remotely, and releasing test tables. Press yes for everything and set a root password.

  $ sudo mysql_secure_installation 

There is a reservation with setting the root password. With MariaDB by default, system root users log on to MariaDB without a password. But if you are going to use a third-party application to access via root, a password is a must, otherwise apps like PHPMyAdmin will fail. For this, you need to disable plugin-based authentication, which is the default option on MariaDB.

To disable plugin authentication and reset the root password, first enter the MySQL prompt using the following command.

  $ sudo mysql -u root 

Enter the following commands to disable plugin authentication.

  used mysql; 
update user set plugin = & # 39; & # 39; where User = & # 39; root & # 39 ;;
flush privileges;
exit

After this restart of your MariaDB service.

  $ sudo systemctl restart mariadb.service 

That's it. Next time you want to log in to MySQL, use the following command

  $ sudo mysql -u root -p 

And you will be prompted for your root password that you first set.

Configuring MariaDB for Wallabag [19659004] Now we need to create a database to use for the wallabag application. To make that login to the MySQL prompt. We assume that you use the default authentication method of MariaDB (ie without using root passwords) for the rest of the tutorial.

  $ sudo mysql -u root 

Once at the prompt, enter the following commands that will install a database named wallabag and a database user named wallabaguser and give it access to the database.

  create database wallabag;
create user [email protected];
set password for [email protected] = password ("your password");
grant all privileges on wallabag. * to [email protected] identified with "your password";
flush privileges;
output

Installing PHP and Composer

Now that our server is up, it's time to install PHP and Composer. Since we use Nginx, we need to install the PHP-FPM package. Along with that, we will need several other PHP extensions such as mbstring, mysql, gd, bc-math, curl, zip and xml.

  $ sudo apt install php-fpm php-mysql php-bcmath php-xml php-zip php-curl php-mbstring php-gd php-stylish php-gettext php tokenizer 
$ sudo apt install composer [19659013] That's it for now. We will come to the configuration part of PHP and composer later. Let's go to the next step.

Configuring Nginx

It is time to configure our Nginx installation before proceeding with the actual installation. Suppose that the domain name you use for wallabag is example.com, create a directory where you host your installation. Wallabag will be installed in the html directory.

  $ sudo mkdir -p /var/www/example.com/html 

Then you assign ownership of the directory to www data used by Nginx. [19659010] $ sudo chown -R www-data: www-data /var/www/example.com/html

Make sure the correct permissions are set.

  $ sudo chmod -R 755 / var / www / example. com 

Then create a virtual host for the site.

  sudo nano /etc/nginx/sites-available/example.com 

Paste the following configuration that works with wallabag.

  server {
server name example.com www.example.com;
root / var / www / example / html / web;

location / {
try_files $ uri /app.php$is_args$args;
}
location ~ ^ / app  .php (/ | $) {
# replace php7.2-fpm with which php 7.x version you are using
fastcgi_pass unix: /run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^ (. + . php) (/.*) $;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $ realpath_root $ fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $ realpath_root;
internal;
}

location ~  .php $ {
return 404;
}

error_log /var/log/nginx/wallabag_error.log;
access_log /var/log/nginx/wallabag_access.log;
}

To save the file, press Ctrl + X and enter Y when prompted. Then we need to enable this configuration. To do this, you create a link from the site-activated directory.

  $ sudo ln -s /etc/nginx/sites-available/example.com / etc / nginx / sites-enabled / 

You may encounter a memory problem due to additional server names. To fix it, open the nginx.conf file

  $ sudo nano /etc/nginx/nginx.conf 

Find the server_names_hash_bucket_size directive and remove the # symbol to remove that row:

  server_names_hash_bucket_size 64; 

Save the file. Next, make sure there are no errors in Nginx configurations.

  $ sudo nginx -t 

If there are no problems, restart Nginx to activate the new changes.

  $ sudo systemctl restart nginx 

Install Wallabag

First clone wallabag from its GitHub archive. Since we gave the permissions of the html directory to www data users, we have to switch to it to run the installation.

  $ sudo -u www-data / bin / bash
$ cd /var/www/example.com
git clone https://github.com/wallabag/wallabag.git html

This copies the wallabag installation files to the html directory. Install Wallabag with the make command.

  $ cd html
$ make install

You will be asked several questions during the installation.

To use http enter http://example.com instead of being prompted for the domain name and skip the HTTPS section of the tutorial.

  database_driver (pdo_mysql): pdo_mysql
database_driver_class (null): Press Enter
database_host (127.0.0.1): 127.0.0.1
database_port (null): 3306
database name (wallabag): wallabag
database_user (root): wallabaguser
database_password (null): wallabagpassword
database_path (null): Press Enter
database_table_prefix (wallabag_): Prefix of your choice or Press Enter for default.
database_socket (null): Press Enter
database_charset (utf8mb4): Press Enter
domain_name (& # 39; https: //your-wallabag-url-instance.com'): http://example.com

You will also be prompted for SMTP details to receive forgotten password or two-factor authentication emails. If you want to use a third-party SMTP service like Mailgun or Sendgrid, you can fill in the remaining values ​​or just press Enter through them. Enter no against the parameter fosuser_registration if you do not want anyone to register on your site. Also, change the value of the parameter secretly . If you have big data to import, install RabbitMQ or Redis and enter the values ​​when prompted.

When prompted to restore your existing database, press Enter to use the default option (No). You will also be prompted to create an administrator user.

Switch back to the default setting for Ubuntu users when done.

  $ exit

Configure SMTP

If you want to configure a basic SMTP server and not use third-party SMTP services, install Mailutils.

  $ sudo apt install mailutil

During installation, it will ask you to select a Postfix configuration type. Select Internet Website and continue. Enter example.com when prompted for the System mail name field. It is.

Configure HTTPS

We will use Let's Encrypt to configure HTTPS for our wallabag installation. Add the following archive for the Certbot tool.

  $ sudo add-apt-repository ppa: certbot / certbot

Install the Certbot Nginx package from the repository.

  $ sudo apt install python-certbot-nginx

Get the certificate for your domain example.com.

  $ sudo certbot --nginx -d example.com -d www.example.com

If this is your first time using the Certbot tool, you will be prompted to send an email and accept the terms of use. You will also be asked if you would like your e-mail to be shared with the Electronic Frontier Foundation (EFF). Select N if you do not want EFF to email you about their news and promotions.

If successful, Certbot will ask you how to configure your HTTPS settings.

  Please choose whether or not to redirect HTTP traffic to HTTPS, remove HTTP access.
-------------------------------------------------- -----------------------------
1: No Redirect - Make no further changes to the web server configuration.
2: Redirect - Makes all requests redirect to secure HTTPS access. Select this for
new websites, or if you are sure your site is working on HTTPS. You can undo this
change by editing your web server configuration.
-------------------------------------------------- -----------------------------
Select the appropriate number [1-2] and then [enter] (press & # 39; c & # 39; to cancel):

Select 2 because we want all requests to your domain to be redirected to https.

That's it. Your HTTPS domain is live. Certbot automatically renews your domain after every 90 days. To test the renewal process, do a dry run.

  $ sudo certbot renewal - drought

If you see no errors, it means everything is perfect.

Configure Wallabag

Now that we have installed wallabag, open your wallabag domain. The following screen would appear.

 Wallabag Login

Enter the references you chose under factory above. After logging in, you should see the following screen.

 Wallabag dashboard

You should enable two-factor authentication. To do so, click the Config button on the left and select USER INFORMATION from the following screen. Activate the check mark Two-factor authentication to activate it.

 Wallabag settings

You can import your data from pockets, inlets, pinboards and bookmarks from Firefox and Chrome-based browsers.

Wallabag provides you with a variety of apps for any browser, mobile or ebook reader to which you can add links. And if nothing else is on your mind, you can even use a Bookmarklet whose details you can access from How to in your settings.

 How to use Wallabag

Upgrading Wallabag

To upgrade Wallabag to the latest version, just issue the following commands.

  $ sudo -u www-data / bin / bash
$ cd /var/www/example.com/html
$ does update

That's it for this tutorial. Now you can save and read articles from your server without compromising the privacy of your data.


Source link