Configuring the ircd-hybrid

Suppose we installed ircd-hybrid as I described in this article – Installing the IRC server – ircd-hybrid
Now proceed to setup.

Let’s edit the text of the welcome message:

sudo nano /etc/ircd-hybrid/ircd.motd

Make a copy of the configuration file just in case:

sudo cp /etc/ircd-hybrid/ircd.conf /etc/ircd-hybrid/ircd_original.conf

Open the main configuration file in the text editor, configure the parameters and comment out the unnecessary ones:

sudo nano /etc/ircd-hybrid/ircd.conf

In the configuration file, the standard serverinfo parameters are first followed, if desired, we change them:

serverinfo {
        name = "hybrid8.debian.local";
        description = "test";
        network_name = "debian";
        network_desc = "This is My Network";
        hub = no;
        default_max_clients = 512;
        max_nick_length = 15;
        max_topic_length = 300;

Further, contact the server administrator, if desired, change them:

admin {
        name = "SYSADMIN";
        description = "Main Server Administrator";
        email = "<>";

Network parameters (on which ports the ircd-hybrid will work, for example, you can change to 6667):

listen {
        port = 6665 .. 6669;

The first auth block that allows you to connect everything from the local address

auth {
        user = "*@";
        spoof = "";
        class = "opers";
        flags = need_password, spoof_notice, exceed_limit, kline_exempt,
                xline_exempt, resv_exempt, no_tilde, can_flood;

Another auth block allows you to connect to all (comment or change to your own needs):

auth {
        user = "*@*";
        class = "users";
        flags = need_ident;

For example, create a password for the user, copy the result of the command in an encrypted form:

mkpasswd PASSWORD

We add the possibility of authorization to any users only with a password and from the specified network:

auth {
        user = "*@";
        class = "users";
        flags = need_password;
encrypted = yes;
password = "PASSWORD_FROM_mkpasswd";

In the auth block the password will be stored in encrypted form, in the IRC client it is specified as it is.
To specify the password in the auth block in the unencrypted form, you need to remove encrypted.

In the general section, disable the need_ident:

general {
disable_auth = yes;

Restart ircd-hybrid to apply the changes:

sudo /etc/init.d/ircd-hybrid restart
sudo service ircd-hybrid restart

We can also add an operator:

auth {
name = "admin";
user = "admin@";
class = "opers";
flags = need_password, spoof_notice, exceed_limit, kline_exempt;
encrypted = yes;
password = "PASSWORD_FROM_mkpasswd";

You can block IP addresses as necessary in the following ways:

deny {
       ip = "";
       reason = "Spam";

After the changes in the configuration file, you need to restart the ircd-hybrid.
As a customer you can use for example free AdiIRC.

Installing the IRC server – ircd-hybrid

Here is an example of installing an IRC server – ircd-hybrid.

To install ircd-hybrid in Ubuntu, run the following command:

sudo apt-get install ircd-hybrid

After installation, ircd-hybrid will use TCP ports 6665-6669.

If desired, to connect to the IRC from the terminal, you can set for example the IRC client epic4:

sudo apt-get install epic4

And connect:


You can connect to the channel with the command:


Go out:


Check whether the ircd-hybrid is running, for example:

netstat -a | grep irc
netstat -an | grep 6667

Restart ircd-hybrid as follows:

sudo /etc/init.d/ircd-hybrid restart

If iptables is used, before you need to write a rule:

sudo iptables -A INPUT -p tcp -m tcp -s --dport 6667 -j ACCEPT

This completes the installation and you can proceed with the configuration.
See my article about setting up – Configuring the ircd-hybrid

I’ll also give an example of installing ircd-hybrid from the sources.
Download ircd-hybrid from the official site:

tar -xvf ircd-hybrid-8.2.22.tgz
cd ircd-hybrid-8.2.22

Install the necessary components:

sudo apt-get install build-essential unzip cmake

Configure and install ircd-hybrid:

./configure --prefix="/home/USER/ircd"
make install

You can also install Anope (to extend the functionality):

cd /tmp/
cd anope-2.0
cd build
make install

Let’s install the right owner:

sudo chown -R USER: ~/services ~/ircd

How to install and enable mcrypt

To install mcrypt in Ubuntu/Debian, run the following command:

sudo apt-get install php-mcrypt

In CentOS like this:

sudo yum install php-mcrypt

After that, the mcrypt.ini file will appear in the PHP directory with the extension, in my case it appeared /etc/php/7.0/mods-available/mcrypt.ini.

You can activate/deactivate the module like this:

sudo phpenmod mcrypt
sudo phpdismod mcrypt

Restart Apache2 to apply the changes:

sudo service apache2 restart

Let’s see if mcrypt is activated:

php -i | grep -i mcrypt

How to install and turn on soap

To install soap in Ubuntu/Debian, run the command:

sudo apt-get install php-soap

In CentOS like this:

sudo yum install php-soap

Look for the name of the package, if that’s possible:

apt-cache search php | grep -i soap
yum search php | grep -i soap

You can activate/deactivate the module like this:

sudo phpenmod soap
sudo phpdismod soap

Restart Apache2 to apply the changes:

sudo service apache2 restart

Let’s see if soap is activated:

php -i | grep -i soap

Setting up a backup space for

On the test went into, has opened Main functions – Servers, selected the server and in the tab Backup activated free 100GB, since for servers costing 39 € or more this place was allocated for free.
Activated WebDAV to test, samba was already activated, it is also possible to connect via FTP, FTPS, SFTP and SCP using a user name and password, via SFTP/SCP, you can also connect using the key.
The speed of data transfer to the backup server depends on the number of connected users and their traffic.
When connecting, use a domain name, for example, because the IP address can change.
Also, you can not create the /etc and /lib directories in place for backups.

For an example in Ubuntu Server, I will mount a backup location using SAMBA/CIFS.
Install the necessary utilities and create a directory in which we will mount:

sudo apt-get install cifs-utils
sudo mkdir /backup

Temporarily mount the place with the command:

sudo mount.cifs -o user=USER,pass=PASSWORD // /backup

To automatically mount after rebooting the system, add the following line to the / etc / fstab file:

// /backup   cifs  iocharset=utf8,rw,credentials=/etc/backup-credentials.txt,uid=SYSTEM_USER,gid=SYSTEM_GROUP,file_mode=0660,dir_mode=0770 0 0

To open a file it is possible for example with the text editor nano (CTRL+X for an output, y/n for saving or canceling changes):

sudo nano /etc/fstab

And add the following lines to the file /etc/backup-credentials.txt:


We will only set permissions for the file owner for security reasons:

sudo chmod 600 /etc/backup-credentials.txt

If you use the Windows operating system, you need to create a system user with the same login and password as the backup location.

Now I will connect to the test via WebDAV.
Install the necessary utilities and create a directory in which we will mount:

sudo apt-get install davfs2
sudo mkdir /backup

In CentOS:

yum install davfs2
mkdir /backup

Temporarily to mount through WebDAV a place it is possible a command:

sudo mount -t davfs /backup

To automatically mount after rebooting the system, add the following line to the /etc/fstab file: /backup davfs rw,uid=SYSTEM_USER,gid=SYSTEM_GROUP,file_mode=0660,dir_mode=0770 0 0

And in the file /etc/davfs2/secrets the following line: USER PASSWORD

That’s all, in my case, you can save backups to the /backup directory.

Redirecting requests to SSL

I will describe several options for redirecting requests from HTTP to HTTPS, the first and second methods are the most reliable:

1) Across virtual hosts.
In the site configuration, add the line “Redirect”, for example, when an SSL certificate was installed on the site and you need to redirect all requests to HTTPS:

NameVirtualHost *:80
<VirtualHost *:80>
   Redirect /

<VirtualHost *:443>
   DocumentRoot /var/www/html
   SSLEngine On

If you want to redirect only some requests:

NameVirtualHost *:80
<VirtualHost *:80>
   Redirect /forum

<VirtualHost *:443>
   DocumentRoot /var/www/html
   SSLEngine On

2) Redirecting using .htaccess.
Similarly, as in the first version, put the .htaccess file in the desired directory of the site and add a line to it (so that the web server takes into account the .htaccess file, you need to specify the option AllowOverride All in the site configuration above):

Redirect /forum

3) And not the recommended way, using mod_rewrite, the content should be added to the .htaccess file:

# Enabling the Rewrite function
RewriteEngine On
# Verify that the connection is not HTTPS
RewriteCond %{HTTPS} !=on
# We are sending to the same place, but already HTTPS:
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

Another example:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^ixnfo\.com$ [OR]
RewriteCond %{SERVER_NAME} ^www\.ixnfo\.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"

To allow some pages to open via http and https, add the following in the top example:

RewriteCond %{REQUEST_URI} !^/dir/
RewriteCond %{REQUEST_URI} !^/dir/file.php

See also:
Using .htaccess
How to configure SSL and HTTPS for WordPress
Installing Certbot in Ubuntu

Updating phpBB 3.0.x to phpBB 3.1.x

Updated recently phpBB 3.0.12 to 3.1.8, auto update here does not help, so I will describe the procedure for updating the items:

1) Be sure to make a backup copy of the files and the database of the forum. We will make the standard topic prosilver, disable the rest of the styles and modules, as they will not work on the new version of phpBB.

2) Download the archive with the new version of phpBB from the official site “”.

3) On the server, delete all the files and folders of the forum except the file config.php and directories images, files, store.

4) Unpack the downloaded archive, delete the file config.php and directories images, files, store. Move the rest of the files to the server.

5) In the browser, open the forum address by specifying a database update script, for example http://FORUM/install/database_update.php and following the instructions, perform the update.
At this point, I had an error:

PHP Fatal error:  Uncaught exception 'Twig_Error_Loader' with message 'Unable to find template "login_body.html" ...

I suspect that the information in the database in the phpbb_migrations table did not allow the script to fully update. So I solved the problem by restoring the old forum base by clearing this phpbb_migrations table via phpMyAdmin or by sql query:

TRUNCATE TABLE phpbb_migrations

And again running the database update script http://FORUM/install/database_update.php, which this time performed the update correctly.

At the end of the update, remove the install directory and clear the cache via the administration panel of the forum. Done.

See also:
Solution of error “A module already exists” and “The installer detected a timeout” when updating phpBB

Installing and configuring ownCloud

ownCloud – Web application for synchronization, sharing and remote storage of data in the “cloud”.

Perform the installation of ownCloud for example in Ubuntu:

sudo apt-get install owncloud

I noticed that in Ubuntu, at the time of installation I tested on Ubuntu 14.04.03 LTS, canceled the installation of ownCloud from the repository, so you can add a third party and install or update from it. We look at the sources

On Ubuntu 14.04, for example, installation from a third-party repository is performed by the following commands:

sudo sh -c "echo 'deb /' >> /etc/apt/sources.list.d/owncloud.list"
sudo apt-get update
sudo apt-get install owncloud

The next step is to open the web interface http://server/owncloud in the browser and create the login and password for the administrator account, as well as specify the type of database to store the settings, accounts and other information owncloud.
For better performance, it’s better to use the mysql database, for this we will install the MySQL server and create it:

sudo apt-get install mysql-server
mysql -u root -p
create database owncloud;
grant all privileges on owncloud.* to owncloud@localhost  identified by 'ПАРОЛЬ';

To be able to upload large files into owncloud, you will need to edit /etc/php5/apache2/php.ini by changing the upload_max_filesize and post_max_size in it, for example to 2048mb.

See also:
Install Nextcloud in Ubuntu