Установка MariaDB 10.4 на FreeBSD 12

How do I install MariaDB 10.3 on FreeBSD 12?, How to Install MariaDB 10.3 Database Server on FreeBSD 12?.  MariaDB 10.3 is a multi-user, multi-threaded SQL database server. It is a community-developed fork of the MySQL relational database management system.

MariaDB 10.3 Features:

  • InnoDB is used as the default storage engine instead of XtraDB.
  • System-versioned tables
  • FOR loops
  • MariaDB Galera Cluster, a synchronous multi-master cluster, is now a standard part of MariaDB.
  • Sequences
  • Instant ADD COLUMN for InnoDB
  • Invisible columns
  • Parallel replication
  • Multi-source replication
  • Common table expressions
  • Storage-engine independent column compression

In my last article, I covered:

How to Install PHP 7.2 on FreeBSD 12

Below are the steps to install and configure MariaDB 10.3 on FreeBSD 12.

Step 1: Update ports tree

Start by updating your FreeBSD server Ports tree using the portsnap command:

$ jmutai@freebsd:~ % su -
 Password:
 root@freebsd:~# portsnap fetch update
 Looking up portsnap.FreeBSD.org mirrors… 5 mirrors found.
 Fetching public key from ec2-ap-southeast-2.portsnap.freebsd.org… done.
 Fetching snapshot tag from ec2-ap-southeast-2.portsnap.freebsd.org… done.
 Fetching snapshot metadata… done.
 Fetching snapshot generated at Sun Dec  9 00:19:28 UTC 2018:
 Extracting snapshot… done.
 Verifying snapshot integrity… done.
 Fetching snapshot tag from ec2-ap-southeast-2.portsnap.freebsd.org… done.
 Fetching snapshot metadata… done.
 Updating from Sun Dec  9 00:19:28 UTC 2018 to Sun Dec  9 19:15:19 UTC 2018.
 Fetching 5 metadata patches… done.
 Applying metadata patches… done.
 Fetching 0 metadata files… done.
 Fetching 78 patches. 
 (78/78) 100.00%  done.                                   
 done.
 Applying patches… 
 done.
 Fetching 3 new ports or files… done.
 /usr/ports was not created by portsnap.
 You must run 'portsnap extract' before running 'portsnap update'.

When running Portsnap for the first time, you need to extract the snapshot into /usr/ports:

sudo portsnap extract

You should get the message below at the end of the output.

Building new INDEX files... done.

Confirm that everything is up to date.

sudo portsnap fetch update

Step 2: Install MariaDB 10.3 Database Server

MariaDB 10.3 can be installed using binary or ports method. This installation is from the binary package using the pkgpackage manager.

Check if MariaDB 10.3 is available from your package cache:

$ pkg search mariadb | grep 10.3
mariadb103-client-10.3.11      Multithreaded SQL database (client)
mariadb103-server-10.3.11      Multithreaded SQL database (server)

From the output, we can see there is version 10.3.11 available. Install  both the server and client using the command below:

$ sudo pkg install mariadb103-server mariadb103-client
 Updating FreeBSD repository catalogue…
 FreeBSD repository is up to date.
 All repositories are up to date.
 The following 6 package(s) will be affected (of 0 checked):
 New packages to be INSTALLED:
     mariadb103-server: 10.3.11
     mariadb103-client: 10.3.11
     libedit: 3.1.20170329_2,1
     unixODBC: 2.3.7
     galera: 25.3.24
     boost-libs: 1.68.0_1
 Number of packages to be installed: 6
 The process will require 406 MiB more space.
 44 MiB to be downloaded.
 Proceed with this action? [y/N]: y
 [1/6] Fetching mariadb103-server-10.3.11.txz: 100%   29 MiB 159.5kB/s    03:11    
 [2/6] Fetching mariadb103-client-10.3.11.txz: 100%    2 MiB 101.4kB/s    00:17    
 [3/6] Fetching libedit-3.1.20170329_2,1.txz: 100%  123 KiB 125.6kB/s    00:01    
 [4/6] Fetching unixODBC-2.3.7.txz: 100%  456 KiB  93.5kB/s    00:05    
 [5/6] Fetching galera-25.3.24.txz: 100%  802 KiB 117.3kB/s    00:07    
 [6/6] Fetching boost-libs-1.68.0_1.txz: 100%   12 MiB 134.6kB/s    01:32    
 Checking integrity… done (0 conflicting)
 [1/6] Installing libedit-3.1.20170329_2,1…
 [1/6] Extracting libedit-3.1.20170329_2,1: 100%
 [2/6] Installing boost-libs-1.68.0_1…
 [2/6] Extracting boost-libs-1.68.0_1: 100%
 [3/6] Installing mariadb103-client-10.3.11…
 [3/6] Extracting mariadb103-client-10.3.11: 100%
 [4/6] Installing unixODBC-2.3.7…
 [4/6] Extracting unixODBC-2.3.7: 100%
 [5/6] Installing galera-25.3.24…
 [5/6] Extracting galera-25.3.24: 100%
 [6/6] Installing mariadb103-server-10.3.11…
 ===> Creating groups.
 Creating group 'mysql' with gid '88'.
 ===> Creating users
 Creating user 'mysql' with uid '88'.
 [6/6] Extracting mariadb103-server-10.3.11: 100%
 Message from boost-libs-1.68.0_1:
 You have built the Boost library with thread support.
 Don't forget to add -pthread to your linker options when
 linking your code.
 Message from mariadb103-client-10.3.11:

