mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
docs: more md linting (#10371)
* clean 1-Minute-Polling.md formatting * cleanup formatting for Adding-a-Device.md * clean up formatting of Cleanup-options.md * cleanup formatting some for CLI-Tools.md * cleanup formatting for Syslog.md and Configuration.md * cleanup formatting for Device-Sensors.md * cleanup formatting for Device-Troubleshooting.md * cleanup Discovery Support.md * cleanup Environment-Variables.md * cleanup Example-Hardware-Setup.md and FAQ.mg * update Features.md, Install Validation.md, Perfermance.md, Poller Support.md, and index.md * cleanup Remote-Monitoring-VPN.md, SNMP-Configuration-Examples.md, and SSL-Configuration.md * lots of updates for Installation docs * more installation doc cleanup * more formatting cleanup * clean Work-Map.md up some
This commit is contained in:
@@ -1,45 +1,65 @@
|
||||
source: Installation/Installation-Ubuntu-1804-Nginx.md
|
||||
path: blob/master/doc/
|
||||
> NOTE: These instructions assume you are the **root** user. If you are not, prepend `sudo` to the shell commands (the ones that aren't at `mysql>` prompts) or temporarily become a user with root privileges with `sudo -s` or `sudo -i`.
|
||||
|
||||
> NOTE: These instructions assume you are the **root** user. If you
|
||||
> are not, prepend `sudo` to the shell commands (the ones that aren't
|
||||
> at `mysql>` prompts) or temporarily become a user with root
|
||||
> privileges with `sudo -s` or `sudo -i`.
|
||||
|
||||
**Please note the minimum supported PHP version is 7.1.3**
|
||||
|
||||
## Install Required Packages ##
|
||||
apt install software-properties-common
|
||||
add-apt-repository universe
|
||||
apt update
|
||||
apt install curl composer fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php7.2-cli php7.2-curl php7.2-fpm php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-snmp php7.2-xml php7.2-zip python-memcache python-mysqldb rrdtool snmp snmpd whois
|
||||
|
||||
#### Add librenms user
|
||||
# Install Required Packages
|
||||
|
||||
useradd librenms -d /opt/librenms -M -r
|
||||
usermod -a -G librenms www-data
|
||||
```
|
||||
apt install software-properties-common
|
||||
add-apt-repository universe
|
||||
apt update
|
||||
apt install curl composer fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php7.2-cli php7.2-curl php7.2-fpm php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-snmp php7.2-xml php7.2-zip python-memcache python-mysqldb rrdtool snmp snmpd whois
|
||||
```
|
||||
|
||||
#### Download LibreNMS
|
||||
# Add librenms user
|
||||
|
||||
cd /opt
|
||||
git clone https://github.com/librenms/librenms.git
|
||||
|
||||
#### Set permissions
|
||||
```
|
||||
useradd librenms -d /opt/librenms -M -r
|
||||
usermod -a -G librenms www-data
|
||||
```
|
||||
|
||||
chown -R librenms:librenms /opt/librenms
|
||||
chmod 770 /opt/librenms
|
||||
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||
# Download LibreNMS
|
||||
|
||||
#### Install PHP dependencies
|
||||
```
|
||||
cd /opt
|
||||
git clone https://github.com/librenms/librenms.git
|
||||
```
|
||||
|
||||
su - librenms
|
||||
./scripts/composer_wrapper.php install --no-dev
|
||||
exit
|
||||
# Set permissions
|
||||
|
||||
## DB Server ##
|
||||
```
|
||||
chown -R librenms:librenms /opt/librenms
|
||||
chmod 770 /opt/librenms
|
||||
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs
|
||||
/opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||
```
|
||||
|
||||
#### Configure MySQL
|
||||
systemctl restart mysql
|
||||
mysql -uroot -p
|
||||
# Install PHP dependencies
|
||||
|
||||
```
|
||||
su - librenms
|
||||
./scripts/composer_wrapper.php install --no-dev
|
||||
exit
|
||||
```
|
||||
|
||||
# DB Server
|
||||
|
||||
## Configure MySQL
|
||||
|
||||
```
|
||||
systemctl restart mysql
|
||||
mysql -uroot -p
|
||||
```
|
||||
|
||||
> NOTE: Please change the 'password' below to something secure.
|
||||
|
||||
```sql
|
||||
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
||||
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
|
||||
@@ -48,7 +68,9 @@ FLUSH PRIVILEGES;
|
||||
exit
|
||||
```
|
||||
|
||||
vi /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||
```
|
||||
vi /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||
```
|
||||
|
||||
Within the `[mysqld]` section please add:
|
||||
|
||||
@@ -56,21 +78,34 @@ Within the `[mysqld]` section please add:
|
||||
innodb_file_per_table=1
|
||||
lower_case_table_names=0
|
||||
```
|
||||
systemctl restart mysql
|
||||
|
||||
## Web Server ##
|
||||
```
|
||||
systemctl restart mysql
|
||||
```
|
||||
|
||||
### Configure and Start PHP-FPM
|
||||
Ensure date.timezone is set in php.ini to your preferred time zone. See http://php.net/manual/en/timezones.php for a list of supported timezones. Valid examples are: "America/New_York", "Australia/Brisbane", "Etc/UTC".
|
||||
# Web Server
|
||||
|
||||
vi /etc/php/7.2/fpm/php.ini
|
||||
vi /etc/php/7.2/cli/php.ini
|
||||
## Configure and Start PHP-FPM
|
||||
|
||||
systemctl restart php7.2-fpm
|
||||
Ensure date.timezone is set in php.ini to your preferred time zone.
|
||||
See http://php.net/manual/en/timezones.php for a list of supported
|
||||
timezones. Valid examples are: "America/New_York",
|
||||
"Australia/Brisbane", "Etc/UTC".
|
||||
|
||||
#### Configure NGINX
|
||||
```
|
||||
vi /etc/php/7.2/fpm/php.ini
|
||||
vi /etc/php/7.2/cli/php.ini
|
||||
```
|
||||
|
||||
vi /etc/nginx/conf.d/librenms.conf
|
||||
```
|
||||
systemctl restart php7.2-fpm
|
||||
```
|
||||
|
||||
## Configure NGINX
|
||||
|
||||
```
|
||||
vi /etc/nginx/conf.d/librenms.conf
|
||||
```
|
||||
|
||||
Add the following config, edit `server_name` as required:
|
||||
|
||||
@@ -101,76 +136,119 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
rm /etc/nginx/sites-enabled/default
|
||||
systemctl restart nginx
|
||||
```
|
||||
rm /etc/nginx/sites-enabled/default
|
||||
systemctl restart nginx
|
||||
```
|
||||
|
||||
### Configure snmpd
|
||||
# Configure snmpd
|
||||
|
||||
cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf
|
||||
vi /etc/snmp/snmpd.conf
|
||||
```
|
||||
cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf
|
||||
vi /etc/snmp/snmpd.conf
|
||||
```
|
||||
|
||||
Edit the text which says `RANDOMSTRINGGOESHERE` and set your own community string.
|
||||
|
||||
curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
|
||||
chmod +x /usr/bin/distro
|
||||
systemctl restart snmpd
|
||||
```
|
||||
curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
|
||||
hmod +x /usr/bin/distro
|
||||
systemctl restart snmpd
|
||||
```
|
||||
|
||||
### Cron job
|
||||
# Cron job
|
||||
|
||||
cp /opt/librenms/librenms.nonroot.cron /etc/cron.d/librenms
|
||||
```
|
||||
cp /opt/librenms/librenms.nonroot.cron /etc/cron.d/librenms
|
||||
```
|
||||
|
||||
> NOTE: Keep in mind that cron, by default, only uses a very limited set of environment variables. You may need to configure proxy variables for the cron invocation. Alternatively adding the proxy settings in config.php is possible too. The config.php file will be created in the upcoming steps. Review the following URL after you finished librenms install steps: https://docs.librenms.org/Support/Configuration/#proxy-support
|
||||
> NOTE: Keep in mind that cron, by default, only uses a very limited
|
||||
> set of environment variables. You may need to configure proxy
|
||||
> variables for the cron invocation. Alternatively adding the proxy
|
||||
> settings in config.php is possible too. The config.php file will be
|
||||
> created in the upcoming steps. Review the following URL after you
|
||||
> finished librenms install steps:
|
||||
> <https://docs.librenms.org/Support/Configuration/#proxy-support>
|
||||
|
||||
#### Copy logrotate config
|
||||
# Copy logrotate config
|
||||
|
||||
LibreNMS keeps logs in `/opt/librenms/logs`. Over time these can become large and be rotated out. To rotate out the old logs you can use the provided logrotate config file:
|
||||
LibreNMS keeps logs in `/opt/librenms/logs`. Over time these can
|
||||
become large and be rotated out. To rotate out the old logs you can
|
||||
use the provided logrotate config file:
|
||||
|
||||
cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms
|
||||
```
|
||||
cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms
|
||||
```
|
||||
|
||||
### Set permissions
|
||||
# Set permissions
|
||||
|
||||
chown -R librenms:librenms /opt/librenms
|
||||
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||
```
|
||||
chown -R librenms:librenms /opt/librenms
|
||||
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||
```
|
||||
|
||||
## Web installer ##
|
||||
# Web installer
|
||||
|
||||
Now head to the web installer and follow the on-screen instructions.
|
||||
|
||||
http://librenms.example.com/install.php
|
||||
<http://librenms.example.com/install.php>
|
||||
|
||||
The web installer might prompt you to create a `config.php` file in your librenms install location manually, copying the content displayed on-screen to the file. If you have to do this, please remember to set the permissions on config.php after you copied the on-screen contents to the file. Run:
|
||||
The web installer might prompt you to create a `config.php` file in
|
||||
your librenms install location manually, copying the content displayed
|
||||
on-screen to the file. If you have to do this, please remember to set
|
||||
the permissions on config.php after you copied the on-screen contents
|
||||
to the file. Run:
|
||||
|
||||
chown librenms:librenms /opt/librenms/config.php
|
||||
|
||||
### Final steps
|
||||
```
|
||||
chown librenms:librenms /opt/librenms/config.php
|
||||
```
|
||||
|
||||
That's it! You now should be able to log in to http://librenms.example.com/. Please note that we have not covered HTTPS setup in this example, so your LibreNMS install is not secure by default. Please do not expose it to the public Internet unless you have configured HTTPS and taken appropriate web server hardening steps.
|
||||
# Final steps
|
||||
|
||||
#### Add the first device
|
||||
That's it! You now should be able to log in to
|
||||
<http://librenms.example.com/>. Please note that we have not covered
|
||||
HTTPS setup in this example, so your LibreNMS install is not secure by
|
||||
default. Please do not expose it to the public Internet unless you
|
||||
have configured HTTPS and taken appropriate web server hardening
|
||||
steps.
|
||||
|
||||
We now suggest that you add localhost as your first device from within the WebUI.
|
||||
# Add the first device
|
||||
|
||||
#### Troubleshooting
|
||||
We now suggest that you add localhost as your first device from within
|
||||
the WebUI.
|
||||
|
||||
If you ever have issues with your install, run validate.php as root in the librenms directory:
|
||||
# Troubleshooting
|
||||
|
||||
cd /opt/librenms
|
||||
./validate.php
|
||||
If you ever have issues with your install, run validate.php as root in
|
||||
the librenms directory:
|
||||
|
||||
There are various options for getting help listed on the LibreNMS web site: https://www.librenms.org/#support
|
||||
```
|
||||
cd /opt/librenms
|
||||
./validate.php
|
||||
```
|
||||
|
||||
### What next?
|
||||
There are various options for getting help listed on the LibreNMS web
|
||||
site: <https://www.librenms.org/#support>
|
||||
|
||||
Now that you've installed LibreNMS, we'd suggest that you have a read of a few other docs to get you going:
|
||||
# What next?
|
||||
|
||||
- [Performance tuning](http://docs.librenms.org/Support/Performance)
|
||||
- [Alerting](http://docs.librenms.org/Extensions/Alerting/)
|
||||
- [Device Groups](http://docs.librenms.org/Extensions/Device-Groups/)
|
||||
- [Auto discovery](http://docs.librenms.org/Extensions/Auto-Discovery/)
|
||||
Now that you've installed LibreNMS, we'd suggest that you have a read
|
||||
of a few other docs to get you going:
|
||||
|
||||
### Closing
|
||||
- [Performance tuning](http://docs.librenms.org/Support/Performance)
|
||||
- [Alerting](http://docs.librenms.org/Extensions/Alerting/)
|
||||
- [Device Groups](http://docs.librenms.org/Extensions/Device-Groups/)
|
||||
- [Auto discovery](http://docs.librenms.org/Extensions/Auto-Discovery/)
|
||||
|
||||
We hope you enjoy using LibreNMS. If you do, it would be great if you would consider opting into the stats system we have, please see [this page](http://docs.librenms.org/General/Callback-Stats-and-Privacy/) on what it is and how to enable it.
|
||||
# Closing
|
||||
|
||||
If you would like to help make LibreNMS better there are [many ways to help](http://docs.librenms.org/Support/FAQ/#what-can-i-do-to-help). You can also [back LibreNMS on Open Collective](https://t.libren.ms/donations).
|
||||
We hope you enjoy using LibreNMS. If you do, it would be great if you
|
||||
would consider opting into the stats system we have, please see [this
|
||||
page](http://docs.librenms.org/General/Callback-Stats-and-Privacy/) on
|
||||
what it is and how to enable it.
|
||||
|
||||
If you would like to help make LibreNMS better there are [many ways to
|
||||
help](http://docs.librenms.org/Support/FAQ/#what-can-i-do-to-help). You
|
||||
can also [back LibreNMS on Open
|
||||
Collective](https://t.libren.ms/donations).
|
||||
|
||||
Reference in New Issue
Block a user