How to Install cpanel and whm on Linux / RHEL / CentOS / Fedora / Ubuntu


The first thing you need to do is login as root and then disable SELinux. Just type /etc/selinux/config or use editor to edit it and make sure the following values exist in the file:

SELINUX=disabled
SELINUXTYPE=targeted

Now we have to enable port 2086 by type this in terminal:
sudo iptables -I INPUT -p tcp --dport 2086 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 2087 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo service iptables save


STEP 1
cd /home | wget -N http://httpupdate.cpanel.net/latest

The above command will download the installer in your home directory. Now lets run the installer:

STEP 2
sh latest

The Step 2 will initiate the installation process which takes approximately 2 hours, depending on your server’s speed. Once it finishes, you need to active your cPanel/WHM application:

STEP 3
/usr/local/cpanel/cpkeyclt

CentOS SSH Installation And Configuration (Linux)

How do I install and configure ssh server and client under CentOS Linux operating systems?

You need to install the following packages (which are installed by default until and unless you removed it or skipped it while installing CentOS)
  • openssh-clients : The OpenSSH client applications
  • openssh-server : The OpenSSH server daemon

OpenSSH Installations under CentOS Linux

To install the server and client type:
# yum -y install openssh-server openssh-clients
Start the service:
# chkconfig sshd on
# service sshd start

Make sure port 22 is opened:
# netstat -tulpn | grep :22

Firewall Settings

Edit /etc/sysconfig/iptables (IPv4 firewall),
# vi /etc/sysconfig/iptables
Add the line
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
If you want to restict access to 192.168.1.0/24, edit it as follows:
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT
If your site uses IPv6, and you are editing ip6tables, use the line:
-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 22 -j ACCEPT
Save and close the file. Restart iptables:
# service iptables restart

OpenSSH Server Configuration

Edit /etc/ssh/sshd_config, enter:
# vi /etc/ssh/sshd_config
To disable root logins, edit or add as follows:
PermitRootLogin no
Restrict login to user tom and jerry only over ssh:
AllowUsers tom jerry
Change ssh port i.e. run it on a non-standard port like 1235
Port 1235
Save and close the file. Restart sshd:
# service sshd restart

Install Linux / RHEL / CentOS / Fedora / Ubuntu  using USB

 

Download UNetbootin (Windows, Linux, Mac)

 

Introduction

UNetbootin allows you to create bootable Live USB drives for Ubuntu, Fedora, and other Linux distributions without burning a CD. It runs on Windows, Linux, and Mac OS X. You can either let UNetbootin download one of the many distributions supported out-of-the-box for you, or supply your own Linux .iso file if you've already downloaded one or your preferred distribution isn't on the list.

Requirements

  • Microsoft Windows 2000/XP/Vista/7, or Linux, or Mac OS X 10.5+. Note that resulting USB drives are bootable only on PCs (not on Macs).
  • Internet access for downloading a distro to install, or a pre-downloaded ISO file

Features

UNetbootin can create a bootable Live USB drive, or it can make a "frugal install" on your local hard disk if you don't have a USB drive. It loads distributions either by downloading a ISO (CD image) files for you, or by using an ISO file you've already downloaded. 

screenshot
The current version has built-in support for automatically downloading and loading the following distributions, though installing other distributions is also supported:

UNetbootin can also be used to load various system utilities, including:

Installation & Screenshots

  1. If using Windows, run the file, select an ISO file or a distribution to download, select a target drive (USB Drive or Hard Disk), then reboot once done. If your USB drive doesn't show up, reformat it as FAT32.

    screenshot
  2. If using Linux, make the file executable (using either the command chmod +x ./unetbootin-linux, or going to Properties->Permissions and checking "Execute"), then start the application, you will be prompted for your password to grant the application administrative rights, then the main dialog will appear, where you select a distribution and install target (USB Drive or Hard Disk), then reboot when prompted. 

    screenshot

    screenshot
  3. After rebooting, if you created a Live USB drive by selecting "USB Drive" as your install target, press the appropriate button (usually F1, F2, F12, ESC, or backspace) while your computer is starting up to get to your BIOS boot menu and select USB drive as the startup target; otherwise if there's no boot selection option, go to the BIOS setup menu and change the startup order to boot USB by default. Note that Live USB drives are bootable only on PCs (not on Macs). Otherwise, if you did a "frugal install" by selecting "Hard Disk" as your install target, select the UNetbootin entry from the Windows Boot Menu as the system boots up.