Step 3: Start and Enable mysql-server service

After installing MariaDB Database server on FreeBSD 12 server, you’ll need to start the service before you can configure it.

Run the following command in your terminal to enable  themysql-server service to start on system boot.

$ sudo sysrc mysql_enable="YES"
mysql_enable:  -> YES

Then start the service.

sudo service mysql-server start

Step 4: Harden MariaDB server installation

Run the command mysql_secure_installation to harden MariaDB database server.

$ mysql_secure_installation
 NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
       SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 In order to log into MariaDB to secure it, we'll need the current
 password for the root user.  If you've just installed MariaDB, and
 you haven't set the root password yet, the password will be blank,
 so you should just press enter here.
 Enter current password for root (enter for none): 
 OK, successfully used password, moving on…
 Setting the root password ensures that nobody can log into the MariaDB
 root user without the proper authorisation.
 Set root password? [Y/n] y
 New password: 
 Re-enter new password: 
 Password updated successfully!
 Reloading privilege tables..
  … Success!
 By default, a MariaDB installation has an anonymous user, allowing anyone
 to log into MariaDB without having to have a user account created for
 them.  This is intended only for testing, and to make the installation
 go a bit smoother.  You should remove them before moving into a
 production environment.
 Remove anonymous users? [Y/n] Y
  … Success!
 Normally, root should only be allowed to connect from 'localhost'.  This
 ensures that someone cannot guess at the root password from the network.
 Disallow root login remotely? [Y/n] Y
  … Success!
 By default, MariaDB comes with a database named 'test' that anyone can
 access.  This is also intended only for testing, and should be removed
 before moving into a production environment.
 Remove test database and access to it? [Y/n] Y
 Dropping test database…
 … Success!
 Removing privileges on test database…
 … Success! 
 Reloading the privilege tables will ensure that all changes made so far
 will take effect immediately.
 Reload privilege tables now? [Y/n] Y
  … Success!
 Cleaning up…
 All done!  If you've completed all of the above steps, your MariaDB
 installation should now be secure.
 Thanks for using MariaDB!

Ensure you:

  • Set Database root user password
  • Remove anonymous users
  • Disallow root user remote logins
  • Remove test database and access to it

When done, test access using the root user

$ mysql -u root -p
 Enter password: <Enter password>
 Welcome to the MariaDB monitor.  Commands end with ; or \g.
 Your MariaDB connection id is 17
 Server version: 10.3.11-MariaDB FreeBSD Ports
 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 MariaDB [(none)]> SELECT VERSION();
 +-----------------+
 | VERSION()       |
 +-----------------+
 | 10.3.11-MariaDB |
 +-----------------+
 1 row in set (0.001 sec)
 MariaDB [(none)]> QUIT
 Bye

Step 5: Bind MariaDB Server service to localhost

By default, MariaDB service binds to all available network interfaces as can be seen from:

$ sockstat -4 -6 | grep 3306
mysql mysqld 1350 21 tcp46 *:3306 *:*

If you don’t have services connecting to your database server from the network, you can limit this to localhost.

# sysrc mysql_args="--bind-address=127.0.0.1"
mysql_args: -> --bind-address=127.0.0.1

You need to restart mysql-server after making this change

# service mysql-server restart
Stopping mysql.
Waiting for PIDS: 1350, 1350.
Starting mysql.

Verify the change:

