You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Install-Under-RHEL-Compatible_LAMP.md
+55-27Lines changed: 55 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
# Installing on CentOS/RHEL/ROCKY
1
+
# Installing on CentOS/RHEL/Rocky Linux/AlmaLinux
2
+
3
+
> **Note:** CentOS Linux reached end-of-life on June 30, 2024 (CentOS 7) and December 31, 2021 (CentOS 8). New installations should use [Rocky Linux](https://rockylinux.org/) or [AlmaLinux](https://almalinux.org/), which are binary-compatible RHEL rebuilds. The commands in this guide apply to both.
2
4
3
5
> **Note**: As of Cacti 1.2.31, PHP 8.1 is required and PHP Composer is required.
4
6
> Composer will be used to ensure all of the libraries are installed and are up to date.
@@ -7,7 +9,7 @@
7
9
8
10
### Web Server (Apache)
9
11
10
-
1. For Centos/RHEL/ROCKY 8+
12
+
1. For RHEL/Rocky Linux/AlmaLinux 8+
11
13
12
14
```console
13
15
dnf module reset php
@@ -47,13 +49,13 @@ Daemon to rebuild the Cache or you may receive a HTTP 500 Error
47
49
systemctl restart php-fpm
48
50
```
49
51
50
-
2.Install Apache
52
+
2.Install Apache
51
53
52
54
```console
53
-
yum install -y httpd
55
+
dnf install -y httpd
54
56
```
55
57
56
-
3.Enable and start the service to ensure it starts when the system reboots
58
+
3.Enable and start the service to ensure it starts when the system reboots
57
59
58
60
```console
59
61
systemctl start httpd
@@ -156,7 +158,7 @@ bridged.
156
158
1. Install MySQL server
157
159
158
160
```console
159
-
yum install -y mysql mysql-server
161
+
dnf install -y mysql mysql-server
160
162
```
161
163
162
164
2. Enable and start the service to ensure it starts when the system reboots
@@ -171,7 +173,7 @@ bridged.
171
173
1. Install MariaDB server
172
174
173
175
```console
174
-
yum install -y MariaDB-server MariaDB-client
176
+
dnf install -y MariaDB-server MariaDB-client
175
177
```
176
178
177
179
2. Enable and start the service to ensure it starts when the system reboots
@@ -211,13 +213,10 @@ during the installation.
211
213
[mysqld]
212
214
character-set-server=utf8mb4
213
215
collation-server=utf8mb4_unicode_ci
214
-
innodb_file_format = Barracuda
215
216
max_allowed_packet = 16777777
216
217
join_buffer_size = 32M
217
218
innodb_file_per_table = ON
218
-
innodb_large_prefix = 1
219
219
innodb_buffer_pool_size = 250M
220
-
innodb_additional_mem_pool_size = 90M
221
220
innodb_flush_log_at_trx_commit = 2
222
221
log-error = /var/log/mysql/mysql-error.log
223
222
log-queries-not-using-indexes = 1
@@ -308,7 +307,7 @@ PHP and various packages are all required by Cacti for successful operation
@@ -478,31 +482,56 @@ configure the basics for Cacti.
478
482
479
483
### Security Enhanced Linux (SELinux)
480
484
481
-
If you are having issues to access the web page, disable SELinux temporarily to
482
-
prove that the issues come from the SELinux policy. It is NOT recommended to
483
-
disable SELinux permanently.
485
+
If you suspect SELinux is blocking Cacti, disable it temporarily to confirm, then re-enable it and apply the correct policy rather than leaving it disabled.
484
486
485
-
[CentOS](https:////wiki.centos.org/es/HowTos/SELinux) has a lot of
486
-
documentation on how to make your SELinux policy right.
487
+
The [RHEL SELinux documentation](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/using_selinux/) covers policy management in depth and applies equally to Rocky Linux and AlmaLinux.
487
488
488
489
1. Check SELinux status
489
490
490
491
```console
491
492
getenforce
492
493
```
493
494
494
-
2. Disable SELinux temporarily
495
+
2. Disable SELinux temporarily for testing
495
496
496
497
```console
497
498
setenforce 0
498
499
```
499
500
500
-
3.Enable SELinux back
501
+
3.Re-enable SELinux
501
502
502
503
```console
503
504
setenforce 1
504
505
```
505
506
507
+
4. Configure SELinux booleans for Cacti
508
+
509
+
Cacti requires two booleans so Apache can reach the database and make outbound SNMP connections during polling:
510
+
511
+
```console
512
+
setsebool -P httpd_can_network_connect 1
513
+
setsebool -P httpd_can_network_connect_db 1
514
+
```
515
+
516
+
5. Set file contexts (only needed if Cacti is outside `/var/www/html`)
517
+
518
+
If you installed Cacti to a non-default path, apply the correct SELinux file contexts. The `semanage` command is provided by `policycoreutils-python-utils`; install it first if not already present:
519
+
520
+
```console
521
+
dnf install -y policycoreutils-python-utils
522
+
```
523
+
524
+
Replace `/path/to/cacti` with your actual install path:
525
+
526
+
```console
527
+
semanage fcontext -a -t httpd_sys_content_t "/path/to/cacti(/.*)?"
528
+
semanage fcontext -a -t httpd_sys_rw_content_t "/path/to/cacti/rra(/.*)?"
529
+
semanage fcontext -a -t httpd_sys_rw_content_t "/path/to/cacti/log(/.*)?"
530
+
restorecon -Rv /path/to/cacti
531
+
```
532
+
533
+
These labels grant Apache read access to Cacti's files and write access to the RRD and log directories. Without `httpd_sys_rw_content_t` on `rra/` and `log/`, graph generation silently fails even when UNIX permissions appear correct.
534
+
506
535
### Considerations when using Proxies in front of Cacti (Cacti 1.2.23+)
507
536
508
537
For optimal security, only specify the HTTP headers that are set by your proxy
@@ -536,8 +565,7 @@ These can be set by editing the following section of config.php
536
565
$proxy_headers = null;
537
566
```
538
567
539
-
**Note:** If you installed Cacti out of `/var/www/html` make sure you fix up
540
-
all SELinux context and permissions.
568
+
**Note:** If you installed Cacti outside `/var/www/html`, run the `semanage fcontext` and `restorecon` commands from step 5 of the SELinux section above to apply the correct file contexts.
0 commit comments