Removal Instructions (Applicable only to Hard Disk / "frugal installs")

If using Windows, UNetbootin should prompt you to remove it the next time you boot into Windows. Alternatively, you can remove it via Add/Remove Programs in the Control Panel.
If using Linux, re-run the UNetbootin executable (with root priveledges), and press OK when prompted to uninstall.
Removal is only required if you used the "Hard Drive" installation mode; to remove the bootloader from a USB drive, back up its contents and reformat it.
Uninstalling UNetbootin simply removes the UNetbootin entry from your boot menu; if you installed an operating system to a partition using UNetbootin, removing UNetbootin will not remove the OS.
To manually remove a Linux installation, you will have to restore the Windows bootloader using "fixmbr" from a recovery CD, and use Parted Magic to delete the Linux partition and expand the Windows partition.

Installing Other Distributions Using UNetbootin

Download and run UNetbootin, then select the "disk image" option and supply it with an ISO (CD image).

screenshot

Email Accounts (Linux / RHEL / CentOS / Fedora)

For cPanel version 11.30

Add an email address

To add a new email address:
  1. Type the email address to be created in the Email field.
    • If you manage more than one domain, make sure to select the appropriate domain from the pull-down menu.
  2. Type the password in the Password field.
  3. Retype the password in the Password (again) field.
    • You can click the Password Generator link to have a strong password generated for you. For more information, read our Password Generator documentation.
  4. Type the quota in the Mailbox Quota field.
    • The quota defines how much hard drive space the account will be allowed to use.
    • PICK Important: Due to mail server constraints, quotas cannot be greater than 2048 MB. Quotas exceeding this amount must be unlimited.
  5. Click Create Account.
Existing addresses are displayed in a table. Using this table, it is possible to:
  • See how much disk space the account uses.
  • Change a password.
  • Change a quota limit.
  • Delete an email address.
  • Access an account through webmail.
  • Configure a mail client.

Change the password

A secure password is one that contains no dictionary words and includes upper- and lower-case letters, numbers, and symbols.
To change the password:
  1. Click Change Password next to the appropriate email account.
  2. Type your new password into the Password box.
  3. Confirm your new password in the Password (again) box.
    • You can click the Password Generator link to have a strong password generated for you. For more information, read our Password Generator documentation.
  4. Click Change Password to store the new password.
    • If you do not wish to change the password, click cancel.

Change the quota limit

The quota limit for an address defines the amount of mail (in Megabytes) that can be stored to its mailbox. Once this limit is exceeded, any incoming mail will be returned to the sender with a message stating that the recipient’s mailbox is full.
Since a full quota will prevent you from receiving mail, it is important to keep track of quota usage.
note Note: Your mailbox's trash folder is not included in the quota limit calculation.
note Note: You will not be able to exceed the quota set by your web host. Also, due to mail server constraints, you cannot set a quota greater than 2048 MB. Quotas exceeding this amount must be unlimited.
To change a mail quota:
  1. Click Change Quota.
  2. Type the new email quota (in Megabytes) into the appropriate field. For an unlimited account, click unlimited.
  3. Click Change Quota to store the new value.
    • If you do not wish to change the quota, click cancel.

Delete an email address

To delete an email address:
  1. Click the Delete link corresponding to the account you wish to remove.
  2. Confirm that you wish to delete the address by clicking Delete.
    • If you wish to keep the email address, click cancel.

Configure an email client

This feature will automatically configure your email client to access your cPanel email address(es). An email client allows you to access your email account from an application on your computer. Outlook® Express and Apple® Mail are examples of email clients. To access this feature, click the More button corresponding to the appropriate email account.
note Note: You must already have an email client installed on your computer in order to automatically configure it using cPanel.
To configure your mail client:
  1. Select and download the appropriate configuration file from the list.
  2. Run the script file to automatically configure a mail client for the selected address.
When completed properly, your email client should open automatically and log into your email account(s).
note Note: If you wish to use an email client that is not listed in this interface, you will need to manually configure it. For more information on manually configuring an email client, review the documentation of the client you wish to use. Documentation can generally be found on the client's website.

Access Webmail

This feature allows you to access an email account using a web browser. To access this feature:

  1. Click the More button corresponding to the appropriate email account.
  2. Select the Access Webmail option from the resulting menu.
  3. Enter the password in the appropriate field.
  4. Click the Log in button.

Default email account

