Mod_security whitelist rule for accounts: Cpanel

Check the account include path from httpd.conf file. It will be /usr/local/apache/conf/userdata/std/2/username/domain.com/ or /usr/local/apache/conf/userdata/std/2_2/username/domain.com/ mkdir -p /usr/local/apache/conf/userdata/std/2_2/username/domain.com/ cd   /usr/local/apache/conf/userdata/std/2_2/username/domain.com/ vi modsec.conf Add the below mentioned line: <IfModule mod_security2.c> SecRuleRemoveById <Rule ID> </IfModule> or <LocationMatch .*> SecRuleRemoveById <Rule ID> </LocationMatch> If we need to completely disable mod_security for a particular account add the below rules….

Install Cassandra on a VPS

Install Casandra on a VPS —————– 1. ssh to server 2. mkdir ~/temp 3. cd ~/temp installing and configuring Java ——————————– 4. Download Java from http://java.com/en/download/linux_manual.jsp 5. upload it to server /root/tmp 6. tar -xvf jre-* 7. mkdir /usr/local/java 8. mv jre-* /usr/local/java To make it the default Java VM on your VPS, add these…

How to add a server in Nagios server?

##########From the nagios Server########### 1. Make a directory in /usr/local/nagios/etc/objects/ with client’s name cd /usr/local/nagios/etc/objects/ mkdir myserver 2.Make the host.cfg file as host_name.cfg where host_name is the hostname of the server vi server.example.com.cfg and add the below mentioned lines according to the requirement (or you can simpley copy any other .cfg file of previously added…

cPanel script to enable SPF and DKIM

cPanel script to enable SPF via commandline: # /usr/local/cpanel/bin/spf_installer $username cPanel script to enable DKIM via commandline: # /usr/local/cpanel/bin/dkim_keys_install $username Replace $username with the actual cPanel username. cPanel script to enable SPF and DKIM for all cPanel accounts: for username in `ls -A /var/cpanel/users` ; do /usr/local/cpanel/bin/dkim_keys_install $username && /usr/local/cpanel/bin/spf_installer $username ; done

Installing SVN server on cPanel server

1. Download cPanelSVNManager and installl it. ==================================== cd /usr/local/src/ wget http://technicalnotebook.com/wiki/download/attachments/3473493/cPanelSVNManager_0.3.zip unzip cPanelSVNManager_0.3.zip cd cPanelSVNManager_0.3 sh install.sh This will install the latest version of the SVN and add necessary modules to Apache ( DAV etc ) Add the below mentioned modules in the /usr/local/apache/conf/includes/pre_main_global.conf. LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so Restart Apache and check the…

How to Add a User and Grant Root Privileges on CentOS

1. Login as root and add the user —————————— # adduser mynewuser # passwd mynewuser 2. Grant Root Privileges to the User ——————————— visudo command opens the /etc/sudoers file with the “vi” text editor # visudo add the below mentioned line and save. mynewuser ALL=(ALL) ALL 3. Configure SSH (OPTIONAL) ————————- Disable root login #…

How To Set Up Apache Virtual Hosts on CentOS 7

Step One — Create the Directory Structure —————————————– # mkdir -p /var/www/example.com/public_html Step Two — Grant Permissions —————————— # chown -R $USER:$USER /var/www/example.com/public_html # chown -R $USER:$USER /var/www/example2.com/public_html # chmod -R 755 /var/www Step Three — Create Demo Pages for Each Virtual Host —————————————————- # vi /var/www/example.com/public_html/index.html ——————– <html> <head> <title>Welcome to Example.com!</title> </head> <body>…

Intro to Inode

Inode (Index node) ============== What is inode? Simply, an inode is a data structure that keeps track of all the information about a file except the file contents and the file name. Each inode is identified by a unique inode number within the file system. Inode is also know as index number. Whenever a user…

How to Add Linux Host to Nagios Monitoring Server Using NRPE Plugin

We have already having Nagios installed and running properly. Now you can proceed further to install NRPE agent on your Remote Linux host. What is NRPE? ============== The NRPE (Nagios Remote Plugin Executor) plugin allows you to monitor any remote Linux/Unix services or network devices. This NRPE add-on allows Nagios to monitor any local resources…

NAGIOS Installation on Redhat servers.

Nagios is the most popular, open source, powerful monitoring system. It has capability of monitoring application, services, entire IT infrastructure.With Nagios, you can monitor your remote hosts and their services remotely on a single window. It shows warnings and indicates if something goes wrong in your servers which eventually helps us to detect some problems…

RAID CHECK

RAIDs which we are mainly using, 3ware, Adaptec and LSI Megaraid Detecting RAID Hardware: (Use the below commands from the linux shell) root@techs [~]# dmesg | grep -iE “3ware|Adaptec|LSI” OR root@techs [~]# lspci | grep -i RAID OR root@techs [~]# dmesg | grep scsi0 LSI MegaRAID ============ 1. Download the archive from the below link:…

Apache-Optimization: KeepAlive

Apache is the most widely used web server on the Internet. Optimizing Apache is always a balancing act. It’s a case of sacrificing one resource in order to obtain savings in another. What is TimeOut? =============== The TimeOut directive currently defines the amount of time Apache will wait for three things: The total amount of…