# sockstat -4 -6 | grep mysql
mysql mysqld 1614 21 tcp4 127.0.0.1:3306 *:*

Your installation of MariaDB 10.3 on FreeBSD 12 has been successful. We went ahead and enabled the service to start on boot and hardened the server. Until next time, thanks for visiting our website. Follow us on our social media pages for instant updates.

Источник: https://computingforgeeks.com/how-to-install-mariadb-10-3-on-freebsd-12/

WinSCP sync ftp или Zback

I Вариант

Для синхронизации локальной папки с FTP сервером можно использовать связку WinSCP + bat

Script file

Assemble the commands into a script file. You can name the script file as you like. See simple example and some useful scripts.

Use the /script command line option to pass the script to the WinSCP executable. Generally, you should also use /ini=nul switch to isolate the script execution from GUI configuration. You can embed the complete command line into a Windows batch file (.bat или .cmd), like as follows:

@echo off
winscp.com /ini=nul /script=myscript.txt

myscript.txt содержание:

option batch abort
option confirm off
open ftp://nameuser:password@ftp.my.ru
synchronize remote -criteria=time C:\Бухгалтерия /C:/ftp/Бухгалтерия
Для запуска cmd в скрытом режиме, использую vbs скрипт:
Option Explicit
dim path, WshShell

' задаем путь к рабочей папке
path = "c:\setup\ftp\" 

' Создаем ссылку на объект WscriptShell
set WshShell = WScript.CreateObject("Wscript.Shell") 

' Открываем консоль и запускаем наш cmd(Wshshell Run)
WshShell.Run "cmd.exe /c c:\setup\ftp\winscpsync.cmd", 2,true

, здесь — WshShell.Run «cmd.exe /c c:\setup\ftp\winscpsync.cmd», 0,true — скрыто
WshShell.Run «cmd.exe /c c:\setup\ftp\winscpsync.cmd», 2,true — свернутый запуск консоли

 

sync.vbs запускаю в планировщике

II Вариант (глючный)

ZBack + bat

C:\Zback\zback.exe c:\setup\ftp\buh.bal /R

buh.bal содержание:

# - новый -
#'Синхронизация 
C:\Бухгалтерия\*.* > V:\Бухгалтерия /Us

Fedora 30. Настройка сети, отключение ipv6

1. Устанавливаем статический  IP адрес на сервер. ( Замените [ens2] на свое наименование сетевого интерфейса )

# set hostname

[root@localhost ~]#

hostnamectl set-hostname dlp.srv.world
# display devices

[root@localhost ~]#

nmcli device
DEVICE  TYPE      STATE      CONNECTION
ens2    ethernet  connected  ens2
lo      loopback  unmanaged  --

# set IPv4 address

[root@localhost ~]#

nmcli connection modify ens2 ipv4.addresses 10.0.0.30/24
# set gateway

[root@localhost ~]#

nmcli connection modify ens2 ipv4.gateway 10.0.0.1
# set DNS

[root@localhost ~]#

nmcli connection modify ens2 ipv4.dns 10.0.0.1
# set manual for static setting (it’s [auto] for DHCP)

[root@localhost ~]#

nmcli connection modify ens2 ipv4.method manual
# restart the interface and reload the settings

[root@localhost ~]#

nmcli connection down ens2; nmcli connection up ens2
Connection 'ens2' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)

# show settings

[root@localhost ~]#

nmcli device show ens2
GENERAL.DEVICE:                         ens2
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         52:54:00:C8:09:F8
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     ens2
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveC
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         10.0.0.30/24
IP4.GATEWAY:                            10.0.0.1
IP4.ROUTE[1]:                           dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 1
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 10.0.0.1, mt = 100
IP4.DNS[1]:                             10.0.0.1
IP6.ADDRESS[1]:                         fe80::5054:ff:fec8:9f8/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, tabl

# show state

[root@localhost ~]#

ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:c8:09:f8 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.30/24 brd 10.0.0.255 scope global noprefixroute ens2
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fec8:9f8/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

2. Отключить IPv6, если не нужен, можно так:

[root@localhost ~]#

vi /etc/default/grub
# line 7: add

GRUB_CMDLINE_LINUX=»

ipv6.disable=1

resume=/dev/mapper/fedora-swap…..

# apply changes

[root@localhost ~]#

grub2-mkconfig -o /boot/grub2/grub.cfg

[root@localhost ~]#

DNS Redirection on MikroTik for your office domain

