How to install Bacula-web

Bacula-Web – a web-based tool for creating reports and monitoring Bacula.

Install the necessary components:

sudo apt-get install apache2 libapache2-mod-php5 php5-mysql php5-gd
sudo a2enmod php5
sudo a2enmod rewrite

Open the PHP configuration file in the editor and specify the time zone:

sudo nano /etc/php5/apache2/php.ini
date.timezone = Europe/Kiev

And also for the directory with Bacula-Web we specify the option:

sudo nano /etc/apache2/sites-enabled/000-default.conf
<Directory /var/www/html/bacula-web>
AllowOverride All

Restart apache2 to apply the changes:

sudo service apache2 restart

Let’s go to the web server directory, download the archive with the latest version of Bacula-web and unpack it:

cd /var/www/html
curl -O
mkdir -v /var/www/html/bacula-web
tar -xzf bacula-web-latest.tgz -C /var/www/html/bacula-web

Make a copy of the sample configuration file and open it for example in the text editor nano:

cd /var/www/html/bacula-web/application/config
cp -v config.php.sample config.php
sudo nano /var/www/html/bacula-web/application/config/config.php

Uncomment and configure MySQL parameters:

$config[0]['label'] = 'Backup Server';
$config[0]['host'] = 'localhost';
$config[0]['login'] = 'bacula';
$config[0]['password'] = 'test';
$config[0]['db_name'] = 'bacula';
$config[0]['db_type'] = 'mysql';
$config[0]['db_port'] = '3306';

Since some commands were executed through sudo, we will specify the correct owner of the files:

sudo chown -R www-data:www-data /var/www/html/bacula-web

This completes the installation, you can open the Bacula-Web from the http://SERVER/bacula-web link, and also it is advisable to look at the http://SERVER/bacula-web/test.php test page that will tell you whether all the necessary components are installed and configured.

See also:
Installing and Configuring Bacula

How to fix error VirtualBox “Unable to boot – please use a kernel appropriate for your CPU”

After running the virtual system in VirtualBox, I noticed the following error:

This kernel requires the following features not present on the CPU:
Unable to boot – please use a kernel appropriate for your CPU.

The error can be solved in several ways:

Method 1) When you turn on the computer, go into the BIOS and enable the virtualization in the processor settings (if the processor supports it).

Method 2) After opening VirtualBox, we will go into the settings of the virtual system created, namely “Settings” – “System” – “CPU” and put a tick near “Additional Options: Enable PAE/NX“. Click “OK” to save changes.

Done, this error should not be displayed.

Configuring Remote Access in Mikrotik Router

Open “IP”“Firewall” – the tab “Filter Rules”.
Click “Add new” to add a new rule.

Then set the following parameters:

Chain: input
Src. Address: here you can specify the IP address or network with which it is allowed to connect, if everyone is allowed, then we do not specify.
Protocol: tcp
Dst. Port: 80 (or 8291 for Winbox, 21 for ftp, 22 for ssh, 23 for telnet, udp 161 for snmp)
Action: accept

Click “OK” to add a rule.

After that, in the firewall, a rule will be created at the end of the list. Since it will be the last, and before it there is a rule prohibiting everything, then it must be dragged to the very top with the mouse, otherwise it will not be of use.

Through the command line, the rules will look like this:

/ip firewall filter add chain=input protocol=tcp dst-port=80 disabled=no action=accept

To pick up the list, you can do this (where 30 is the ID of the rule added):

/ip firewall filter print
/ip firewall filter move 30 destination=1

Or in the command itself, we indicate that you need to place the rule at the very beginning of the list:

/ip firewall filter add chain=input protocol=tcp dst-port=80 disabled=no action=accept place-before 0

Also in the menu “IP” – “Services” in the parameters of the desired service, you can add “Available From” the list of IP addresses from which you want to allow access. Access is restricted to both local and external addresses, so first of all you need to add the IP or subnet with which you are currently connected.

I’ll give an example of specifying IP through a terminal for example for telnet (similar to ftp, www, ssh, winbox):

/ip service set telnet address=,,

See also my article:
Configure Hairpin NAT on RouterOS (Mikrotik)

Reset password in Dahua DVRs

First, try the following standard logins and passwords:
1) admin admin или admin 123456 (local and network administrator)
2) 888888 888888 (local administrator)
3) 666666 666666 (restricted user)
4) default default (hidden user)
5) root vizxv (administrator when connecting via telnet)

If the passwords are not suitable, then perform the following steps:
1) Remove the battery from the DVR
2) Connect the screen to the DVR
3) The password is generated based on the current set date in the DVR, when we pulled out the battery, it should be reset by the year 2000 based on this, we use the login admin and password 668648 or 000000 for logging in. Also you can use the following program that can generate a password depending on the specified date .

Download DVR Password

After a successful login, you must immediately change the password.

