tests: cover array_first() and array_last()
[racktables] / README.md
CommitLineData
2797f2c7
DO
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](http://racktables.org).
5
6# Installing RackTables
7
8## I. Prepare the server
9
10RackTables requires a MySQL server version 5.x built with InnoDB and
11Unicode support and configured appropriately. By default RackTables is
12developed on Apache httpd with PHP 5 module and several PHP extensions.
13Below is a list of known-good distributions with respective setup notes.
14
15### Fedora 8-16
16* MySQL: `yum install mysql-server mysql`
17* Apache/PHP: `yum install httpd php php-mysql php-pdo php-gd php-snmp php-mbstring php-bcmath`
18* To enable Unicode, add `character-set-server=utf8` line to `[mysqld]`
19 section of `/etc/my.cnf` file and restart mysqld.
20
8c5b4ba3
DO
21### Fedora 23
22* MySQL: `dnf install mariadb-server mariadb`
23* Apache/PHP: `dnf install httpd php php-mysql php-pdo php-gd php-snmp php-mbstring php-bcmath`
24* To enable Unicode:
25```
26printf "[mysqld]\ncharacter-set-server=utf8\n" > /etc/my.cnf.d/mysqld-charset.cnf
27systemctl restart mariadb
28```
29
2797f2c7
DO
30### Debian 6
31* MySQL: `aptitude install mysql-server-5.1`
32* Apache/PHP: `aptitude install libapache2-mod-php5 php5-gd php5-mysql php5-snmp`
33* To enable Unicode, add `character-set-server=utf8` line to `[mysqld]`
34 section of `/etc/mysql/my.cnf` file and restart mysqld.
35
36### Debian 7 with nginx
37* MySQL: `aptitude install mysql-server-5.1`
38* nginx: `aptitude install nginx php5-fpm`
39* To enable Unicode, add `character-set-server=utf8` line to `[mysqld]`
40 section of `/etc/mysql/my.cnf` file and restart mysqld.
41
42Remember to adjust `server_name` in `server {}` section, otherwise your logout link
43will point to localhost (and thus fail).
44Notice, that fpm.sock is advised, keep the rest on default configuration, or
45tweak to your needs. You may need to set `fastcgi_read_timeout 600;` if you use
46some external addons like fping, which may take some time in certain situations.
47Please note that setting aggresive caching for php scripts may result in stale
48content - so maximum of 60 seconds is advised, but by default it is not enabled.
49
50### Ubuntu 14.04
51* MySQL: `apt-get install mysql-server`
52* Apache/PHP: `apt-get install apache2-bin libapache2-mod-php5 php5-gd php5-mysql php5-snmp`
53* To enable Unicode:
54```
55printf "[mysqld]\ncharacter-set-server=utf8\n" > /etc/mysql/conf.d/charset.cnf
56service mysql restart
57```
2797f2c7
DO
58
59### ALTLinux 4.0
60* MySQL: `apt-get install MySQL-server`
61* Apache/PHP: `apt-get install apache2-httpd-prefork php5-gd2 php5-pdo_mysql php5-pdo apache2-mod_php5 php5-mbstring`
62* To enable Unicode, add `CHSET=utf8` line to `/etc/sysconfig/mysqld` file
63 and restart mysqld.
64
65### openSUSE 11.0
66* MySQL: YaST -> Software -> software management -> Web and LAMP server -> mysql
67* Apache/PHP: use YaST to install apache2-mod_php5, php5-gd, php5-mbstring,
68 php5-mysql, php5-bcmath, php5-snmp and php5-ldap
69* To enable Unicode, add `default-character-set=utf8` line to `[mysql]`
70 section of `/etc/my.cnf` file and restart mysqld.
71
72### Scientific Linux 6
73* MySQL: `yum install mysql-server mysql`
74* Apache/PHP: `yum install httpd php php-mysql php-pdo php-gd php-mbstring php-bcmath`
75* To enable Unicode, add `character-set-server=utf8` line to `[mysqld]`
76 section of `/etc/my.cnf` file and restart mysqld.
77
78### CentOS 5
79* MySQL: `yum install mysql-server mysql`
80* Apache/PHP: `yum install httpd php53 php53-mysql php53-pdo php53-gd php53-mbstring php53-bcmath`
81* To enable Unicode, add `character-set-server=utf8` line to `[mysqld]`
82 section of `/etc/my.cnf` file and restart mysqld.
83
84### FreeBSD 8
85* Apache/PHP:
86```
87# make -C /usr/ports/www/apache13-modssl install
88# make -C /usr/ports/www/php5-session install
89[X] CLI Build CLI version
90[X] APACHE Build Apache module
91[X] MULTIBYTE Enable zend multibyte support
92# make -C /usr/ports/graphics/php5-gd install
93# make -C /usr/ports/databases/php5-pdo_mysql install
94# make -C /usr/ports/devel/pcre install
95!!! Enable UTF-8 support ............ : yes
96!!! Unicode properties .............. : yes
97# make -C /usr/ports/devel/php5-pcre install
98# make -C /usr/ports/converters/php5-mbstring install
99[X] REGEX Enable multibyte regex support
100
101# make -C /usr/ports/net-mgmt/php5-snmp install
102# make -C /usr/ports/net/php5-ldap install
103```
104
105## II. Copy the files
106Unpack the tar.gz/zip archive to a directory of your choice and configure Apache
107httpd to use `wwwroot` subdirectory as a new DocumentRoot. Alternatively,
108symlinks to `wwwroot` or even to `index.php` from an existing DocumentRoot are
109also possible and often adisable (see `README.Fedora`).
110
111## III. Run the installer
112Open the configured RackTables URL and you will be prompted to configure
113and initialize the application.
114
8c5b4ba3
DO
115| Distribution | Apache httpd UID:GID | MySQL UNIX socket path |
116| --------------- | ----------------------- | -------------------------------- |
117| Fedora 23 | `apache:apache` | `/var/lib/mysql/mysql.sock` |
118| Ubuntu 14.04 | `www-data:www-data` | `/var/run/mysqld/mysqld.sock` |
119
2797f2c7
DO
120# Upgrading RackTables
121
1220. **Backup your database** and check the release notes below before actually
123 starting the upgrade.
1241. Remove all existing files except configuration (the `inc/secret.php` file)
125 and local plugins (in the `plugins/` directory).
1262. Put the contents of the new tar.gz/zip archive into the place.
1273. Open the RackTables page in a browser. The software will detect version
128 mismatch and display a message telling to log in as admin to finish
129 the upgrade.
1304. Do that and report any errors to the bug tracker or the mailing list.
131
132## Release notes
133
c5c39ee5
AA
134### Upgrading to 0.20.11
135
136New IPV4_TREE_SHOW_UNALLOCATED configuration option introduced to disable
137dsplaying unallocated networks in IPv4 space tree. Setting it also disables
138KNIGHT feature.
139
2797f2c7
DO
140### Upgrading to 0.20.7
141
142From now on the minimum (oldest) release of PHP that can run RackTables is
1435.2.10. In particular, to continue running RackTables on CentOS 5 it is
144necessary to replace its php* RPM packages with respective php53* packages
145before the upgrade (except the JSON package, which PHP 5.3 provides internally).
146
147Database triggers are used for some data consistency measures. The database
148user account must have the 'TRIGGER' privilege, which was introduced in
149MySQL 5.1.7.
150
151The `IPV4OBJ_LISTSRC` configuration option is reset to an expression which enables
152the IP addressing feature for all object types except those listed.
153
154Tags could now be assigned on the Edit/Properties tab using a text input with
155auto-completion. Type a star '*' to view full tag tree in auto-complete menu.
156It is worth to add the following line to the permissions script if the
157old-fashioned 'Tags' tab is not needed any more:
158```
159 deny {$tab_tags} # this hides 'Tags' tab
160```
161
162This release converts collation of all DB fields to the `utf8_unicode_ci`. This
163procedure may take some time, and could fail if there are rows that differ only
164by letter case. If this happen, you'll see the failed SQL query in upgrade report
165with the "Duplicate entry" error message. Feel free to continue using your
166installation. If desired so, you could eliminate the case-duplicating rows
167and re-apply the failed query.
168
169### Upgrading to 0.20.6
170
171New `MGMT_PROTOS` configuration option replaces the `TELNET_OBJS_LISTSRC`,
172`SSH_OBJS_LISTSRC` and `RDP_OBJS_LISTSRC` options (converting existing settings as
173necessary). `MGMT_PROTOS` allows to specify any management protocol for a
174particular device list using a RackCode filter. The default value
175(`ssh: {$typeid_4}, telnet: {$typeid_8}`) produces `ssh://server.fqdn` for
176servers and `telnet://switch.fqdn` for network switches.
177
178### Upgrading to 0.20.5
179
180This release introduces the VS groups feature. VS groups is a new way to store
181and display virtual services configuration. There is a new "ipvs" (VS group)
182realm. All previously existing VS configuration remains functional and user
183is free to convert it to the new format, which displays it in a more natural way
184and allows to generate virtual_server_group keepalived configs. To convert a
185virtual service to the new format, it is necessary to manually create a VS group
186object and assign IP addresses to it. The VS group will display a "Migrate" tab
187to convert the old-style VS objects, which can be removed after a successful
188conversion.
189
190The old-style VS configuration becomes **deprecated**. Its support will be removed
191in a future major release. So it is strongly recommended to convert it to the
192new format.
193
194### Upgrading to 0.20.4
195
196Please note that some dictionary items of Cisco Catalyst 2960 series switches
197were renamed to meet official Cisco classification:
198
199old name | new name
200------------|---------
2012960-48TT | 2960-48TT-L
2022960-24TC | 2960-24TC-L
2032960-24TT | 2960-24TT-L
2042960-8TC | 2960-8TC-L
2052960G-48TC | 2960G-48TC-L
2062960G-24TC | 2960G-24TC-L
2072960G-8TC | 2960G-8TC-L
208C2960-24 | C2960-24-S
209C2960G-24PC | C2960-24PC-L
210
211The `DATETIME_FORMAT` configuration option used in setting date and time output
212format now uses a [different](http://php.net/manual/en/function.strftime.php)
213syntax. During upgrade the option is reset to
214the default value, which is now %Y-%m-%d (YYYY-MM-DD) per ISO 8601.
215
216This release intoduces two new configuration options:
217`REVERSED_RACKS_LISTSRC` and `NEAREST_RACKS_CHECKBOX`.
218
219### Upgrading to 0.20.1
220
221The 0.20.0 release includes bug which breaks IP networks' capacity displaying on
22232-bit architecture machines. To fix this, this release makes use of PHP's BC
223Math module. It is a new reqiurement. Most PHP distributions have this module
224already enabled, but if yours does not - you need yo recompile PHP.
225
226Security context of 'ipaddress' page now includes tags from the network
227containing an IP address. This means that you should audit your permission rules
228to check there is no unintended allows of changing IPs based on network's
229tagset. Example:
230```
231 allow {client network} and {New York}
232```
233This rule now not only allows any operation on NY client networks, but also any
234operation with IP addresses included in those networks. To fix this, you should
235change the rule this way:
236```
237 allow {client network} and {New York} and not {$page_ipaddress}
238```
239
240### Upgrading to 0.20.0
241
242WARNING: This release have too many internal changes, some of them were waiting
243more than a year to be released. So this release is considered "BETA" and is
244recommended only to curiuos users, who agree to sacrifice the stability to the
245progress.
246
247Racks and Rows are now stored in the database as Objects. The RackObject table
248was renamed to Object. SQL views were created to ease the migration of custom
249reports and scripts.
250
251New plugins engine instead of `local.php` file. To make your own code stored in
252`local.php` work, you must move the `local.php` file into the `plugins/` directory.
253The name of this file does not matter any more. You also can store multiple
254files in that dir, separate your plugins by features, share them and try the
255plugins from other people just placing them into `plugins/` dir, no more merging.
256
257* `$path_to_local_php` variable has no special meaning any more.
258* `$racktables_confdir` variable is now used only to search for `secret.php` file.
259* `$racktables_plugins_dir` is a new overridable special variable pointing to `plugins/` directory.
260
261Beginning with this version it is possible to delete IP prefixes, VLANs, Virtual
262services and RS pools from within theirs properties tab. So please inspect your
263permissions rules to assure there are no undesired allows for deletion of these
264objects. To ensure this, you could try this code in the beginning of permissions
265script:
266```
267allow {userid_1} and {$op_del}
268deny {$op_del} and ({$tab_edit} or {$tab_properties})
269```
270
271Hardware gateways engine was rewritten in this version of RackTables. This means
272that the file `gateways/deviceconfig/switch.secrets.php` is not used any more. To
273get information about configuring connection properties and credentials in a new
274way please read [this](http://wiki.racktables.org/index.php/Gateways).
275
276This also means that recently added features based on old API (D-Link switches
277and Linux gateway support contributed by Ilya Evseev) are not working any more
278and waiting to be forward-ported to new gateways API. Sorry for that.
279
280Two new config variables appeared in this version:
281 - `SEARCH_DOMAINS`. Comma-separated list of DNS domains which are considered
282 "base" for your network. If RackTables search engine finds multiple objects
283 based on your search input, but there is only one which FQDN consists of
284 your input and one of these search domains, you will be redirected to this
285 object and other results will be discarded. Such behavior was unconditional
286 since 0.19.3, which caused many objections from users. So welcome this
287 config var.
288 - `QUICK_LINK_PAGES`. Comma-separated list of RackTables pages to display links
289 to them on top. Each user could have his own list.
290
291Also some of config variables have changed their default values in this version.
292This means that upgrade script will change their values if you have them in
293previous default state. This could be inconvenient, but it is the most effective
294way to encourage users to use new features. If this behavior is not what you
295want, simply revert these variables' values:
296
297variable | old | new | comment
298------------------------|-------------|-------|--------
299`SHOW_LAST_TAB` | no | yes
300`IPV4_TREE_SHOW_USAGE` | yes | no | Networks' usage is still available by click.
301`IPV4LB_LISTSRC` | {$typeid_4} | false
302`FILTER_DEFAULT_ANDOR` | or | and | This implicitly enables the feature of dynamic tree shrinking.
303`FILTER_SUGGEST_EXTRA` | no | yes | Yes, we have extra logical filters!
304`IPV4_TREE_RTR_AS_CELL` | yes | no | Display routers as simple text, not cell.
305
306Also please note that variable `IPV4_TREE_RTR_AS_CELL` now has third special value
307besides 'yes' and 'no': 'none'. Use 'none' value if you are experiencing low
308performance on IP tree page. It will completely disable IP ranges scan for
309used/spare IPs and the speed of IP tree will increase radically. The price is
310you will not see the routers in IP tree at all.
311
312### Upgrading to 0.19.13
313A new "date" attribute type has been added. Existing date based fields ("HW
314warranty expiration", "support contract expiration" and "SW warranty
315expiration") will be converted to this new type but must be in the format
316"mm/dd/yyyy" otherwise the conversion will fail.
317
318### Upgrading to 0.19.2
319
320This release is different in filesystem layout. The "gateways" directory has
321been moved from `wwwroot` directory. This improves security a bit. You can also
322separate your local settings and add-ons from the core RackTables code. To do
323that, put a single `index.php` file into the DocumentRoot of your http server:
324
325```php
326<?php
327$racktables_confdir='/directory/with/secret.php/and/local.php/';
328require '/directory_where_you_extracted_racktables_distro/wwwroot/index.php';
329?>
330```
331
332No more files are needed to be available directly over the HTTP. Full list of
333filesystem paths which could be specified in custom `index.php` or `secret.php`:
334* `$racktables_gwdir`: path to the gateways directory;
335* `$racktables_staticdir`: path to the directory containing `pix`, `js`, `css` directories;
336* `$racktables_confdir`: path where secret.php and local.php are located. It is not recommended to define it in `secret.php`, cause only the path to `local.php` will be affected;
337* `$path_to_secret_php`: Ignore `$racktables_confdir` when locating `secret.php` and use the specified path;
338* `$path_to_local_php`: idem for `local.php`.
339
340### Upgrading to 0.19.0
341
342The files, which are intended for the httpd (web-server) directory, are now in
343the `wwwroot` directory of the tar.gz archive. Files outside of that directory
344are not directly intended for httpd environment and should not be copied to the
345server.
346
347This release incorporates ObjectLog functionality, which used to be available as
348a separate plugin. For the best results it is advised to disable (through
349`local.php`) external ObjectLog plugin permanently before the new version is
350installed. All previously accumulated ObjectLog records will be available
351through the updated standard interface.
352
353RackTables is now using PHP JSON extension which is included in the PHP core
354since 5.2.0.
355
356The barcode attribute was removed. The upgrade script attempts to preserve the
357data by moving it to either the 'OEM S/N 1' attribute or to a Log entry. You
358should backup your database beforehand anyway.
359
360### Upgrading to 0.18.x
361
362RackTables from its version 0.18.0 and later is not compatible with RHEL/CentOS
363(at least with versions up to 5.5) Linux distributions in their default
364installation. There are yet options to work around that:
365
3661. Install RackTables on a server with a different distribution/OS.
3672. Request Linux distribution vendor to fix the bug with PCRE.
3683. Repair your RHEL/CentOS installation yourself by fixing its PCRE
369 RPM as explained [here](http://bugs.centos.org/view.php?id=3252)