Для того, чтобы из офиса одного разрешались имена внутренней сети домена в другом офисе, помогла следующая подсказка. На микротике настраивалось. Офис соединен по L2TP с серверной, и теперь видит внутренние имена серверов.

Mikrotik site-to-site L2TP + Split DNS

So I got sick and tired of adding hostnames for each and every internal server’s IP address at my home…

I finally came up with a few MikroTik firewall rules that would allow you to resolve and reverse DNS lookup internal names from your office’s DNS server, while performing ALL other DNS queries from your default (ISP) DNS servers.

For example, my setup looks as follow:

  • My office is using the *.mydomain.co.za domain name for all our servers
  • Most of our servers share public IP addresses, but each one of them have unique internal IP addresses (192.168.*.*). I need access to the internal IP addresses, because SSH is only enabled from inside
  • The DNS server is hosted on 192.168.0.1

My primary DNS server on my home MikroTik is Google’s DNS server: 8.8.8.8

For instance if I’ll try and lookup www.kalahari.net, then my MikroTik will query it from 8.8.8.8
Whenever I try to lookup anything.mydomain.co.za, then the Layer-7 regular expression matches and then the DNS query is forwarded to my office’s DNS server, which will respond with like 192.168.0.2 IP address. Without the rule, I would’ve gotten something like 41.168.1.123 and then not be able to get SSH access to anything.mydomain.co.za.
The regular expression would also match the reverse DNS lookups (192.168.*.* — please take note that the IP range is in reverse in the regular expression), like when I would lookup 192.168.0.3, it would also forward the DNS lookup to my office’s DNS server and reply with like myhost.mydomain.co.za, instead of ‘Non-existent domain’ that 8.8.8.8 would give me.

Code:
/ip firewall layer7-protocol
add name="MyDomain DNS" regexp=\
    "mydomain.co.za|[0-9]+.[0-9]+.168.192.in-addr.arpa"

/ip firewall nat
add action=masquerade chain=srcnat comment="NAT to MyDomain DNS" disabled=no dst-address=192.168.0.1/32 dst-port=53 \
    protocol=udp
add action=dst-nat chain=dstnat disabled=no dst-address-type=local dst-port=53 layer7-protocol="MyDomain DNS port forward" \
    protocol=udp to-addresses=192.168.0.1 to-ports=53

If you’re using those rules, please remember to change:

  1. the mydomain.co.za, with your own office’s internal hostnames/domain.
  2. the 192.168.0.1 IP address with your DNS server address of your office
  3. [0-9]+.[0-9]+.168.192 part of the regular expression with the reverse of your office’s internal IP range. Like [0-9]+.[0-9]+.168.192 is the reverse of 192.168.[0-9]+.[0-9] aka 192.168.*.*

I hope this is useful to some of you guys out there who are using VPN connections to your office :D

Off-Topic:
We have Neotel Neobroadband 5Mbps Fiber at our office, but we had endless issues with it, where a reset of the Cisco router fixed it. Luckily the colleague of mine had a network diagram (with the VLAN tags), so we simply removed our Cisco router (that Neotel gave us) and plugged it in directly on our MikroTik RB1100 and now our Internet is pumping again.

 

Источник
преИсточник

Транляция с телефона

Для того чтобы в винде появилась видеокамера, которая будет забирать поток с телефона и передавать в ПО(teamviwer, skype), использую IP Cam adapter в качестве виртуальной вебкамеры.

Чтобы из телефона сделать IP камеру и создать видеотрансляцию, ставим на него IP Webcam:

На комп ставим адаптер(домашняя страница), который будет выполнять функцию видеокамеры. Путь к трансляции задать http://ip:port/video

Трансляция экрана на сайт

Задача: Вывод картинки видеорегистратора с аналоговыми камерами на сайт WordPress. Решение: Используем комп с windows XP. Изображение части экрана компа транслируем с помощю VLC плеера(v2). На сайте с помощью плеера принимаем трансляцию. Также используем прокси апача, для доступа во внутреннюю сеть.

Содержимое bat файла для автозапуска VLC трансляции:

@echo off
cd c:\
cd Program Files\VideoLAN\VLC\
start vlc.exe screen:// :screen-left=0 :screen-top=0 :screen-height=263 :screen-width=576 :screen-fps=1.000000 :live-caching=300 :sout=#transcode{vcodec=FLV1,vb=20}:std{access=http{mime=video/x-flv},dst=:8081/stream.flv,mux=ffmpeg{mux=flv}}
exit

