Skip to content

Instantly share code, notes, and snippets.

View rothkj1022's full-sized avatar

Kevin Roth rothkj1022

View GitHub Profile

Disallow Direct IP Browsing on WHM/cPanel Servers

Last Updated 2022-09-07 by Kevin Roth

Some Linux web servers are browsable by direct IP. This can be disabled for security purposes.

Modify Apache main default template

  1. Create custom Apache main defaults template

Rkhunter (Rootkit Hunter) Installation and Monitoring for Linux.md

Last Updated 2020-04-13 by Kevin Roth

Detection of rootkit and other intrusions for Linux with rkhunter. Installation and nightly email reports.

Install rkhunter

$ sudo yum install rkhunter
@rothkj1022
rothkj1022 / pandora-ads-blocklist
Last active July 4, 2019 17:06
Public blocklist for Pandora ads for use with PiHole
# Sourced from https://www.reddit.com/r/pihole/comments/92u4ax/pandora_radio_ads_block/
t1-1.p-cdn.us
t2-1.p-cdn.us
t2-5.p-cdn.us
t1-3.p-cdn.us
t2-2.p-cdn.us
t2-4.p-cdn.us
t1-2.p-cdn.us
t2-3.p-cdn.us
t1-4.p-cdn.us
@rothkj1022
rothkj1022 / WHM cPanel Config Files Backup Instructions.md
Last active November 24, 2020 23:23
Instructions to mirror important config files to backup folder that can be backed up remotely.

WHM/cPanel Config Files Backup Instructions

Last Updated 2019-06-18 by Kevin Roth

Mirror the current configuration files on the server to the backup folder in order to make remote backups of the system configuration. See this link for source of backup folders and files.

Make directories

# mkdir -p /backup/config/etc/cpanel/ea4
# mkdir -p /backup/config/etc/csf
@rothkj1022
rothkj1022 / mysql_check.sh
Created April 10, 2019 17:05
Script for checking and repairing MySQL databases & tables, including corrupted InnoDB tables
#!/bin/bash
# set mysql into innodb recovery mode on startup
mode=1; sed -i "/^\[mysqld\]/{N;s/$/\ninnodb_force_recovery=$mode/}" /etc/my.cnf
# restart mysql
systemctl restart mysqld
# remove recovery mode setting
sed -i '/innodb_force_recovery/d' /etc/my.cnf
@rothkj1022
rothkj1022 / Change MySQL root password on CentOS Web Panel.md
Last active June 16, 2023 08:11
Process for changing MySQL root password on CentOS Web Panel from command line

Process for changing MySQL root password on CentOS Web Panel from command line

Run CWP's script to reset password

$ sudo sh /usr/local/cwpsrv/htdocs/resources/scripts/mysql_pwd_reset

** Make note of the new password provided by the script

Change SSH Port on CentOS 7

Back up sshd_config

$ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

Edit config to change port and disallow password auth

@rothkj1022
rothkj1022 / Install wkhtmltopdf on CentOS 7.md
Last active April 10, 2019 17:38
Procedure for installing and testing wkhtmltopdf on CentOS 7

Install wkhtmltopdf on CentOS 7

Download

$ wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm

Install

@rothkj1022
rothkj1022 / CWP Config Files Backup Instructions.md
Last active May 20, 2019 15:51
CWP Config Files Backup Instructions

CWP Config Files Backup

Last Updated 2019-02-22 by Kevin Roth

Set up hard links and mounted folders in order to make remote backups of the system configuration.

Make directories

$ mkdir /backup/config