• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

gateways/H03-May-2022-789596

plugins/H05-Oct-2020-810712

scripts/H05-Oct-2020-2,0771,976

wwwroot/H05-Oct-2020-57,28850,945

.editorconfigH A D05-Oct-2020603 3123

COPYINGH A D05-Oct-20205.6 KiB12793

ChangeLogH A D05-Oct-202060.4 KiB1,1421,140

LICENSEH A D05-Oct-202017.6 KiB340281

MakefileH A D05-Oct-20201.6 KiB4331

READMEH A D05-Oct-202019.5 KiB394318

README.FedoraH A D05-Oct-20202.6 KiB6144

README.mdH A D05-Oct-202019.5 KiB394318

README

1# Welcome!
2Thank you for selecting RackTables as your datacenter management solution!
3If you are looking for documentation or wish to send feedback, please
4look for the respective links at [project's web-site](https://racktables.org).
5
6# How to install RackTables
7
8## 1. Prepare the server
9
10RackTables uses a web-server with PHP (5.5.0 or newer) for front-end and a
11MySQL/MariaDB server version 5 for back-end. The most commonly used web-server
12for RackTables is Apache httpd.
13
14### 1.1. Install MySQL/MariaDB server
15
16| Distribution       | How to do                                                               |
17| ------------------ | ----------------------------------------------------------------------- |
18| Debian 6           | `aptitude install mysql-server-5.1`                                     |
19| Debian 7           | `aptitude install mysql-server-5.1`                                     |
20| Fedora 23-26       | `dnf install mariadb-server mariadb`                                    |
21| Fedora 32          | `dnf install mariadb-server`                                            |
22| FreeBSD 10         | `pkg install mysql56-server`                                            |
23| openSUSE 42.1      | `zypper install mysql-community-server`                                 |
24| Scientific Linux 6 | `yum install mysql-server mysql` |
25| Ubuntu 16.04       | `apt-get install mysql-server`                                          |
26| Ubuntu 18.04       | `apt-get install mysql-server`                                          |
27| Ubuntu 20.04       | `apt-get install mariadb-server`                                        |
28| RHEL 7             | `yum install -y mariadb-server mariadb`                                 |
29
30### 1.2. Enable Unicode in the MySQL/MariaDB server
31
32| Distribution       | How to do                                                                                                          |
33| ------------------ | ------------------------------------------------------------------------------------------------------------------ |
34| Debian 6           | add `character-set-server=utf8` line to `[mysqld]` section of `/etc/mysql/my.cnf` file and restart mysqld          |
35| Debian 7           | add `character-set-server=utf8` line to `[mysqld]` section of `/etc/mysql/my.cnf` file and restart mysqld          |
36| Fedora 23-32       | ```printf "[mysqld]\ncharacter-set-server=utf8\n" > /etc/my.cnf.d/mysqld-charset.cnf; systemctl restart mariadb``` |
37| openSUSE 42.1      | No action required, comes configured for UTF-8 by default.                                                         |
38| Scientific Linux 6 | add `character-set-server=utf8` line to `[mysqld]` section of `/etc/my.cnf` file and restart mysqld |
39| Ubuntu 16.04       | ```printf "[mysqld]\ncharacter-set-server=utf8\n" > /etc/mysql/conf.d/charset.cnf; service mysql restart```        |
40| Ubuntu 18.04       | ```printf "[mysqld]\ncharacter-set-server=utf8\n" > /etc/mysql/conf.d/charset.cnf; service mysql restart```        |
41| Ubuntu 20.04       | No action required, comes configured for UTF-8 by default.                                                         |
42| RHEL 7             | add `character-set-server=utf8` line to `[server]` section of `/etc/my.cnf.d/server.cnf` file and restart mysqld   |
43
44### 1.3. Install PHP and Apache httpd (or nginx)
45
46| Distribution       | How to do                                                                            |
47| ------------------ | ------------------------------------------------------------------------------------ |
48| Debian 6           | `aptitude install libapache2-mod-php5 php5-gd php5-mysql php5-snmp`                  |
49| Debian 7 (nginx)   | `aptitude install nginx php5-fpm` **(see note below)**                               |
50| Fedora 23          | `dnf install httpd php php-mysql php-pdo php-gd php-snmp php-mbstring php-bcmath`    |
51| Fedora 26-32       | `dnf install httpd php php-mysqlnd php-pdo php-gd php-snmp php-mbstring php-bcmath`  |
52| FreeBSD 10         | see note 1.3.c                                                                       |
53| openSUSE 42.1      | `zypper install apache2-mod_php5 php5-gd php5-mbstring php5-mysql php5-bcmath`       |
54| Scientific Linux 6 | `yum install httpd php php-mysql php-pdo php-gd php-mbstring php-bcmath` |
55| Ubuntu 16.04       | `apt-get install apache2-bin libapache2-mod-php7.0 php7.0-gd php7.0-mysql php7.0-mbstring php7.0-bcmath php7.0-json php7.0-snmp`
56| Ubuntu 18.04       | `apt-get install apache2-bin libapache2-mod-php7.2 php7.2-gd php7.2-mysql php7.2-mbstring php7.2-bcmath php7.2-json php7.2-snmp`
57| Ubuntu 20.04       | `apt-get install apache2-bin libapache2-mod-php7.4 php7.4-gd php7.4-mysql php7.4-mbstring php7.4-bcmath php7.4-json php7.4-snmp`
58| RHEL 7             | `subscription-manager repos --enable=rhel-server-rhscl-7-rpms`
59|                    | `yum install httpd24 rh-php70 rh-php70-php-mysqlnd rh-php70-php-pdo rh-php70-php-gd rh-php70-php-snmp rh-php70-php-mbstring rh-php70-php-bcmath rh-php70-php-ldap rh-php70-php`
60
61#### 1.3.a. Debian 7 with nginx
62Remember to adjust `server_name` in `server {}` section, otherwise your logout link
63will point to localhost (and thus fail).
64Notice that fpm.sock is advised, keep the rest on default configuration, or
65tweak to your needs. You may need to set `fastcgi_read_timeout 600;` if you use
66some external addons like fping, which may take some time in certain situations.
67Please note that setting aggresive caching for php scripts may result in stale
68content - so maximum of 60 seconds is advised, but by default it is not enabled.
69
70#### 1.3.b. [redacted]
71
72#### 1.3.c. FreeBSD 10
73There are 3 different ways how you can install RackTables and its dependencies on FreeBSD.
74
75###### A. use pkg (Binary Package Management) (not always the newest version)
76```
77# pkg install racktables
78# pkg install mod_php56 mysql56-server
79```
80As of March 2017 this will install RackTables Version 0.20.11 and its dependencies (php 5.6, mysql-server 5.6 and apache 2.4).
81
82###### B. use the ports system (possibly more recent than pkg)
83```
84# cd /usr/ports/sysutils/racktables
85# make install
86# pkg install mod_php56 mysql56-server
87```
88As of March 2017 this will install RackTables Version 0.20.11 and build and install its dependencies (php 5.6, mysql-server 5.6 and apache 2.4).
89
90###### C. manual (newest version)
91Install dependencies with pkg:
92```
93# pkg install php70-bcmath php70-curl php70-filter php70-gd php70-gmp php70-json php70-mbstring php70-openssl php70-pdo php70-pdo_mysql php70-session php70-simplexml php70-snmp php70-sockets
94# pkg install mod_php70 mysql56-server
95```
96
97unpack tar.gz/zip archive to `/usr/local/www`
98
99symlink racktables dir
100```
101# cd /usr/local/www
102# ln -s RackTables-0.20.xx racktables
103```
104
105##### Common install steps
106Apache users should create a racktables.conf file under their apache
107Includes directory with the following contents:
108```
109AddType  application/x-httpd-php         .php
110AddType  application/x-httpd-php-source  .phps
111
112<Directory /usr/local/www/racktables/wwwroot>
113	DirectoryIndex index.php
114	Require all granted
115</Directory>
116Alias /racktables /usr/local/www/racktables/wwwroot
117```
118
119Start services:
120```
121# echo 'apache24_enable="YES"' >> /etc/rc.conf
122# service apache24 start
123# echo 'mysql_enable="YES"' >> /etc/rc.conf
124# service mysql-server start
125```
126
127Browse to http://address.to.your.server/racktables/index.php and follow the instructions.
128
129Note: set `secret.php` permissions when prompted.
130```
131# chown www:www /usr/local/www/racktables/wwwroot/inc/secret.php
132# chmod 400 /usr/local/www/racktables/wwwroot/inc/secret.php
133```
134
135#### 1.3.d. RHEL 7
136Apache configuration and webroot is under /opt/rh/httpd24/root/
137
138## 2. Copy the files
139Unpack the tar.gz/zip archive to a directory of your choice and configure Apache
140httpd to use `wwwroot` subdirectory as a new DocumentRoot. Alternatively,
141symlinks to `wwwroot` or even to `index.php` from an existing DocumentRoot are
142also possible and often advisable (see `README.Fedora`).
143
144## 3. Run the installer
145Open the configured RackTables URL and you will be prompted to configure
146and initialize the application.
147
148| Distribution    | Apache httpd UID:GID    | MySQL/MariaDB UNIX socket path   |
149| --------------- | ----------------------- | -------------------------------- |
150| Fedora 23-32    | `apache:apache`         | `/var/lib/mysql/mysql.sock`      |
151| openSUSE 42.1   | `wwwrun:www`            | `/var/run/mysql/mysql.sock`      |
152| Ubuntu 16.04    | `www-data:www-data`     | `/var/run/mysqld/mysqld.sock`    |
153| Ubuntu 18.04    | `www-data:www-data`     | `/var/run/mysqld/mysqld.sock`    |
154| Ubuntu 20.04    | `www-data:www-data`     | `/var/run/mysqld/mysqld.sock`    |
155
156# How to upgrade RackTables
157
1580. **Backup your database** and check the release notes below before actually
159   starting the upgrade.
1601. Remove all existing files except configuration (the `inc/secret.php` file)
161   and local plugins (in the `plugins/` directory).
1622. Put the contents of the new tar.gz/zip archive into the place.
1633. Open the RackTables page in a browser. The software will detect version
164   mismatch and display a message telling to log in as admin to finish
165   the upgrade.
1664. Do that and report any errors to the bug tracker or the mailing list.
167
168## Release notes
169
170### Upgrading to 0.21.2
171This version drops support for the `$localreports` global variable, which is
172trivial to replace in a local plugin if necessary.
173
174There has been a separation of the `addJS()` and `addCSS()` functions to easily
175identify the resource usage.  The original `addJS()` and `addCSS()` functions will
176most likely be removed in 0.22.0 as they are deprecated.
177
178- *`addJSText()`/`addCSSText()`*
179
180  These functions should be used to add inline JS/CSS
181  not defined in a separate file.
182
183- *`addJSInternal()`/`addCSSInternal()`*
184
185  These functions should be used to add an internal reference to a JS/CSS file
186  which is accessed using the `?module=chrome&uri=` for self hosted JS/CSS
187  files.  This can be utilised by both the core and plugins.
188
189- *`addJSExternal()`/`addCSSExternal()`*
190
191  These functions should be used to add an external reference to a JS/CSS file
192  which hosted on an external site or CDN. This can be utilised by both the core
193  and plugins.
194
195Each of these functions expect the first parameter to be the data or URI, and
196the second parameter to be an optional group.  By default, the group is set to
197'default' and groups are sorted alphabetically.  It should be noted that when
198the `addJSInternal()` function is used, it will also add the jQuery and RackTables
199common JavaScript functons.
200
201Due to this separation, you will no longer need to supply a TRUE or FALSE to
202identify whether the parameter value is text or a URI.  If you rename an
203existing `addJS()`/`addCSS()` function call, be sure to remove this parameter.
204Failure to do so will mean you are effectively be saying that the group name is
205'' (FALSE) or '1' (TRUE).
206
207### Upgrading to 0.21.0
208
209From now on the minimum (oldest) release of PHP that can run RackTables is
2105.5.0.
211
212This release introduces a new plugin architecture.  If you experience issues
213after the upgrade, try disabling plugins.
214Refer to http://wiki.racktables.org/index.php/Plugins
215for more information.
216
217### Upgrading to 0.20.11
218
219New `IPV4_TREE_SHOW_UNALLOCATED` configuration option introduced to disable
220dsplaying unallocated networks in IPv4 space tree. Setting it also disables
221the "knight" feature.
222
223### Upgrading to 0.20.7
224
225From now on the minimum (oldest) release of PHP that can run RackTables is
2265.2.10. In particular, to continue running RackTables on CentOS 5 it is
227necessary to replace its php* RPM packages with respective php53* packages
228before the upgrade (except the JSON package, which PHP 5.3 provides internally).
229
230Database triggers are used for some data consistency measures.  The database
231user account must have the 'TRIGGER' privilege, which was introduced in
232MySQL 5.1.7.
233
234The `IPV4OBJ_LISTSRC` configuration option is reset to an expression that enables
235the IP addressing feature for all object types except those listed.
236
237Tags could now be assigned on the Edit/Properties tab using a text input with
238auto-completion. Type a star '*' to view full tag tree in auto-complete menu.
239It is worth to add the following line to the permissions script if the
240old-fashioned 'Tags' tab is not needed any more:
241```
242  deny {$tab_tags} # this hides 'Tags' tab
243```
244
245This release converts collation of all DB fields to the `utf8_unicode_ci`. This
246procedure may take some time, and could fail if there are rows that differ only
247by letter case. If this happen, you'll see the failed SQL query in upgrade report
248with the "Duplicate entry" error message. Feel free to continue using your
249installation. If desired so, you could eliminate the case-duplicating rows
250and re-apply the failed query.
251
252### Upgrading to 0.20.6
253
254New `MGMT_PROTOS` configuration option replaces the `TELNET_OBJS_LISTSRC`,
255`SSH_OBJS_LISTSRC` and `RDP_OBJS_LISTSRC` options (converting existing settings as
256necessary). `MGMT_PROTOS` allows to specify any management protocol for a
257particular device list using a RackCode filter. The default value
258(`ssh: {$typeid_4}, telnet: {$typeid_8}`) produces `ssh://server.fqdn` for
259servers and `telnet://switch.fqdn` for network switches.
260
261### Upgrading to 0.20.5
262
263This release introduces the VS groups feature. VS groups is a new way to store
264and display virtual services configuration. There is a new "ipvs" (VS group)
265realm. All previously existing VS configuration remains functional and user
266is free to convert it to the new format, which displays it in a more natural way
267and allows to generate virtual_server_group keepalived configs. To convert a
268virtual service to the new format, it is necessary to manually create a VS group
269object and assign IP addresses to it. The VS group will display a "Migrate" tab
270to convert the old-style VS objects, which can be removed after a successful
271conversion.
272
273The old-style VS configuration becomes **deprecated**. Its support will be removed
274in a future major release. So it is strongly recommended to convert it to the
275new format.
276
277### Upgrading to 0.20.4
278
279Please note that some dictionary items of Cisco Catalyst 2960 series switches
280were renamed to meet official Cisco classification:
281
282old name    | new name
283------------|---------
2842960-48TT   | 2960-48TT-L
2852960-24TC   | 2960-24TC-L
2862960-24TT   | 2960-24TT-L
2872960-8TC    | 2960-8TC-L
2882960G-48TC  | 2960G-48TC-L
2892960G-24TC  | 2960G-24TC-L
2902960G-8TC   | 2960G-8TC-L
291C2960-24    | C2960-24-S
292C2960G-24PC | C2960-24PC-L
293
294The `DATETIME_FORMAT` configuration option used in setting date and time output
295format now uses a [different](http://php.net/manual/en/function.strftime.php)
296syntax. During upgrade the option is reset to
297the default value, which is now %Y-%m-%d (YYYY-MM-DD) per ISO 8601.
298
299This release intoduces two new configuration options:
300`REVERSED_RACKS_LISTSRC` and `NEAREST_RACKS_CHECKBOX`.
301
302### Upgrading to 0.20.1
303
304The 0.20.0 release includes a bug that breaks IP networks' capacity displaying on
30532-bit architecture machines. To fix this, this release makes use of PHP's BC
306Math module. It is a new reqiurement. Most PHP distributions have this module
307already enabled, but if yours does not - you need yo recompile PHP.
308
309Security context of 'ipaddress' page now includes tags from the network
310containing an IP address. This means that you should audit your permission rules
311to check there is no unintended allows of changing IPs based on network's
312tagset. Example:
313```
314	allow {client network} and {New York}
315```
316This rule now not only allows any operation on NY client networks, but also any
317operation with IP addresses included in those networks. To fix this, you should
318change the rule this way:
319```
320	allow {client network} and {New York} and not {$page_ipaddress}
321```
322
323### Upgrading to 0.20.0
324
325WARNING: This release have too many internal changes, some of them were waiting
326more than a year to be released. So this release is considered "BETA" and is
327recommended only to curiuos users, who agree to sacrifice the stability to the
328progress.
329
330Racks and Rows are now stored in the database as Objects. The RackObject table
331was renamed to Object. SQL views were created to ease the migration of custom
332reports and scripts.
333
334New plugins engine instead of `local.php` file. To make your own code stored in
335`local.php` work, you must move the `local.php` file into the `plugins/` directory.
336The name of this file does not matter any more. You also can store multiple
337files in that dir, separate your plugins by features, share them and try the
338plugins from other people just placing them into `plugins/` dir, no more merging.
339
340* `$path_to_local_php` variable has no special meaning any more.
341* `$racktables_confdir` variable is now used only to search for `secret.php` file.
342* `$racktables_plugins_dir` is a new overridable special variable pointing to `plugins/` directory.
343
344Beginning with this version it is possible to delete IP prefixes, VLANs, Virtual
345services and RS pools from within theirs properties tab. So please inspect your
346permissions rules to assure there are no undesired allows for deletion of these
347objects. To ensure this, you could try this code in the beginning of permissions
348script:
349```
350allow {userid_1} and {$op_del}
351deny {$op_del} and ({$tab_edit} or {$tab_properties})
352```
353
354Hardware gateways engine was rewritten in this version of RackTables. This means
355that the file `gateways/deviceconfig/switch.secrets.php` is not used any more. To
356get information about configuring connection properties and credentials in a new
357way please read [this](http://wiki.racktables.org/index.php/Gateways).
358
359This also means that recently added features based on old API (D-Link switches
360and Linux gateway support contributed by Ilya Evseev) are not working any more
361and waiting to be forward-ported to new gateways API. Sorry for that.
362
363Two new config variables appeared in this version:
364  - `SEARCH_DOMAINS`. Comma-separated list of DNS domains that are considered
365    "base" for your network. If RackTables search engine finds multiple objects
366    based on your search input, but there is only one that has FQDN consisting of
367    your input and one of these search domains, you will be redirected to this
368    object and other results will be discarded. Such behavior was unconditional
369    since 0.19.3, which caused many objections from users. So welcome this
370    config var.
371  - `QUICK_LINK_PAGES`. Comma-separated list of RackTables pages to display links
372    to them on top. Each user could have his own list.
373
374Also some of config variables have changed their default values in this version.
375This means that upgrade script will change their values if you have them in
376previous default state. This could be inconvenient, but it is the most effective
377way to encourage users to use new features. If this behavior is not what you
378want, simply revert these variables' values:
379
380variable                | old         | new   | comment
381------------------------|-------------|-------|--------
382`SHOW_LAST_TAB`         | no          | yes
383`IPV4_TREE_SHOW_USAGE`  | yes         | no    | Networks' usage is still available by click.
384`IPV4LB_LISTSRC`        | {$typeid_4} | false
385`FILTER_DEFAULT_ANDOR`  | or          | and   | This implicitly enables the feature of dynamic tree shrinking.
386`FILTER_SUGGEST_EXTRA`  | no          | yes   | Yes, we have extra logical filters!
387`IPV4_TREE_RTR_AS_CELL` | yes         | no    | Display routers as simple text, not cell.
388
389Also please note that variable `IPV4_TREE_RTR_AS_CELL` now has third special value
390besides 'yes' and 'no': 'none'. Use 'none' value if you are experiencing low
391performance on IP tree page. It will completely disable IP ranges scan for
392used/spare IPs and the speed of IP tree will increase radically. The price is
393you will not see the routers in IP tree at all.
394

README.Fedora

1RUNNING RACKTABLES ON A FEDORA SYSTEM
2=====================================
3
4Most files in Fedora package of RackTables application reside in the
5/usr/share/RackTables directory regardless of package version. It is
6assumed that this directory is never directly used in httpd's "document
7root" setting. Instead a symlink or a PHP "require" construct should be
8used for the index.php (and ONLY index.php) file based on some other
9directory that is the actual wwwroot. This greatly improves
10security and allows for the two use cases described below.
11
121. Single RackTables instance per server. By default the application
13expects its configuration file (secret.php) in /etc/RackTables directory,
14which is a part of the RPM. In a fresh installation the files is missing,
15no MySQL database is setup and there is no symlink.
16
17Setting up the symlink is simple: one needs to decide on the URL of the
18RackTables system and map it to filesystem path. For example, the commands
19below are likely to enable access through "http://localhost/racktables/":
20
21# mkdir /var/www/html/racktables
22# ln -s /usr/share/RackTables/wwwroot/index.php /var/www/html/racktables
23
24After that opening the URL in a browser will bring up RackTables installer,
25which will fill in /etc/RackTables/secret.php file and the contents of the
26MySQL database. After that the setup is complete.
27
28
292. Multiple RackTables instances per server. The application is designed
30to be able to serve many independent MySQL databases with the same
31codebase, but different configuration files. This requires a separate
32config directory per each instance. Each of the directories will feature
33an own secret.php file configured for its own MySQL database.
34
35For example, 3 virtual hosts should provide an independent RackTables
36application each. It is assumed that httpd is already configured for the
37virtual hosts using respective directories:
38
39/var/www/vhosts/racktables.example1.com
40/var/www/vhosts/racktables.example2.com
41/var/www/vhosts/racktables.example3.com
42
43The configuration directories could be:
44
45# mkdir /etc/RackTables/example[123]
46
47The "wwwroot" directories will require a short PHP wrapper file each. The
48wrappers will differ only in the value of $racktables_confdir setting:
49
50# cat > /var/www/vhosts/racktables.example1.com/index.php <<EOF
51<?php
52
53$racktables_confdir = '/etc/RackTables/example1';
54require '/usr/share/RackTables/wwwroot/index.php';
55
56EOF
57
58Once the wrapper files are installed, setup of each instance must be
59completed independently through the HTTP installer. Once this is done,
60every instance can be independently maintained, backed up and even deleted.
61

README.md

1# Welcome!
2Thank you for selecting RackTables as your datacenter management solution!
3If you are looking for documentation or wish to send feedback, please
4look for the respective links at [project's web-site](https://racktables.org).
5
6# How to install RackTables
7
8## 1. Prepare the server
9
10RackTables uses a web-server with PHP (5.5.0 or newer) for front-end and a
11MySQL/MariaDB server version 5 for back-end. The most commonly used web-server
12for RackTables is Apache httpd.
13
14### 1.1. Install MySQL/MariaDB server
15
16| Distribution       | How to do                                                               |
17| ------------------ | ----------------------------------------------------------------------- |
18| Debian 6           | `aptitude install mysql-server-5.1`                                     |
19| Debian 7           | `aptitude install mysql-server-5.1`                                     |
20| Fedora 23-26       | `dnf install mariadb-server mariadb`                                    |
21| Fedora 32          | `dnf install mariadb-server`                                            |
22| FreeBSD 10         | `pkg install mysql56-server`                                            |
23| openSUSE 42.1      | `zypper install mysql-community-server`                                 |
24| Scientific&nbsp;Linux&nbsp;6 | `yum install mysql-server mysql` |
25| Ubuntu 16.04       | `apt-get install mysql-server`                                          |
26| Ubuntu 18.04       | `apt-get install mysql-server`                                          |
27| Ubuntu 20.04       | `apt-get install mariadb-server`                                        |
28| RHEL 7             | `yum install -y mariadb-server mariadb`                                 |
29
30### 1.2. Enable Unicode in the MySQL/MariaDB server
31
32| Distribution       | How to do                                                                                                          |
33| ------------------ | ------------------------------------------------------------------------------------------------------------------ |
34| Debian 6           | add `character-set-server=utf8` line to `[mysqld]` section of `/etc/mysql/my.cnf` file and restart mysqld          |
35| Debian 7           | add `character-set-server=utf8` line to `[mysqld]` section of `/etc/mysql/my.cnf` file and restart mysqld          |
36| Fedora 23-32       | ```printf "[mysqld]\ncharacter-set-server=utf8\n" > /etc/my.cnf.d/mysqld-charset.cnf; systemctl restart mariadb``` |
37| openSUSE 42.1      | No action required, comes configured for UTF-8 by default.                                                         |
38| Scientific&nbsp;Linux&nbsp;6 | add `character-set-server=utf8` line to `[mysqld]` section of `/etc/my.cnf` file and restart mysqld |
39| Ubuntu 16.04       | ```printf "[mysqld]\ncharacter-set-server=utf8\n" > /etc/mysql/conf.d/charset.cnf; service mysql restart```        |
40| Ubuntu 18.04       | ```printf "[mysqld]\ncharacter-set-server=utf8\n" > /etc/mysql/conf.d/charset.cnf; service mysql restart```        |
41| Ubuntu 20.04       | No action required, comes configured for UTF-8 by default.                                                         |
42| RHEL 7             | add `character-set-server=utf8` line to `[server]` section of `/etc/my.cnf.d/server.cnf` file and restart mysqld   |
43
44### 1.3. Install PHP and Apache httpd (or nginx)
45
46| Distribution       | How to do                                                                            |
47| ------------------ | ------------------------------------------------------------------------------------ |
48| Debian 6           | `aptitude install libapache2-mod-php5 php5-gd php5-mysql php5-snmp`                  |
49| Debian 7 (nginx)   | `aptitude install nginx php5-fpm` **(see note below)**                               |
50| Fedora 23          | `dnf install httpd php php-mysql php-pdo php-gd php-snmp php-mbstring php-bcmath`    |
51| Fedora 26-32       | `dnf install httpd php php-mysqlnd php-pdo php-gd php-snmp php-mbstring php-bcmath`  |
52| FreeBSD 10         | see note 1.3.c                                                                       |
53| openSUSE 42.1      | `zypper install apache2-mod_php5 php5-gd php5-mbstring php5-mysql php5-bcmath`       |
54| Scientific&nbsp;Linux&nbsp;6 | `yum install httpd php php-mysql php-pdo php-gd php-mbstring php-bcmath` |
55| Ubuntu 16.04       | `apt-get install apache2-bin libapache2-mod-php7.0 php7.0-gd php7.0-mysql php7.0-mbstring php7.0-bcmath php7.0-json php7.0-snmp`
56| Ubuntu 18.04       | `apt-get install apache2-bin libapache2-mod-php7.2 php7.2-gd php7.2-mysql php7.2-mbstring php7.2-bcmath php7.2-json php7.2-snmp`
57| Ubuntu 20.04       | `apt-get install apache2-bin libapache2-mod-php7.4 php7.4-gd php7.4-mysql php7.4-mbstring php7.4-bcmath php7.4-json php7.4-snmp`
58| RHEL 7             | `subscription-manager repos --enable=rhel-server-rhscl-7-rpms`
59|                    | `yum install httpd24 rh-php70 rh-php70-php-mysqlnd rh-php70-php-pdo rh-php70-php-gd rh-php70-php-snmp rh-php70-php-mbstring rh-php70-php-bcmath rh-php70-php-ldap rh-php70-php`
60
61#### 1.3.a. Debian 7 with nginx
62Remember to adjust `server_name` in `server {}` section, otherwise your logout link
63will point to localhost (and thus fail).
64Notice that fpm.sock is advised, keep the rest on default configuration, or
65tweak to your needs. You may need to set `fastcgi_read_timeout 600;` if you use
66some external addons like fping, which may take some time in certain situations.
67Please note that setting aggresive caching for php scripts may result in stale
68content - so maximum of 60 seconds is advised, but by default it is not enabled.
69
70#### 1.3.b. [redacted]
71
72#### 1.3.c. FreeBSD 10
73There are 3 different ways how you can install RackTables and its dependencies on FreeBSD.
74
75###### A. use pkg (Binary Package Management) (not always the newest version)
76```
77# pkg install racktables
78# pkg install mod_php56 mysql56-server
79```
80As of March 2017 this will install RackTables Version 0.20.11 and its dependencies (php 5.6, mysql-server 5.6 and apache 2.4).
81
82###### B. use the ports system (possibly more recent than pkg)
83```
84# cd /usr/ports/sysutils/racktables
85# make install
86# pkg install mod_php56 mysql56-server
87```
88As of March 2017 this will install RackTables Version 0.20.11 and build and install its dependencies (php 5.6, mysql-server 5.6 and apache 2.4).
89
90###### C. manual (newest version)
91Install dependencies with pkg:
92```
93# pkg install php70-bcmath php70-curl php70-filter php70-gd php70-gmp php70-json php70-mbstring php70-openssl php70-pdo php70-pdo_mysql php70-session php70-simplexml php70-snmp php70-sockets
94# pkg install mod_php70 mysql56-server
95```
96
97unpack tar.gz/zip archive to `/usr/local/www`
98
99symlink racktables dir
100```
101# cd /usr/local/www
102# ln -s RackTables-0.20.xx racktables
103```
104
105##### Common install steps
106Apache users should create a racktables.conf file under their apache
107Includes directory with the following contents:
108```
109AddType  application/x-httpd-php         .php
110AddType  application/x-httpd-php-source  .phps
111
112<Directory /usr/local/www/racktables/wwwroot>
113	DirectoryIndex index.php
114	Require all granted
115</Directory>
116Alias /racktables /usr/local/www/racktables/wwwroot
117```
118
119Start services:
120```
121# echo 'apache24_enable="YES"' >> /etc/rc.conf
122# service apache24 start
123# echo 'mysql_enable="YES"' >> /etc/rc.conf
124# service mysql-server start
125```
126
127Browse to http://address.to.your.server/racktables/index.php and follow the instructions.
128
129Note: set `secret.php` permissions when prompted.
130```
131# chown www:www /usr/local/www/racktables/wwwroot/inc/secret.php
132# chmod 400 /usr/local/www/racktables/wwwroot/inc/secret.php
133```
134
135#### 1.3.d. RHEL 7
136Apache configuration and webroot is under /opt/rh/httpd24/root/
137
138## 2. Copy the files
139Unpack the tar.gz/zip archive to a directory of your choice and configure Apache
140httpd to use `wwwroot` subdirectory as a new DocumentRoot. Alternatively,
141symlinks to `wwwroot` or even to `index.php` from an existing DocumentRoot are
142also possible and often advisable (see `README.Fedora`).
143
144## 3. Run the installer
145Open the configured RackTables URL and you will be prompted to configure
146and initialize the application.
147
148| Distribution    | Apache httpd UID:GID    | MySQL/MariaDB UNIX socket path   |
149| --------------- | ----------------------- | -------------------------------- |
150| Fedora 23-32    | `apache:apache`         | `/var/lib/mysql/mysql.sock`      |
151| openSUSE 42.1   | `wwwrun:www`            | `/var/run/mysql/mysql.sock`      |
152| Ubuntu 16.04    | `www-data:www-data`     | `/var/run/mysqld/mysqld.sock`    |
153| Ubuntu 18.04    | `www-data:www-data`     | `/var/run/mysqld/mysqld.sock`    |
154| Ubuntu 20.04    | `www-data:www-data`     | `/var/run/mysqld/mysqld.sock`    |
155
156# How to upgrade RackTables
157
1580. **Backup your database** and check the release notes below before actually
159   starting the upgrade.
1601. Remove all existing files except configuration (the `inc/secret.php` file)
161   and local plugins (in the `plugins/` directory).
1622. Put the contents of the new tar.gz/zip archive into the place.
1633. Open the RackTables page in a browser. The software will detect version
164   mismatch and display a message telling to log in as admin to finish
165   the upgrade.
1664. Do that and report any errors to the bug tracker or the mailing list.
167
168## Release notes
169
170### Upgrading to 0.21.2
171This version drops support for the `$localreports` global variable, which is
172trivial to replace in a local plugin if necessary.
173
174There has been a separation of the `addJS()` and `addCSS()` functions to easily
175identify the resource usage.  The original `addJS()` and `addCSS()` functions will
176most likely be removed in 0.22.0 as they are deprecated.
177
178- *`addJSText()`/`addCSSText()`*
179
180  These functions should be used to add inline JS/CSS
181  not defined in a separate file.
182
183- *`addJSInternal()`/`addCSSInternal()`*
184
185  These functions should be used to add an internal reference to a JS/CSS file
186  which is accessed using the `?module=chrome&uri=` for self hosted JS/CSS
187  files.  This can be utilised by both the core and plugins.
188
189- *`addJSExternal()`/`addCSSExternal()`*
190
191  These functions should be used to add an external reference to a JS/CSS file
192  which hosted on an external site or CDN. This can be utilised by both the core
193  and plugins.
194
195Each of these functions expect the first parameter to be the data or URI, and
196the second parameter to be an optional group.  By default, the group is set to
197'default' and groups are sorted alphabetically.  It should be noted that when
198the `addJSInternal()` function is used, it will also add the jQuery and RackTables
199common JavaScript functons.
200
201Due to this separation, you will no longer need to supply a TRUE or FALSE to
202identify whether the parameter value is text or a URI.  If you rename an
203existing `addJS()`/`addCSS()` function call, be sure to remove this parameter.
204Failure to do so will mean you are effectively be saying that the group name is
205'' (FALSE) or '1' (TRUE).
206
207### Upgrading to 0.21.0
208
209From now on the minimum (oldest) release of PHP that can run RackTables is
2105.5.0.
211
212This release introduces a new plugin architecture.  If you experience issues
213after the upgrade, try disabling plugins.
214Refer to http://wiki.racktables.org/index.php/Plugins
215for more information.
216
217### Upgrading to 0.20.11
218
219New `IPV4_TREE_SHOW_UNALLOCATED` configuration option introduced to disable
220dsplaying unallocated networks in IPv4 space tree. Setting it also disables
221the "knight" feature.
222
223### Upgrading to 0.20.7
224
225From now on the minimum (oldest) release of PHP that can run RackTables is
2265.2.10. In particular, to continue running RackTables on CentOS 5 it is
227necessary to replace its php* RPM packages with respective php53* packages
228before the upgrade (except the JSON package, which PHP 5.3 provides internally).
229
230Database triggers are used for some data consistency measures.  The database
231user account must have the 'TRIGGER' privilege, which was introduced in
232MySQL 5.1.7.
233
234The `IPV4OBJ_LISTSRC` configuration option is reset to an expression that enables
235the IP addressing feature for all object types except those listed.
236
237Tags could now be assigned on the Edit/Properties tab using a text input with
238auto-completion. Type a star '*' to view full tag tree in auto-complete menu.
239It is worth to add the following line to the permissions script if the
240old-fashioned 'Tags' tab is not needed any more:
241```
242  deny {$tab_tags} # this hides 'Tags' tab
243```
244
245This release converts collation of all DB fields to the `utf8_unicode_ci`. This
246procedure may take some time, and could fail if there are rows that differ only
247by letter case. If this happen, you'll see the failed SQL query in upgrade report
248with the "Duplicate entry" error message. Feel free to continue using your
249installation. If desired so, you could eliminate the case-duplicating rows
250and re-apply the failed query.
251
252### Upgrading to 0.20.6
253
254New `MGMT_PROTOS` configuration option replaces the `TELNET_OBJS_LISTSRC`,
255`SSH_OBJS_LISTSRC` and `RDP_OBJS_LISTSRC` options (converting existing settings as
256necessary). `MGMT_PROTOS` allows to specify any management protocol for a
257particular device list using a RackCode filter. The default value
258(`ssh: {$typeid_4}, telnet: {$typeid_8}`) produces `ssh://server.fqdn` for
259servers and `telnet://switch.fqdn` for network switches.
260
261### Upgrading to 0.20.5
262
263This release introduces the VS groups feature. VS groups is a new way to store
264and display virtual services configuration. There is a new "ipvs" (VS group)
265realm. All previously existing VS configuration remains functional and user
266is free to convert it to the new format, which displays it in a more natural way
267and allows to generate virtual_server_group keepalived configs. To convert a
268virtual service to the new format, it is necessary to manually create a VS group
269object and assign IP addresses to it. The VS group will display a "Migrate" tab
270to convert the old-style VS objects, which can be removed after a successful
271conversion.
272
273The old-style VS configuration becomes **deprecated**. Its support will be removed
274in a future major release. So it is strongly recommended to convert it to the
275new format.
276
277### Upgrading to 0.20.4
278
279Please note that some dictionary items of Cisco Catalyst 2960 series switches
280were renamed to meet official Cisco classification:
281
282old name    | new name
283------------|---------
2842960-48TT   | 2960-48TT-L
2852960-24TC   | 2960-24TC-L
2862960-24TT   | 2960-24TT-L
2872960-8TC    | 2960-8TC-L
2882960G-48TC  | 2960G-48TC-L
2892960G-24TC  | 2960G-24TC-L
2902960G-8TC   | 2960G-8TC-L
291C2960-24    | C2960-24-S
292C2960G-24PC | C2960-24PC-L
293
294The `DATETIME_FORMAT` configuration option used in setting date and time output
295format now uses a [different](http://php.net/manual/en/function.strftime.php)
296syntax. During upgrade the option is reset to
297the default value, which is now %Y-%m-%d (YYYY-MM-DD) per ISO 8601.
298
299This release intoduces two new configuration options:
300`REVERSED_RACKS_LISTSRC` and `NEAREST_RACKS_CHECKBOX`.
301
302### Upgrading to 0.20.1
303
304The 0.20.0 release includes a bug that breaks IP networks' capacity displaying on
30532-bit architecture machines. To fix this, this release makes use of PHP's BC
306Math module. It is a new reqiurement. Most PHP distributions have this module
307already enabled, but if yours does not - you need yo recompile PHP.
308
309Security context of 'ipaddress' page now includes tags from the network
310containing an IP address. This means that you should audit your permission rules
311to check there is no unintended allows of changing IPs based on network's
312tagset. Example:
313```
314	allow {client network} and {New York}
315```
316This rule now not only allows any operation on NY client networks, but also any
317operation with IP addresses included in those networks. To fix this, you should
318change the rule this way:
319```
320	allow {client network} and {New York} and not {$page_ipaddress}
321```
322
323### Upgrading to 0.20.0
324
325WARNING: This release have too many internal changes, some of them were waiting
326more than a year to be released. So this release is considered "BETA" and is
327recommended only to curiuos users, who agree to sacrifice the stability to the
328progress.
329
330Racks and Rows are now stored in the database as Objects. The RackObject table
331was renamed to Object. SQL views were created to ease the migration of custom
332reports and scripts.
333
334New plugins engine instead of `local.php` file. To make your own code stored in
335`local.php` work, you must move the `local.php` file into the `plugins/` directory.
336The name of this file does not matter any more. You also can store multiple
337files in that dir, separate your plugins by features, share them and try the
338plugins from other people just placing them into `plugins/` dir, no more merging.
339
340* `$path_to_local_php` variable has no special meaning any more.
341* `$racktables_confdir` variable is now used only to search for `secret.php` file.
342* `$racktables_plugins_dir` is a new overridable special variable pointing to `plugins/` directory.
343
344Beginning with this version it is possible to delete IP prefixes, VLANs, Virtual
345services and RS pools from within theirs properties tab. So please inspect your
346permissions rules to assure there are no undesired allows for deletion of these
347objects. To ensure this, you could try this code in the beginning of permissions
348script:
349```
350allow {userid_1} and {$op_del}
351deny {$op_del} and ({$tab_edit} or {$tab_properties})
352```
353
354Hardware gateways engine was rewritten in this version of RackTables. This means
355that the file `gateways/deviceconfig/switch.secrets.php` is not used any more. To
356get information about configuring connection properties and credentials in a new
357way please read [this](http://wiki.racktables.org/index.php/Gateways).
358
359This also means that recently added features based on old API (D-Link switches
360and Linux gateway support contributed by Ilya Evseev) are not working any more
361and waiting to be forward-ported to new gateways API. Sorry for that.
362
363Two new config variables appeared in this version:
364  - `SEARCH_DOMAINS`. Comma-separated list of DNS domains that are considered
365    "base" for your network. If RackTables search engine finds multiple objects
366    based on your search input, but there is only one that has FQDN consisting of
367    your input and one of these search domains, you will be redirected to this
368    object and other results will be discarded. Such behavior was unconditional
369    since 0.19.3, which caused many objections from users. So welcome this
370    config var.
371  - `QUICK_LINK_PAGES`. Comma-separated list of RackTables pages to display links
372    to them on top. Each user could have his own list.
373
374Also some of config variables have changed their default values in this version.
375This means that upgrade script will change their values if you have them in
376previous default state. This could be inconvenient, but it is the most effective
377way to encourage users to use new features. If this behavior is not what you
378want, simply revert these variables' values:
379
380variable                | old         | new   | comment
381------------------------|-------------|-------|--------
382`SHOW_LAST_TAB`         | no          | yes
383`IPV4_TREE_SHOW_USAGE`  | yes         | no    | Networks' usage is still available by click.
384`IPV4LB_LISTSRC`        | {$typeid_4} | false
385`FILTER_DEFAULT_ANDOR`  | or          | and   | This implicitly enables the feature of dynamic tree shrinking.
386`FILTER_SUGGEST_EXTRA`  | no          | yes   | Yes, we have extra logical filters!
387`IPV4_TREE_RTR_AS_CELL` | yes         | no    | Display routers as simple text, not cell.
388
389Also please note that variable `IPV4_TREE_RTR_AS_CELL` now has third special value
390besides 'yes' and 'no': 'none'. Use 'none' value if you are experiencing low
391performance on IP tree page. It will completely disable IP ranges scan for
392used/spare IPs and the speed of IP tree will increase radically. The price is
393you will not see the routers in IP tree at all.
394