Вариант 2 (для телефонов, без Адоб Флеш)

@echo off
cd c:\
cd Program Files\VideoLAN\VLC\
start /min vlc.exe screen:// :screen-left=78 :screen-top=23 :screen-height=680 :screen-width=820 :screen-fps=1.000000:live-caching=300 :sout=#transcode{vcodec=WMV2,vb=800,acodec=wma2,ab=128,channels=2,samplerate=44100,scodec=none}:http{dst=:8081/stream.asf} :no-sout-all :sout-keep
exit

Добавить задачу в nncron.tab. Каждый день в 9:01, если еще не запущен VLC, то запустить батник и через 60сек свернуть окно VLC.

#( vlcstream
Time: 1 9 * * * *
Rule: PROC-EXIST: «vlc.exe» NOT
Action:


StartIn: «C:\setup»
ShowMinimized NormalPriority
START-APP: C:\setup\vlcscr.bat
PAUSE: 60000
WIN-HIDE: «screen:// — Медиа-проигрыватель VLC»
)#

Ставим WordPress плагин KVS Player. Настраиваем в нем размер картинки и время буфера. Используя шорт код [flv:http://домен.тут/stream.flv]добавляем на страницу в нужном месте.

В конфигурации апача(httpd-vhosts.conf) добавить:

мVirtualHost *:80б
ServerName домен.тут
ProxyPreserveHost On
ProxyPass / http://10.10.10.10:8081/
ProxyPassReverse / http://10.10.10.10:8081/
м/VirtualHostб

Возможные ошибки:

VLC не может открыть MRL ‘screen://’

причина: превышен размер экрана в параметрах screen-height или screen-width батника

Источник: https://vacadem.ru/blog/test-lab/vlc-video-lan-desktop.html

https://vacadem.ru/blog/test-lab/broadcast-your-desktop-using-vlc-and-directshow.html

Excel Online. Настройка общего доступа к excel-таблицам

Всем привет!

На работе поставили задачу организовать общий доступ к таблицам Excel для одновременного редактирования несколькими сотрудниками предприятия, возможность оперативно посмотреть информацию если это потребуется, а так же внести поправки и другую важную информацию.К слову не все сотрудники сидят в одном здании, а на разных объектах и площадках, которым необходимо видеть информацию занесенную коллегами. В связи с этим было рассмотрено несколько вариантов для реализации доступа:

Microsoft Excel

Непосредственно штатным Excel который установлен у всех,но есть некоторые нюансы:

— Файл должен находится в одной сети (у нас все пользователи раскиданы по разным объектам)

— Некоторые задачи становятся недоступны (создавать таблицы Excel;создавать, менять или просматривать сценарии; удалять листы; объединять либо разделять ячейки.)

— Частая «блокировка» файла

— Не видно кто что делает, т.е. информация будет доступна только после сохранения файла. Один не приятный момент при работе с файлом — если вы записываете информацию в одну и ту же ячейку, при сохранении файла работает правило «кто последний тот и папа»)))))

Реализация делается следующим образом, заходим в «Рецензирование» и щелкаем по значку «Доступ к книге».

После этих действий файл станет общим и даёт пользователям одновременное редактирование. В названии файла появится приписка [Общий]

При нажатии кнопки «Доступ к книге» может возникать ошибка:

Достаточно сделать по шагам что написано в диалоговом окне ошибки и она пропадёт!

И так что же мы увидим когда нажмем кнопку «Доступ к книге»?!

А увидим список пользователей которые работают в данный момент и не забудем так же поставить галочку «Разрешить изменять файл нескольким пользователям одновременно»

:)

Excel настроен для работы с общими документами

Источник: https://www.nibbl.ru/office/excel-online-nastrojka-obshhego-dostupa-k-excel-tablicam.html

Для организации площадки общего доступа предлагаю воспользоваться ftpDrive(для XP) или NetDrive.

Проксирование запросов Apache во внутренюю сеть

Часть 1. Настройка домашнего хостинга на FreeBSD

Для трансляции изображения с камеры из внутренней сети на сайт потребуется прокси модуль апача. Само вещание ведёт ContaCam 7.0(для Windows XP). Понравилось, что сразу и онлайн-вещание и возможность посмотреть записи обнаруженных движений. Вставил трансляцию на страницу с помощью фрейма: <iframe allowtransparency=»true» scrolling=»no» style=»border:1px solid #ededed» src=»http://webcam.site:8800″ frameborder=»0″ height=»750″ width=»750″>

