Started getting the following error while running ./validate.php for LibreNMS
Cannot load Zend OPcache - it was already loaded
Looks like the problem arises out of PHP trying to load two ini files for OPcache. Was trying to enable OPcache for LibreNMS so I created an opcache.ini file and put the settings in it. I missed the default 10-opcache.ini file.
Moving all the settings into the 10-opcache.ini file and deleting the created opcache.ini file resolved the issue for me.
sudo ufw status numbered
Status: active
To Action From -- ------ ----
[1] 3478/udp ALLOW IN Anywhere
[2] 5514/udp ALLOW IN Anywhere
[3] 8080/tcp ALLOW IN Anywhere
[4] 8443/tcp ALLOW IN Anywhere
[5] 8880/tcp ALLOW IN Anywhere
[6] 8843/tcp ALLOW IN Anywhere
[7] 6789/tcp ALLOW IN Anywhere
[8] 27117/tcp ALLOW IN Anywhere
[9] 22/tcp ALLOW IN Anywhere
Delete rule
You need to know the number of the rule you want to delete. Replace number with the number of the rule from the status command
sudo ufw delete number
Reset rules
sudo ufw reset
Allow access to port from specific IP address
Example command allows access to SSH (port 22) from the 172.16.0.0/12 ip range.
sudo ufw allow proto tcp from 172.16.0.0/12 to any port 22
One note: It appears that you need to run the rule with every IP range you want to allow.
Allow access to port from all private IP ranges (RFC 1918)
If we wanted to allow SSH (port 22) from all local IP addresses, we would need to run the following three commands.
sudo ufw allow proto tcp from 10.0.0.0/8 to any port 22
sudo ufw allow proto tcp from 172.16.0.0/12 to any port 22
sudo ufw allow proto tcp from 192.168.0.0/16 to any port 22
Save and exit. Now when the system reboots it should automatically mount the drive. You should also be able to call “mount -a” to automatically mount everything in fstab.
Screen is a handy tool that can help you run scripts on servers remotely without having to worry about the session getting terminated. It seems to operate kinda like a virtual console.
Create Screen Session
Create a new session with a specified name
screen -S SessionName
Example output below. Create session named testsession and print screen sessions.
[bob@localhost imapsync]$ screen -S testsession
[bob@localhost imapsync]$ screen -ls
There are screens on:
3313.testsession (Attached)
1 Sockets in /var/run/screen/S-bob.
[bob@localhost imapsync]$
Disconnect from Screen Session
You can disconnect from a screen session by hitting ctrl + a and then ctrl +d
“ctrl + a” then “ctrl + d”
List Screen Sessions
You can list the screen sessions with
screen -ls
Example
[bob@localhost imapsync]$ screen -ls
There are screens on:
3212.testsession (Detached)
2556.xap (Detached)
2 Sockets in /var/run/screen/S-bob.
[bob@localhost imapsync]$
Connect to screen Session
You can reconnect to a screen session with
screen -r testsession
Terminate Screen Session
To terminate a screen session, connect to that session and then on a clear line hit ctrl + d
Same way as if you were closing a remote ssh connection.