Update Installation-(RHEL-CentOS).md

This commit is contained in:
bitcoredotorg
2016-03-07 08:50:38 -05:00
parent d053b5a6b2
commit 463cec398e

View File

@@ -26,8 +26,8 @@ service mariadb start
```
**CentOS 7**
(NOTE: In CentOS 7 there is only mariadb in official repo)
**MariaDB**
```bash
yum install net-snmp mariadb-server mariadb-client
@@ -67,24 +67,27 @@ FLUSH PRIVILEGES;
exit
```
Replace `<ip>` above with the IP of the server running LibreNMS. If your database is on the same server as LibreNMS, you can just use `localhost` as the IP address.
Replace `<ip>` above with the IP of the server running LibreNMS. If your database is on the same server as LibreNMS, use `localhost` as the IP address.
If you are deploying a separate database server, you need to change the `bind-address`. If your MySQL database resides on the same server as LibreNMS, you should skip this step.
Edit the mysql/mariadb configuration file:
```bash
vim /etc/my.cnf
```
vim /etc/my.cnf
Add the following lines:
Add the following line:
innodb_file_per_table=1
If you are deploying a separate database server, you also need to specify the `bind-address`. If your MySQL database resides on the same server as LibreNMS, you should skip this step.
bind-address = <ip>
Change `<ip>` to the IP address that your MySQL server should listen on.
If you see a line that starts `sql-mode` then change this to `sql-mode=""`.
Restart MySQL/MariaDB:
Save, and restart MySQL/MariaDB to apply your changes:
service mysqld restart
or
service mariadb restart
@@ -110,6 +113,13 @@ Note if not using HTTPd (Apache): RHEL requires `httpd` to be installed regardle
pear install Net_IPv4-1.3.4
pear install Net_IPv6-1.2.2b2
```
### Configure SNMPD on localhost ###
Edit `/etc/snmp/snmpd.conf` to enable self-polling. An absolute minimal config for snmpd is:
rocommunity public 127.0.0.1
You may either edit the default configuration file to your liking, or backup the default config file and replace it entirely with your own. To apply your changes, run `service snmpd restart` for Centos 6, or `systemctl restart snmpd` for Centos 7 (w/ systemd). If you have deployed a separate database server, you will likely want to configure snmpd on that host as well.
### Adding the librenms-user for Apache ###
```bash
@@ -128,16 +138,14 @@ Note if not using HTTPd (Apache): RHEL requires `httpd` to be installed regardle
Set `httpd` to start on system boot.
**CentOS 6: **
chkconfig --levels 235 httpd on
```bash
chkconfig --levels 235 httpd on
```
**CentOS 7: **
systemctl enable httpd
You need to configure snmpd appropriately if you have not already done so. An absolute minimal config for snmpd is:
rocommunity public 127.0.0.1
Adding the above line to `/etc/snmp/snmpd.conf` (or backing up the default replacing it entirely) and running `service snmpd restart` will activate this config.
**CentOS 7 (with Systemd): **
```bash
systemctl enable httpd
```
In `/etc/php.ini`, ensure `date.timezone` is set 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".
@@ -145,6 +153,7 @@ Please also ensure that `allow_url_fopen` is enabled. Other functions needed for
Next, add the following to `/etc/httpd/conf.d/librenms.conf`
If you are running Apache below version 2.2.18:
```apache
<VirtualHost *:80>
DocumentRoot /opt/librenms/html/
@@ -159,8 +168,8 @@ Next, add the following to `/etc/httpd/conf.d/librenms.conf`
</VirtualHost>
```
__Notes:__
If you are running Apache 2.2.18 or higher (true if centos 7) you will want to change `AllowEncodedSlashes` to `NoDecode` and append `Require all granted` underneath `Options FollowSymLinks MultiViews`, as shown below:
If you are running Apache 2.2.18 or higher (current version in Centos 7 official repo):
```apache
<VirtualHost *:80>
DocumentRoot /opt/librenms/html/
@@ -175,7 +184,10 @@ If you are running Apache 2.2.18 or higher (true if centos 7) you will want to c
</Directory>
</VirtualHost>
```
If the file `/etc/httpd/conf.d/welcome.conf` exists, you might want to remove that as well unless you're familiar with [Name-based Virtual Hosts](https://httpd.apache.org/docs/2.2/vhosts/name-based.html)
If the file `/etc/httpd/conf.d/welcome.conf` exists, you will want to remove that as well unless you're familiar with [Name-based Virtual Hosts](https://httpd.apache.org/docs/2.2/vhosts/name-based.html).
```bash
rn /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.bak
```
### Using Nginx and PHP-FPM ###
@@ -242,7 +254,7 @@ You can clone the repository via HTTPS or SSH. In either case, you need to ensu
```
NOTE: The recommended method of cloning a git repository is HTTPS. If you would like to clone via SSH instead, use the command `git clone git@github.com:librenms/librenms.git librenms` instead.
### Web Interface ###
### Prepare the Web Interface ###
To prepare the web interface, you'll need to create and chown a directory as well as create an Apache vhost.
@@ -254,10 +266,10 @@ First, create and chown the `rrd` directory and create the `logs` directory
chmod 775 rrd
```
> If you're planing on running rrdcached, make sure that the path is also chmod'ed to 775 and chown'ed to librenms:librenms.
If you're planing on running rrdcached, make sure that the path is also chmod'ed to 775 and chown'ed to librenms:librenms.
**SELinux**
> if you're using SELinux you need to allow web server user to write into logs directory.
> if you're using SELinux (in Centos 7 this is the defualt) you need to allow web server user to write into logs directory.
> semanage tool is a part of policycoreutils-python, so if don't have it, you can install it
> **Please note that running LibreNMS with SELinux is still experimental and we cannot guarantee that everything will be working fine for now.**
@@ -276,7 +288,7 @@ Set selinux to allow httpd to sendmail
setsebool -P httpd_can_sendmail=1
```
Start the web-server:
### Start the web-server: ###
**CentOS 6**
@@ -296,17 +308,17 @@ Start the web-server:
### Web Installer ###
At this stage you can launch the web installer by going to `http://IP/install.php` and follow the on-screen instructions. Alternatively if you want to continue the setup manually then perform the manual install steps. If you cannot reach the installer, stop here and solve that problem before proceeding. Aftewards, Add the following line to the end of `config.php`:
At this stage you can launch the web installer by going to `http://IP/install.php` and follow the on-screen instructions. Alternatively if you want to continue the setup manually then perform the manual install steps. If you cannot reach the installer, stop here and solve that problem before proceeding. Afterwards, Add the following line to the end of `config.php`:
$config['fping'] = "/usr/sbin/fping";
### Manual Install ###
You may skip this section if the web installer succedded.
You may skip this section if the web installer succeeded.
```bash
cp config.php.default config.php
vim config.php
vi config.php
```
Change the values to the right of the equal sign for lines beginning with `$config[db_]` to match your database information as previously configured.
@@ -317,15 +329,15 @@ Add the following line to the end of `config.php`:
$config['fping'] = "/usr/sbin/fping";
Important: Be sure you have no characters (including whitespace like: newlines, spaces, tabs, etc) outside of the `<?php?>` blocks. Your graphs will break otherwise.
Important: Be sure you have no characters (including whitespace like: newlines, spaces, tabs, etc) outside of the `<?php?>` blocks. Your graphs will break otherwise and there will be no error messages to indicate otherwise!
** Initialise the database **
**Initialize the database**
Initiate the follow database with the following command:
php build-base.php
** Create admin user **
**Create admin user**
Create the admin user - priv should be 10