Чтобы маршрут до DVR сервера апач выбрал через внутреннюю сеть, включаем mod_proxy. Это модуль Apache для перенаправления соединений (то есть, шлюз, пропускающий их). Он доступен для использования так же, как любой другой стандартный модуль или базовая конфигурация. В целом, mod_proxy – это не один модуль, а набор модулей, каждый из которых обладает особенными функциональными возможностями.

Некоторые из этих модулей:

  • mod_proxy: основной прокси-модуль Apache, который управляет соединениями и перенаправляет их.
  • mod_proxy_http: функции прокси-сервера для протоколов HTTP и HTTPS.
  • mod_proxy_ftp: функции прокси-сервера для протокола FTP.
  • mod_proxy_connect: тунеллирование SSL.
  • mod_proxy_ajp: взаимодействие с протоколом AJP.
  • mod_proxy_wstunnel: работа с веб-сокетами (например, WS и WSS).
  • mod_proxy_balancer: кластеризация и балансировка нагрузки.
  • mod_cache: кэширование.
  • mod_headers: управление заголовками HTTP.
  • mod_deflate: сжатие.

Примечание: чтобы получить дополнительную информацию о mod_proxy и Apache, читайте официальную документацию Apache.

Активация модулей

В httpd.conf раскомментировать нужные proxy модули Возможно апач попросит раскомментировать дополнительно модуль xml2enc

Также можно выполнить следующие команды, чтобы активировать модули по одному:

a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_html

В файле конфигурации виртуальных хостов вставить блок кода:

<VirtualHost *:*>
ProxyPreserveHost On
# Servers to proxy the connection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
# Example:
ProxyPass / http://0.0.0.0:8080/
ProxyPassReverse / http://0.0.0.0:8080/
ServerName localhost
</VirtualHost>

Активация балансировки нагрузки

При наличии нескольких внутренних серверов можно использовании функцию балансировки нагрузки Apache, чтобы распределить соединения при проксировании.

Отредактируйте настройки виртуального хоста (как в предыдущем разделе), используя следующие конфигурации:

<Proxy balancer://mycluster>
# Define back-end servers:
# Server 1
BalancerMember http://0.0.0.0:8080/
# Server 2
BalancerMember http://0.0.0.0:8081/
</Proxy>
<VirtualHost *:*>
# Apply VH settings as desired
# However, configure ProxyPass argument to
# use "mycluster" to balance the load
ProxyPass / balancer://mycluster
</VirtualHost>

Активация SSL для поддержки обратного прокси

При использовании сертификатов и соединений SSL нужно также активировать промежуточный виртуальный хост. Для этого используйте нижеприведенный блок кода.

Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine On
# Set the path to SSL certificate
# Usage: SSLCertificateFile /path/to/cert.pem
SSLCertificateFile /etc/apache2/ssl/file.pem
# Servers to proxy the connection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
# Example:
ProxyPass / http://0.0.0.0:8080/
ProxyPassReverse / http://0.0.0.0:8080/
# Or, balance the load:
# ProxyPass / balancer://balancer_cluster_name
</VirtualHost>

Перезапустить службу апача.

Теперь Apache будет проксировать соединения на внутренние серверы приложений.

Источник: https://www.8host.com/blog/ustanovka-http-servera-apache-kak-obratnogo-proksi-s-pomoshhyu-mod_proxy/

Как осуществить простейшую веб-трансляцию (видеорегистратор + VLC media player + WordPress + VideoEmbed)

Задача такова: с минимальными усилиями вставить живое видео с домашнего компа(видеорегистратора) или IP камеры  из внутренней(OpenVPN) сети на сайт под управлением WordPress. Пример моей трансляции тут. Читать далее «Как осуществить простейшую веб-трансляцию (видеорегистратор + VLC media player + WordPress + VideoEmbed)»

Проверка нескольких дисков chkdsk

Задача: на машине стоят 3 диска(c, d, e). Нужно добавить в расписание проверку сразу нескольких дисков на ошибки с помощью команды chkdsk с поиском поврежденных секторов и восстановлением, и выводом на экран списка файлов.

Решение: создать CMD или BAT и добавить в расписание. Содержимое:

echo Y|chkdsk c: /F /R /V && echo Y|chkdsk d: /F /R /V && echo Y|chkdsk e: /F /R /V

Читать далее «Проверка нескольких дисков chkdsk»