Wednesday, October 31, 2012

What is cPanel & Plesk...

cPanel
========
cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides capabilities for administrators, resellers, and end-user website owners to control the various aspects of website and server administration through a standard web browser.

In addition to the GUI interface, cPanel also has command line and API-based access that allows third party software vendors, web hosting organizations, and developers to automate standard system administration processes.

cPanel is designed to function either as a dedicated server or virtual private server. The latest cPanel version supports installation on CentOS, Red Hat Enterprise Linux (RHEL), and CloudLinux.cPanel 11.34 is the last major version to support FreeBSD.
Application-based support includes Apache, PHP, MySQL, PostgreSQL, Perl, and BIND (DNS). Email based support includes POP3,IMAP, SMTP services. cPanel is commonly accessed on port 2082, with an SSL-secured server operating on port 2083.
Once installed, cPanel cannot be removed (without extreme difficulty). The server must be formatted, and the operating system reinstalled. Similarly, it should only be installed on a freshly installed operating system with minimal prior configuration.

WHM(WebHost Manager)
====================
WebHost Manager (WHM) is a web-based tool used by server administrators and resellers to manage hosting accounts on a web server. WHM listens on ports 2086 and 2087 by default.
As well as being accessible by the root administrator, WHM is also accessible to users with reseller privileges. Reseller users of cPanel have a smaller set of features than the root user, generally limited by the server administrator, to features which they determine will affect their customers' accounts rather than the server as a whole. From WHM, the server administrator can perform maintenance operations such as compile Apache and upgrade RPMs installed on the system.


       WHM Login




 WHM Home
   
cPanel User Login 


     
Plesk
===== 
The Parallels Plesk Panel (ex: Parallels Plesk Control Panel, Plesk Server Administrator, PSA, or just Plesk) software package is a commercial web hosting automation program. Originally released under the U.S. company Plesk Inc. and designed in Novosibirsk, Russia, Plesk was acquired by SWSoft in July 2003.SWSoft renamed themselves under the Parallels name (a brand which had been acquired by SWSoft) in 2008.

Parallels Plesk Panel allows a server administrator to set up new websites, reseller accounts, email accounts, and DNS entries through a web-based interface. The administrator can create client and site templates, which predetermine resource-allocation parameters for the domains and/or clients.



Parallels Plesk Panel for Linux/Unix supports multiple POSIX platforms, including Debian, Fedora, FreeBSD, Red Hat Linux, SUSE and Ubuntu. Parallels Plesk Panel for Windows supports Windows Server 2003 and Windows Server 2008 operating systems.

Parallels Plesk Panel installs custom versions of or manages versions of MySQL and PostgreSQL databases (Microsoft SQL Server and Microsoft SQL Server Desktop Engine under Windows), Apache Tomcat Java platform server, and ColdFusion server. The latest plesk panel is 11.


Plesk Login 



Plesk Home 



===========================================

Tuesday, October 30, 2012

Install and Configure Fail2Ban on Centos | RedHat

Fail2ban scans log files (e.g. /var/log/apache/error_log) and bans IPs that show the malicious signs -- too many password failures, seeking for exploits, etc. Generally Fail2Ban then used to update firewall rules to reject the IP addresses for a specified amount of time, although any arbitrary other action (e.g. sending an email, or ejecting CD-ROM tray) could also be configured. Out of the box Fail2Ban comes with filters for various services (apache, courier, ssh, etc).

Steps
===========================================
1. wget http://superb-west.dl.sourceforge.net/sourceforge/fail2ban/fail2ban-0.8.1.tar.bz2
2. tar -xjvf fail2ban-0.8.1.tar.bz2
3. cd fail2ban-0.8.1
4. python setup.py install
5. vi /etc/fail2ban/jail.conf


Enable only the sections you need and do them one at a time. We enable SSH and ProFTP (both use /var/log/secure) as well as Postfix.
Set your local networks and any other networks you consider 'safe'. You certainly don't want to block your own clients!
ignoreip = 127.0.0.1 192.245.12.0/24 207.182.32.0/19 204.27.149.0/24

Startup

cp files/redhat-initd /etc/init.d/fail2ban
chkconfig --add fail2ban
chkconfig fail2ban on
service fail2ban start

Tools

Show failed SSH logins by date:
cat /var/log/secure* | grep 'Failed password' | grep sshd | awk '{print $1,$2}' | sort | uniq -c
Search for correct log file:
grep such /var/log/messages*
grep ftp /var/log/messages*
grep -r NOQUEUE /var/log
This should match Postfix bans:
grep rejected /var/log/maillog

Configuration

Adjust the following sample configuration files to your needs.


# Fail2Ban jail.local configuration file
################################################
# www.sonoracomm.com
#
# The DEFAULT allows a global definition of the options. They can be overridden
# in each jail afterwards.
[DEFAULT]
# ignore our IP ranges
ignoreip = 127.0.0.1 192.245.12.0/24 207.182.32.0/19 204.27.149.0/24
# "bantime" is the number of seconds that a host is banned.
bantime = 600
# A host is banned if it has generated "maxretry" during the last "findtime"
# seconds.
findtime = 600
# "maxretry" is the number of failures before a host get banned.
maxretry = 3
# Don't know how well other backend options work.
backend = polling
[ssh-iptables]
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
sendmail-whois[name=SSH, dest=
fail2ban@sonoracomm.com, sender=
www@sonoracomm.com]
logpath = /var/log/secure
maxretry = 3
[proftpd-iptables]
enabled = true
filter = proftpd
action = iptables[name=ProFTPD, port=ftp, protocol=tcp]
sendmail-whois[name=ProFTPD, dest=fail2ban@sonoracomm.com, sender=
www@sonoracomm.com]
logpath = /var/log/secure
maxretry = 3
[postfix]
enabled = true
filter = postfix
action = iptables[name=Postfix, port=smtp, protocol=tcp]
sendmail-whois[name=Postfix, dest=fail2ban@sonoracomm.com, sender=
www@sonoracomm.com]
logpath = /var/log/maillog
maxretry = 5

# Fail2Ban filter.d/postfix.local configuration file
################################################
# www.sonoracomm.com
#
[Definition]
failregex = reject: RCPT from (.*)\[\]: 554
reject: RCPT from (.*)\[\]: 550
reject: RCPT from (.*)\[\]: 450
ignoreregex =

# Fail2Ban action.d/sendmail-whois.local configuration file
################################################
# www.sonoracomm.com
#
[Definition]
actionstart = echo -en "Subject: [Fail2Ban] : started
From: Fail2Ban <>
To: \n
Hi,\n
The jail has been started successfully.\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f
actionstop = echo -en "Subject: [Fail2Ban] : stopped
From: Fail2Ban <>
To: \n
Hi,\n
The jail has been stopped.\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f
actioncheck =
actionban = echo -en "Subject: [Fail2Ban] : banned
From: Fail2Ban <>
To: \n
Hi,\n
The IP has just been banned by Fail2Ban after
attempts against .\n\n
Here are more information about :\n
`/usr/bin/dig -x `\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f
actionunban =
[Init]
name = default
dest = root
sender = fail2ban
===========================================================