Your default email address is listed under the Default Email Account heading. This is a special email account set up when your cPanel account is created by your web host. The account's username and password are the same as your cPanel account name and password.
Depending upon your web host's setup, this address may serve as a "catch-all" for all mail sent to invalid usernames in your domain. As such, it may receive a large amount of spam.
You can check and delete the mail received by this account. To do this via webmail, click Access Webmail.
The default address cannot be deleted or renamed, and it has no quota. It cannot be used for sending email. For this reason, we recommend creating an email account for daily use.

BlackBerry® FastMailService

BlackBerry FastMail is a service that is available to cPanel 11.25 systems (and later) that use the Dovecot mail server. This service allows you to receive passive email updates on your BlackBerry device. This means that when you receive a new message in your inbox, your BlackBerry device will receive it almost simultaneously.
When FastMail is enabled, Dovecot and the server's operating system are automatically configured to improve the performance of the IMAP IDLE command. The IMAP IDLE command is the method by which you receive passive email updates.
note Note: If you configured your BlackBerry device before the release of BIS 2.6 or cPanel 11.25, you will need to complete the device setup again to realize the performance increase.

Direct access to sent and spam mail folders

You can configure your mobile device to open mail from your sent folder (or spam folder) directly in your inbox. Simply configure the device to log into email using your email address, plus /sent or /spam, as the username (for example, user@example.com/sent).

BlackBerry Level 3 Integration

If Research in Motion (RIM) recognizes you as a Mail Service Provider (MSP), this server can answer subscription requests at the following URLs:

  • https://mail.example.com:2096/rim-bis/v1
  • https://webmail.example.com/rim-bis/v1
note Note: For security reasons, you can only access these URLs through a server that is currently running BIS.
PICK Remember: In the examples above, example.com is meant to stand for your domain.

Init Script for Apache Tomcat (Linux / RHEL / CentOS / Fedora)

Init script for Apache Tomcat

Written by Adam Sharp
Based (heavily) on script found at http://tldp.org/HOWTO/MMBase-Inst-HOWTO/x321.html.

Description

This is an init script for Apache Tomcat, tested for use on Amazon Linux AMI, and should work on CentOS and other RPM based systems such as Red Hat.
Besides configuration changes, the main change I've made from the source script was to use catalina.sh start and catalina.sh stop instead of startup.sh and shutdown.sh, respectively. I also set the CATALINA_PID variable so that catalina.sh would correctly create the PID file, and service tomcat status would correctly report whether tomcat is running. (Previously would get errors such as "tomcat dead but subsys locked").

Installation

To install the script as-is, assuming you have Tomcat v6.0.33 installed at /usr/local/apache-tomcat-6.0.33 and the java executable located at /usr:
  1. Copy the tomcat script to /etc/init.d
  2. Run sudo chkconfig --add /etc/init.d/tomcat
  3. Run sudo service tomcat start
Configuration you may need to perform first:
  • Alter the chkconfig: line (line 12) to reflect your desired runlevels and start/stop priority:
            runlevels   stop priority  # lower numbers stop sooner
                  |       |
    # chkconfig: 2345 80 20
                      |
                   start priority   # higher numbers start sooner
    
    You must do this before you run step 2. If you have already completed step to, just run the command again.
    See man chkconfig for more info.
  • Edit JAVA_HOME, CATALINA_HOME and any other relevant environment variables for the Tomcat service (lines 35--39). Available environment variables are listed at the top of catalina.sh, with helpful descriptions.
  • If you know what you're doing: Edit the SERVICENAME, LOCKFILE and CATALINA_PID variables (lines 26--28) as necessary for other Linux systems.

Usage

Once installed, the following commands are available:
$ sudo service tomcat start  # startup
Starting Tomcat:
Using CATALINA_BASE:   /usr/local/apache-tomcat-6.0.33
Using CATALINA_HOME:   /usr/local/apache-tomcat-6.0.33
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.33/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/apache-tomcat-6.0.33/bin/bootstrap.jar
Using CATALINA_PID:    /var/run/tomcat6.pid

$ service tomcat status
tomcat6 (pid  1234) is running...

$ sudo service tomcat stop   # shutdown
Shutting down Tomcat:
Using CATALINA_BASE:   /usr/local/apache-tomcat-6.0.33
Using CATALINA_HOME:   /usr/local/apache-tomcat-6.0.33
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.33/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/apache-tomcat-6.0.33/bin/bootstrap.jar
Using CATALINA_PID:    /var/run/tomcat6.pid

$ service tomcat status
tomcat6 is stopped

$ sudo service tomcat restart   # shortcut for stopping
                                # then starting