See also:
Telnet commands for Dahua DVRs

Change wait_timeout and interactive_timeout in MySQL

wait_timeout – The number of seconds that the server waits for activity in a non-interactive connection before closing it.
At the time of connection, wait_timeout is taken from the global value wait_timeout or interactive_timeout depending on the client type (as defined by the CLIENT_INTERACTIVE connect option for mysql_real_connect ())

Connect to MySQL and see the current value:

mysql -u USER -p
show variables like "wait_timeout";
show variables like "interactive_timeout";

By default, the values wait_timeout and interactive_timeout are 28800 seconds = 8 hours.
You can set minimum 1, maximum – 31536000, maximum (for Windows) – 2147483.

You can change the value of wait_timeout by executing the SQL query, for example:

set global wait_timeout = 28800;
set global interactive_timeout = 28800;

That the set value has not been reset, it needs to be specified in the file /etc/mysql/my.cnf, in the mysqld block:

wait_timeout = 28800
interactive_timeout = 28800

Installing Redmine in Ubuntu

Redmine – server web application for managing projects and tasks.

On the test I will install Redmine in Ubuntu Server 16.04, MySQL will be used as the database, and so first we will install the necessary components:

sudo apt-get update
sudo apt-get install apache2 libapache2-mod-passenger
sudo apt-get install mysql-server mysql-client

Now perform the installation of Redmine:

sudo apt-get install redmine redmine-mysql

Check whether bundler gem is installed:

sudo gem update
sudo gem install bundler

Open the configuration file in the text editor passenger.conf:

sudo nano /etc/apache2/mods-available/passenger.conf

And after the line:

<IfModule mod_passenger.c>

Let’s add:

PassengerDefaultUser www-data

Create a symbolic link to Redmine in the web server directory:

sudo ln -s /usr/share/redmine/public /var/www/html/redmine

Open the web server configuration file in a text editor:

sudo nano /etc/apache2/sites-available/000-default.conf

And somewhere inside the VirtualHost block, we add:

<Directory /var/www/html/redmine>
    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on

Create a Gemfile.lock file and assign it to the owner of the web-server user www-data:

sudo touch /usr/share/redmine/Gemfile.lock
sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock

Restart the web server to apply all the changes:

sudo service apache2 restart

Now Redmine is installed and it can be opened by link http://HOST/redmine
Where it is necessary to press Enter, enter the standard login admin and password admin.


Managing Asterisk modules

Let’s connect to the Asterisk console:

sudo asterisk -rvv

Let’s see what modules are already in use:

module show

Files of modules with the extension * .so are in the directory /usr/lib/asterisk/modules/

To load and unload a module, commands are used (the module name is specified without a file extension, for example, not, but chan_sip):

module load NAME
module unload NAME

In order for the necessary modules to be loaded automatically when starting Asterisk, they must be specified in the file /etc/asterisk/modules.conf, for example, open it in the text editor nano:

sudo nano /etc/asterisk/modules.conf

You can enable the autoloading of all existing modules in the folder /usr/lib/asterisk/modules/:


And then we can exclude unnecessary ones using the following commands:

noload =>

Either prohibit downloading all and specify only those that are needed, for example:

;SIP VoIP driver
load =>
load =>
load =>
load =>
load =>
load =>
load =>
load =>
; List of required codecs
load =>
load =>
load =>
load =>
load =>
load =>
load =>
; If you use Dahdi cards for analog lines
load =>
; Call parking
load => 
; Below are the modules I needed when setting up call recording
; требуется если используется
load =>
; Required if is used, the function STRFTIME
load =>
; Required if is used to determine the number, function CALLERID
load =>
; Required if is used for MixMonitor
load =>
; For recording calls
load =>
; To support WAV format
load =>
; For MP3 format support
load =>
; To record statistics of calls to MySQL database
load =>
; To enable SNMP functionality, for example, to collect statistics by various monitoring systems
load =>
; To make calls from the context of the placed files to the directory /var/spool/asterisk/outgoing/
load =>

To apply the changes in the /etc/asterisk/modules.conf file, execute the command from the Asterisk console:

module reload

If necessary, you can reboot Asterisk as follows:

sudo service asterisk restart

How to remove iRedMail

Here is an example of removing iRedMail.
On the test, delete the installed iRedMail 0.9.7 with Ubuntu Server 16.04 using the uninstall script – clear_iredmail.

Let’s go to the tools directory of the iRedMail installer, save the script in it, in my case it’s:

cd /root/iRedMail-0.9.7/tools/

Let’s make it executable:

chmod +x

And run:


The script will remove mysql, ssl, amavisd, clamav, spamassassin, dovecot, postfix, iredapd, users, etc., you need to be careful if there is something else on the server besides iRedMail.
In the script code, you can see the step-by-step process of removing iRedMail.