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