|
|
5e30283 |
RUNNING RACKTABLES ON A FEDORA SYSTEM
|
|
|
5e30283 |
=====================================
|
|
|
5e30283 |
|
|
|
5e30283 |
Most files in Fedora package of RackTables application reside in the
|
|
|
5e30283 |
/usr/share/RackTables directory regardless of package version. It is
|
|
|
5e30283 |
assumed, that this directory is never directly used in httpd's "document
|
|
|
5e30283 |
root" setting. Instead a symlink or a PHP "require" construct should be
|
|
|
5e30283 |
used for the index.php (and ONLY index.php) file based on some other
|
|
|
5e30283 |
directory, which is actually used as wwwroot. This greatly improves
|
|
|
5e30283 |
security and allows for the two use cases described below.
|
|
|
5e30283 |
|
|
|
5e30283 |
1. Single RackTables instance per server. By default the application
|
|
|
5e30283 |
expects its configuration files (mandatory secret.php and optional
|
|
|
5e30283 |
local.php) in /etc/RackTables directory, which is a part of the RPM. In
|
|
|
5e30283 |
a fresh installation both files are missing, no MySQL database is setup
|
|
|
5e30283 |
and there is no symlink.
|
|
|
5e30283 |
|
|
|
5e30283 |
Setting up the symlink is simple: one needs to decide on the URL of the
|
|
|
5e30283 |
RackTables system and map it to filesystem path. For example, the commands
|
|
|
5e30283 |
below are likely to enable access through "http://localhost/racktables/":
|
|
|
5e30283 |
|
|
|
5e30283 |
# mkdir /var/www/html/racktables
|
|
|
5e30283 |
# ln -s /usr/share/RackTables/wwwroot/index.php /var/www/html/racktables
|
|
|
5e30283 |
|
|
|
5e30283 |
After that opening the URL in a browser will bring up RackTables installer,
|
|
|
5e30283 |
which will fill in /etc/RackTables/secret.php file and the contents of the
|
|
|
5e30283 |
MySQL database. After that the setup is complete.
|
|
|
5e30283 |
|
|
|
5e30283 |
|
|
|
5e30283 |
2. Multiple RackTables instances per server. The application is designed
|
|
|
5e30283 |
to be able to serve many independent MySQL databases with the same
|
|
|
5e30283 |
codebase, but different configuration files. This requires a separate
|
|
|
5e30283 |
config directory per each instance. Each of the directories will feature
|
|
|
5e30283 |
an own secret.php file configured for its own MySQL database.
|
|
|
5e30283 |
|
|
|
5e30283 |
For example, 3 virtual hosts should provide an independent RackTables
|
|
|
5e30283 |
application each. It is assumed, that httpd is already configured for the
|
|
|
5e30283 |
virtual hosts using respective directories:
|
|
|
5e30283 |
|
|
|
5e30283 |
/var/www/vhosts/racktables.example1.com
|
|
|
5e30283 |
/var/www/vhosts/racktables.example2.com
|
|
|
5e30283 |
/var/www/vhosts/racktables.example3.com
|
|
|
5e30283 |
|
|
|
5e30283 |
The configuration directories could be:
|
|
|
5e30283 |
|
|
|
5e30283 |
# mkdir /etc/RackTables/example[123]
|
|
|
5e30283 |
|
|
|
5e30283 |
The "wwwroot" directories will require a short PHP wrapper file each. The
|
|
|
5e30283 |
wrappers will differ only in the value of $racktables_confdir setting:
|
|
|
5e30283 |
|
|
|
5e30283 |
# cat > /var/www/vhosts/racktables.example1.com/index.php <<
|
|
|
5e30283 |
|
|
|
5e30283 |
|
|
|
5e30283 |
$racktables_confdir = '/etc/RackTables/example1';
|
|
|
5e30283 |
require '/usr/share/RackTables/wwwroot/index.php';
|
|
|
5e30283 |
|
|
|
5e30283 |
?>
|
|
|
5e30283 |
EOF
|
|
|
5e30283 |
|
|
|
5e30283 |
Once the wrapper files are installed, setup of each instance must be
|
|
|
5e30283 |
completed independently through the HTTP installer. Once this is done,
|
|
|
5e30283 |
every instance can be independently maintained, backed up and even deleted.
|