2016-08-24 08:12:20 +01:00
|
|
|
source: Extensions/Sub-Directory.md
|
2018-10-27 23:04:34 +01:00
|
|
|
path: blob/master/doc/
|
2019-09-09 05:48:35 -05:00
|
|
|
|
|
|
|
To run LibreNMS under a subdirectory on your Apache server, the
|
|
|
|
directives for the LibreNMS directory are placed in the base server
|
|
|
|
configuration, or in a virtual host container of your choosing. If
|
|
|
|
using a virtual host, place the directives in the file where the
|
|
|
|
virtual host is configured. If using the base server on RHEL
|
|
|
|
distributions (CentOS, Scientific Linux, etc.) the directives can be
|
|
|
|
placed in `/etc/httpd/conf.d/librenms.conf`. For Debian distributions
|
|
|
|
(Ubuntu, etc.) place the directives in
|
2015-08-10 10:43:11 -07:00
|
|
|
`/etc/apache2/sites-available/default`.
|
|
|
|
|
|
|
|
```apache
|
|
|
|
#These directives can be inside a virtual host or in the base server configuration
|
2015-08-11 14:22:20 -07:00
|
|
|
AllowEncodedSlashes On
|
2015-08-10 10:43:11 -07:00
|
|
|
Alias /librenms /opt/librenms/html
|
|
|
|
|
|
|
|
<Directory "/opt/librenms/html">
|
|
|
|
AllowOverride All
|
|
|
|
Options FollowSymLinks MultiViews
|
|
|
|
</Directory>
|
|
|
|
```
|
|
|
|
|
2019-09-09 05:48:35 -05:00
|
|
|
The `RewriteBase` directive in `html/.htaccess` must be rewritten to
|
|
|
|
reference the subdirectory name. Assuming LibreNMS is running at
|
2019-10-21 02:47:40 +02:00
|
|
|
<http://example.com/librenms/>, you will need to change `RewriteBase /`
|
2019-09-09 05:48:35 -05:00
|
|
|
to `RewriteBase /librenms`.
|
2015-08-10 10:43:11 -07:00
|
|
|
|
2019-09-09 05:48:35 -05:00
|
|
|
Finally, set `APP_URL=/librenms/` in .env and `$config["base_url"] =
|
|
|
|
'/librenms/';` in config.php.
|