Saturday, 13 February 2016

Disable ssl via ssh (unable to login into WHM)

If you are unable to login into WHM because of ssl error (An error occurred during a connection to . Peer's Certificate has been revoked. (Error code: sec_error_revoked_certificate)




 you can disable those options from the shell. SSH to the server as root.
SSH to your server as root
Open
# vi /var/cpanel/cpanel.config and set the following options to 0 (zero).
alwaysredirecttossl
requiressl
—-
alwaysredirecttossl=0
requiressl=0
—–
Save the file and exit.
 
 
Thats it :)

CPanel installation tips

Disk layout

We recommend to use logical volumes (LVM)
swap - twice the server's RAM
/ - 40G (not that large if you want to use separate /var and /home)
/boot - 200M
/tmp - 2G
somewhat more for /var/lib/mysql to store more databases
/home - grow to fill the disk

Network

Set IP address: edit /etc/sysconfig/network-scripts/ifcfg-eth?. cPanel installation guide forbids to use NAT.
Set fully qualified domain name (FQDN): edit /etc/sysconfig/network. cPanel allows to  use only 3rd level domain names (cp.example.com).

Base system installation

Install minimal CentOS.
Check for package groups installed (yum grouplist). Remove (yum groupremove) all of:
  • FTP Server
  • GNOME Desktop Environment
  • KDE (K Desktop Environment)
  • Mail Server or E-mail Server
  • Mono
  • Web Server
  • X Window System
for minimal installation only "E-mail server" was installed by default.
Install perl (yum install perl), wget (yum install wget)
Disable SELinux: edit /etc/selinux/config, set "SELINUX=disabled"
Disable iptables: chkconfig iptables off, chkconfig ip6tables off

cPanel installation

cd /home
wget -N http://httpupdate.cpanel.net/latest
sh latest

Post-installation configuration

You can enable firewall now: the best choice is to install CSF, so you could manage firewall rules under WHM menus:
wget http://www.configserver.com/free/csf.tgz && tar -xzf csf.tgz && cd csf && sh install.sh

edit /etc/csf/csf.conf, set TESTING="0" and restart csf (csf -r)
or you can enable iptables (chkconfig iptables on, chkconfig ip6tables on) and open custom ports:
  • 20 — FTP TCP inbound/outbound
  • 21 — FTP TCP, UDP inbound/outbound
  • 22 — SSH TCP inbound
  • 25 — SMTP TCP inbound/outbound
  • 26 — SMTP TCP inbound/outbound
  • 37 — rdate TCP outbound
  • 43 — whois TCP outbound
  • 53 — DNS TCP/UDP inbound/outbound (inbound is only needed if you run your own public DNS server)
  • 80 — HTTP TCP inbound/outbound
  • 110 — POP3 TCP inbound
  • 113 — ident TCP outbound
  • 143 — IMAP4 TCP inbound
  • 443 — HTTPS TCP inbound
  • 465 — SMTP TLS/SSL TCP/UDP inbound/outbound
  • 783 — SpamAssassin TCP/UDP inbound
  • 873 — rsync TCP/UDP outbound
  • 993 — IMAP4 SSL TCP inbound
  • 995 — POP3 SSL TCP inbound
  • 2077 — WebDAV TCP/UDP inbound/outbound
  • 2078 — WebDAV SSL TCP/UDP inbound/outbound
  • 2082 — cPanel TCP inbound
  • 2083 — cPanel SSL TCP inbound
  • 2086 — WHM TCP inbound
  • 2087 — WHM SSL TCP inbound
  • 2089 — cPanel license TCP outbound
  • 2095 — Webmail TCP inbound
  • 2096 — Webmail SSL TCP inbound
  • 3306 — MySQL TCP (only if you need to connect remotely)
  • 6666 — Chat TCP inbound
Configure WHM (https://<ip addr>:2087) and cPanel (https://<ip addr>:2083) accordingly to your needs.

You can find the most up to date installation guide at cPanel official documentation

OpenVZ Server Provisioning

Stage 1 :  Server Setup
------------------------------

1 . Add the openVZ repository to  yum.
  

===============
 a. cd /etc/yum.repos.d
     b. http://download.openvz.org/openvz.repo
     c. rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ
===============

2. Search  Available kernels
    a.
===============
yum  search vzkernel
===============

3 Install  kernel  
    a.
===============
yum  install  vzkernel
===============
         * it will  install  necessary packages for openvz virtualization inludes  vzctl ,vzquota etc
         *

===============
rmp -qa | grep  vzk*
===============
    ---> verification command

4.Configure boot loader
     a . /etc/grub.conf
     b . edit   title  of   vzkernel  as OpenvZ   ( Just for  clarity  )

5. Set Kernel  parameters and disable  SElinux

    
       a.
==============
vi  /etc/sysctl.conf
==============
  and  set below parameter  
        

====           
Quote

    net.ipv4.ip_forward = 1
                  net.ipv6.conf.default.forwarding = 1
                  net.ipv6.conf.all.forwarding = 1
                  net.ipv4.conf.default.proxy_arp = 0
====
              
Quote
====
    # Enables source route verification
                   net.ipv4.conf.all.rp_filter = 1
                   # Enables the magic-sysrq key
                    kernel.sysrq = 1
                   # We do not want all our interfaces to send redirects
                     net.ipv4.conf.default.send_redirects = 1
                     net.ipv4.conf.all.send_redirects = 0
====
    
           b.
====
vi  /etc/sysconfig/selinux
====
  and set
====
SELINUX=disabled
====

6. Now rebooting to  OpenVz kernel
7.Check whether  Eth0 detected or not  ,if no refer below link  for  fix .
  
    http://in.myloth.com/forum/index.php?topic=17.0

8. Start OpenVz
      
=====
/sbin/service vz start
=====



Stage 2 : Templates
--------------------------

1. Download OS templates to  /vz/template/cache/
     Check http://wiki.openvz.org/Download/template/precreated

Stage 3 :  Setup VMs
---------------------------
  
 1. Create virtual  machines   ( CID --> Container ID )
        
====
vzctl create  CID  --ostemplate   template  --config-basic    
          vzctl set  CID  --onboot yes --save
====
  ---> To  start Vms on boot

 2. Configure VM
        a. add ip
            
====
 vzctl set  CID --ipadd ip --save
====
         b. No of sockets
            
====
 vzctl set CID  --numothersock  150 --save
====
         c. Set name server for  N/w access
              
====
vzctl set CID  --nameserver  IP --save
====
  ( our case  192.168.1.1 )
         d. Start  VM
              
====
vzctl start  CID
====

OpenVZ Commands

1) vzlist –a                                                                                          : To list all VPS.

2) vzlist                                                                                               : To list all Running VPS.

3) vzctl start <VPSID>                                                                         : To Start a VPS.
   
4) vzctl stop <VPSID>                                                                          : To Stop a VPS.

5)  vzctl stop <VPSID> –fast                                                                : To Stop a VPS quickly and forcefully. 

6) vzctl restart <VPSID>                                                                      : To Restart a VPS.

7) vzctl status <VPSID>                                                                       : To view the status of the particular VPS.

8) vzctl enter <VPSID>                                                                        : To enter in a particular VPS.

9) vzcalc -v <VPSID>                                                                            : To view the resources used by the VPS.

10) vzctl exec <VPSID> <COMMAND>                                                  : To execute a commands against the VPS.

12) vzdqcheck [options] <path>                                                          : To counts inodes and disk space used.
 
Options available to the vzdqcheck command are:

              -h:-Usage info.
              -V:- vzquota version info.
              -v:- Verbose mode
              -q:- Quiet mode.


13) vzcpucheck –v                                                                                : To get the CPU usage.

14) vzmemcheck [-v] [-A]                                                                      : Shows the Node memory parameters.

          Options available to the vzmemcheck command are:
               -v:- Display information for each Container.
               -A:- Display absolute values (in megabytes).

15) vzpid <pid>                                                                                    : To display the ID of the Container where the process is running.

16) vzsplit -n <numve> -f <conf_name> -s <swapsize> -v <yes|no>  : To generate a sample VE configuration file.

          -n numv         :- Specify the number of containers.
          -f conf_name :- Specify the configuration sample name to write configuration
          -s swapsize   :-Specify the swap size in Kbytes.
          -v yes|no       :- Whether to generate VSwap enabled configuration.


17) vzcfgvalidate                                                                                  : To catch typical mistakes in the configuration.

                 It can be invoked as follows:

                    # cd /etc/vz/conf

                    # vzcfgvalidate <config_file>

18) vzctl set <VPSID> --hostname <HOSTNAME> --save                      : To set the Hostname of a VPS.

19) vzctl set <VPSID> --ipadd <IP> --save                                           : To add a new IP to the hosting VPS

20) vzctl set <VPSID> --ipdel <IP> --save                                            : To delete the IP from VPS

21) vzctl set <VPSID> --userpasswd root:<NEW PASSWORD> --save : To reset root password of a VPS.

22) vzctl set <VPSID> --nameserver <IP> --save                                 : To add the nameserver IP’s to the VPS.

23) exit                                                                                                 : log out from VPS.

24) vzctl destroy <VPSID>                                                                    : To destroy the VPS.

Automated ClamAV Virus Scanning

If any client demanding us to setup an automated ClamAV Virus Scanning in the server. Please do the following

The most simple way is trying a cron job on daily basis or hourly basis according to client's wish.
First of all you need to install the clamAV >> yum install clamav clamav-db clamd
Starting it>>/etc/init.d/clamd start
Removing the test virus files>> rm -rf /usr/share/doc/clamav-0.95.3/test/
Creating the scripts
>> vi /etc/cron.daily/clamscan_daily
Past these into the file
=================================================================
#!/bin/bash

# email subject
SUBJECT="VIRUS DETECTED ON `hostname`!!!"
# Email To ?
EMAIL="me@domain.com"
# Log location
LOG=/var/log/clamav/scan.log

check_scan () {

    # Check the last set of results. If there are any "Infected" counts that aren't zero, we have a problem.
    if [ `tail -n 12 ${LOG}  | grep Infected | grep -v 0 | wc -l` != 0 ]
    then
        EMAILMESSAGE=`mktemp /tmp/virus-alert.XXXXX`
        echo "To: ${EMAIL}" >>  ${EMAILMESSAGE}
        echo "From: alert@domain.com" >>  ${EMAILMESSAGE}
        echo "Subject: ${SUBJECT}" >>  ${EMAILMESSAGE}
        echo "Importance: High" >> ${EMAILMESSAGE}
        echo "X-Priority: 1" >> ${EMAILMESSAGE}
        echo "`tail -n 50 ${LOG}`" >> ${EMAILMESSAGE}
        sendmail -t < ${EMAILMESSAGE}
    fi

}

clamscan -r / --exclude-dir=/sys/ --quiet --infected --log=${LOG}

check_scan
===================================================================
For hourly base >> vi /etc/cron.hourly/clamscan_hourly

paste these
===================================================================
#!/bin/bash

# email subject
SUBJECT="VIRUS DETECTED ON `hostname`!!!"
# Email To ?
EMAIL="me@domain.com"
# Log location
LOG=/var/log/clamav/scan.log

check_scan () {

    # Check the last set of results. If there are any "Infected" counts that aren't zero, we have a problem.
    if [ `tail -n 12 ${LOG}  | grep Infected | grep -v 0 | wc -l` != 0 ]
    then
        EMAILMESSAGE=`mktemp /tmp/virus-alert.XXXXX`
        echo "To: ${EMAIL}" >>  ${EMAILMESSAGE}
        echo "From: alert@domain.com" >>  ${EMAILMESSAGE}
        echo "Subject: ${SUBJECT}" >>  ${EMAILMESSAGE}
        echo "Importance: High" >> ${EMAILMESSAGE}
        echo "X-Priority: 1" >> ${EMAILMESSAGE}
        echo "`tail -n 50 ${LOG}`" >> ${EMAILMESSAGE}
        sendmail -t < ${EMAILMESSAGE}
    fi

}

find / -not -wholename '/sys/*' -and -not -wholename '/proc/*' -mmin -61 -type f -print0 | xargs -0 -r clamscan --exclude-dir=/proc/ --exclude-dir=/sys/ --quiet --infected --log=${LOG}
check_scan

find / -not -wholename '/sys/*' -and -not -wholename '/proc/*' -cmin -61 -type f -print0 | xargs -0 -r clamscan --exclude-dir=/proc/ --exclude-dir=/sys/ --quiet --infected --log=${LOG}
check_scan
===================================================================

NB>>Dont forget to give the execution permission to both the scripts>>

chmod +x script

You can customize the log file according to the client's wish but should be updated in the script along with the full path.
You are permitted to customize all the variables also but should be legible account in case of E-mail account.

If you have done these then you are all set to go...  8)

Reset the Root password for th Xen VPS

 If you face root login issue with Xen VPS.Then please do the following steps.

1)First Stop the container using command or through solusvm
2)Secondlyfind the the the Xen image location  of the VPS which is /dev/mapper/xen-vm369_img(example)
3)create a directory name test and then mount the image to it using command mount /dev/mapper/xen-vm369_img /test
4)then change the root environment to test using the command chroot /test
5)Now the root environment will be same as that of Xen VPS which we have mounted
6)Then change the root password of root using passwd command.
7)Then exit from the root environment by typing the command exit and unmount the /test directory using umount /test
8)Reboot the server in solusvm

Database size not showing in cPanel

Most of you might have come across this issue before where database size show '0' in cPanel but tables, data exists in server. Here is the fix for it :

Open /var/cpanel/cpanel.config

Edit line

disk_usage_include_sqldbs=1 ( you need to set it to '1' if '0' ) 

And run

#/scripts/update_db_cache

That will do... :)

Linux ate more RAM !!!!!!!!!


Linux servers are utilizing unused memory for disk caching. This makes it looks like you are low on memory, but you are not! Everything is fine!

Why ?

Disk caching makes the system much faster! There are no downsides, except for confusing newbies. It does not take memory away from applications in any way, ever!

What if I  need to run more appilication?


If your applications want more memory, they just take back a chunk that the disk cache borrowed. Disk cache can always be given back to applications immediately! You are not low on ram!

Swap ! needed ?
==============


No, disk caching only borrows the ram that applications don't currently want. It will not use swap. If applications want more memory, they just take it back from the disk cache. They will not start swapping.


How to stop ?

You can't disable disk caching. The only reason anyone ever wants to disable disk caching is because they think it takes memory away from their applications, which it doesn't! Disk cache makes applications load faster and run smoother, but it NEVER EVER takes memory away from them! Therefore, there's absolutely no reason to disable it!
Why does top and free say all my ram is used if it isn't?
This is just a misunderstanding of terms. Both you and Linux agree that memory taken by applications is "used", while memory that isn't used for anything is "free".


But what do you call memory that is both used for something and available for applications?

You would call that "free", but Linux calls it "used".
Memory that is    You'd call it    Linux calls it
taken by applications     Used     Used
available for applications, and used for something     Free     Used
not used for anything     Free     Free

This "something" is what top and free calls "buffers" and "cached". Since your and Linux's terminology differs, you think you are low on ram when you're not.
How do I see how much free ram I really have?
To see how much ram is free to use for your applications, run free -m and look at the row that says "-/+ buffers/cache" in the column that says "free". That is your answer in megabytes:

$ free -m
             total       used       free     shared    buffers     cached
Mem:          1504       1491         13          0         91        764
-/+ buffers/cache:        635        869
Swap:         2047          6       2041
$

If you don't know how to read the numbers, you'll think the ram is 99% full when it's really just 42%.

KVM Node setup Basic steps only

To use LVM-based guests, you need a volume group that has some free space that is not allocated to any logical volume.

In this example, I use the volume group /dev/vg_server1 with a size of approx. 465GB...

vgdisplay

[root@server1 ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_server1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               465.28 GiB
  PE Size               4.00 MiB
  Total PE              119112
  Alloc PE / Size       26500 / 103.52 GiB
  Free  PE / Size       92612 / 361.77 GiB
 
 
  that contains the logical volumes /dev/vg_server1/LogVol00 with a size of approx. 100GB and /dev/vg_server1/LogVol01 (about 6GB) - the rest is not allocated and can be used for KVM guests:

lvdisplay

[root@server1 ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg_server1/LogVol01
  LV Name                LogVol01
  VG Name                vg_server1
  LV UUID                uUpXY3-yGfZ-X6bc-3D1u-gB4E-CfKE-vDcNfw
  LV Write Access        read/write
  LV Creation host, time server1.example.com, 2012-08-21 13:45:32 +0200
  LV Status              available
  # open                 1
  LV Size                5.86 GiB
  Current LE             1500
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vg_server1/LogVol00
  LV Name                LogVol00
  VG Name                vg_server1
  LV UUID                FN1404-Aczo-9dfA-CnNI-IKn0-L2hW-Aix0rV
  LV Write Access        read/write
  LV Creation host, time server1.example.com, 2012-08-21 13:45:33 +0200
  LV Status              available
  # open                 1
  LV Size                97.66 GiB
  Current LE             25000
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
 
 
 
  Or you can reinstall the OS and create a lvm partition as below
  =======
 
  df
====
/dev/md125              ext4      476M  150M  298M  34% /boot
/dev/mapper/lvroot-home ext4       85G  5.8G   75G   8% /home
/dev/md126              ext4       40G  3.3G   35G   9% /



Install required KVM RPMs/packages


# yum groupinstall "Virtualisation Tools" "Virtualization Platform"
# yum install python-virtinst


# chkconfig libvirtd on


# service libvirtd status
libvirtd (pid  31128) is running...
# virsh list

Setup will be like below




                    +-------------+
                     | CentOS/RHEL |             |-----|
     -->ISP router---+ Box Host w/ +--- eth0 -->-+ br0 +  Private IP
                     | KVM         |             |     |
                     +-------------+--- eth1 -->-+ br1 | Public IP
                                                 |-----|
                                                    |
                                                vm1-+---vm2----vm3---vm4
*** NOTE: each VMs will have two interface i.e. Private and Public *****

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

Install and configure a network bridge
=============================================

 
KVM network setup
============
[root@vz2 template]# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
BROADCAST=IP
IPADDR= Main IP
GATEWAY=IP
NETMASK=255.255.255.X
NETWORK=IP
ONBOOT=yes

=========

>> /etc/sysconfig/network-scripts/ifcfg-eno1


DEVICE=eno1
TYPE=Ethernet
HWADDR=check with hw
IPV6INIT=yes
IPV6_AUTOCONF=yes
ONBOOT=yes
BRIDGE=br0
==========================================================================

Next steps >> solusvm master /slave installation steps


Sreejith Anchal >> ping me @ s9400578382@gmail.com , if need.

Wednesday, 9 December 2015

Installation of ZendOptimizer

If you wanted to install Zend Optimizer use the below command.


Inorder to check the module is available :
/scripts/phpextensionmgr list
Available Extensions:
EAccelerator
IonCubeLoader
Zendopt
SourceGuardian
PHPSuHosin

Installing the module :
/scripts/phpextensionmgr install Zendopt
Installing Zendopt
Determining PHP version
Installing Zend Optimizer binary
Activating Zend Optimizer in /usr/local/lib/php.ini
Zend Optimizer activated
Skipping install to /usr/local/php4, missing php.ini

Installation of Cpremote

cPremote is a remote incremental backup and it will use cPanel modules itself for taking backups to your remote backup server over ssh.

A growing number of clients are choosing to use CP Remote backup script as a ‘low load’ alternative to the standard Cpanel FTP backups. CP Remote is much more cost effective than the other backup solution we offer (R1 Soft) although it is a ‘time stamped’ solution and not a continuous data protection solution.

If you are happy to have off server backups taken nightly at a pre-defined time (usually 1am) then this backup solution could be for you. Quickly have your data restored to any cpanel server in the event of data loss.

It uses Rsync which means it is a very efficient way of working. Your first backup will take the longest as it copies all files from your server to the backup space you buy from us. The second backup only backs up what has changed so it is a very efficient solution in terms of bandwidth. All your data is backed up with this solution including Public_html folder, My SQL databases as well as email folders.

The Cpanel plug in works perfectly and allows you to check your backups and also restore quickly and easily from within an easy to use web based interface.

» Requirements:
You need a Linux cPanel server running latest stable release of cPanel(11.32 or higher) .

Need cpphp /var/cpanel/3rdparty/bin/php

» Install cPremote
Download the tar file cpremote.X.Y.tar.gz from https://portal.syslint.com/downloads.php where X.Y is the latest version.
tar -xzf cpremote.X.Y.tar.gz
# cd cpremote/
# ./install.sh

» Configure Backup
Go to WHM->Plugins -> cPanel Remote Backup -> Configure Backup . Here you can configure backup settings.

» Configure Backup Public Key in remote ssh account
Go to WHM->Plugins -> cPanel Remote Backup -> Your Backup Public Key and follow the procedure mentioned in that website to setup public key for backup ssh account.

» How to run a manual backup update
You may need to run the following script.
/scripts/cpremotebackup

» How to change the backup time
You may change the following cron time
0 1 * * * /scripts/cpremotebackup

» How to enable backup for Multiple Home folder
You may need to add your home folders mount point names n to the file /etc/cpremote/userhomes.txt. See an example below, It is the default settings.
/home
/home1
/home2
/home3
This option will enable multiple home folder feature.

» How to restore a cPremote Backup
1. A full account from daily , weekly, monthly and 7 days backups
2. Restore email fodler , home fodler , document root , individual files and fodlers, individual databases
3. cPanel end user interface for restoring backups
4. /scripts/cpremoterestore feature rich command line utility

» Restore Backups from Plugin Page
You may need to goo WHM -> Plugins -> cPanel Remote Backups -> Restore A backup , then select the cpanel accounts and backup option for restore.

» Restore Backups from server shell
If you need to restore a cPanel account say CPUSER from the backups see , the example commands below,

Restore email folder of cpanel user CPUSER from the daily backups
/scripts/cpremoterestore --user=CPUSER --from=daily --type=mail

Restore Document root from weekly backup for CPUSER
/scripts/cpremoterestore --user=CPUSER --from=weekly --type=www

Restore the complete home folder of CPUSER from monthly backup
/scripts/cpremoterestore --user=CPUSER --from=monthly --type=homefolder

Restore a full account from daily backup
/scripts/cpremoterestore --user=CPUSER --from=daily --type=full

Installing Ngnix on Cpanel

 Nginx can be used to serve static pages on a server running cPanel with Apache. Apache will handle the dynamic content for PHP and cgi scripts, while nginx will handle the static pages such as .htm and .html

Install nginx
 1. Make a copy of your httpd.conf file
     cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak

 2. Go to WHM > Tweak Settings and change the Apache port:
    The port on which Apache listens for HTTP connections. Specifying a specific IP will prevent   Apache from listening on all other IPs. (default: 0.0.0.0:80)  To:  0.0.0.0:8081
     Do not change the https port listed.
     Click the “Save” button.

3. Grab a copy of the nginx installation script:
     mkdir /root/cpacct && cd /root/cpacct
     cd /usr/local/src
     wget http://nginxcp.com/latest/nginxadmin.tar
     tar xf nginxadmin.tar
     cd publicnginx
    ./nginxinstaller install

 If you receive this error when trying to install:
  access key doesn't exist create it in WHM
  Then go to WHM > Cluster/Remote Access > Setup Remote Access Key and click on the “Generate      New Key” button.
  At that point, then re-run “./nginxinstaller install” command.

4. Rebuild Apache and then restart nginx and Apache
    /scripts/rebuildhttpdconf
    /etc/init.d/nginx restart
    /etc/init.d/httpd restart

Now, your static pages should be serving from nginx, while PHP and cgi ones should be serving from Apache. Both httpd and nginx processes will be running on the machine.

Please note that sites will still show up on port 80 in a browser (so you don’t have to worry that pages in a browser will require a different port). nginx works as a proxy on port 80, so it handles the incoming requests on that port to see if they are dynamic or static, then it hands off the dynamic pages to Apache (running on port 8081). Your site visitors will have no idea that Apache is running on a different port due to the proxying nginx performs on the machine for it.

Uninstall nginx

If you decide you want to uninstall nginx at any point, simply run this command:
/root/cpacct/publicnginx/nginxinstaller uninstall
You would also need to go to WHM > Tweak Settings and change the Apache port back to 80:
The port on which Apache listens for HTTP connections. Specifying a specific IP will prevent Apache from listening on all other IPs. (default: 0.0.0.0:80)  To: 0.0.0.0:80
Then “Save” that area. Finally, rebuild and restart Apache:
  /scripts/rebuildhttpdconf
  /etc/init.d/httpd restart

Changing Litespeed webserver password


Login to the server
/usr/local/lsws/admin/misc/admpass.sh

Enter the user name:
New Password:
Retype New Password:

The password have been changed
============================================

Wordpress Installation in Cpanel

Step 1: Download the installation archive from the WordPress download section (http://wordpress.org/download/) by clicking on "Download.zip" or "Download.tar.gz". This way you will get the latest stable release of the WordPress application.

Step 2: When you are in cPanel -> File Manager, navigate to the uploaded file and extract it by clicking on "Extract". The other option is to extract the file on your computer and then to upload the content in the desired folder via FTP.

Step 3: You have to create a Mysql database and a database user and then assign that user in to the database with full privellages.

Step 4: Then you have to run the installer,With the new version of WordPress, you don’t have to edit your config. file anymore. Simply type the url of the directory where it was installed.

    For example: www.yourdomain.com/blog/





In cpanel case, you will need to add user_database format when you enter the name of your database. Enter the database you created in the step 2. Enter the username and password and thats it. You don’t need to change Database host and wp_prefix field.
Once you hit the submit button, it will take you to a follow up page like this :



Make sure that you check the box off if you don’t want this blog to be seen by search engines. For businesses, keep it on so you can be discovered. Make sure you enter a valid email because if something goes wrong, and your browser decide to shut off on you, and you didn’t get to copy the random password, it can send the password to you. Once you click install, a confirmation screen like below would appear:


After the step above, your installation is now complete and you can login to your WordPress admin panel by going to:

    http://www.yourdomain.com/wp-admin

Eventhough the install is complete, there is more that awaits you such as choosing the right theme, plugins, and advertising your blog.

Tuning Mysql Performance with Mysql tuner

MYSQL Tuner :-  It is a perl script that analyzes the MYSQL performance and based on the statistics , it gathers and give us an idea about the parameters need to be changed in the my.cnf file to increase the MYSQL performance.

Download Mysql Tuner script as follows:

# wget http://mysqltuner.com/mysqltuner.pl

Then, make the script executable by running

# chmod +x mysqltuner.pl

Run the script

# ./mysqltuner.pl

This is how you can run the mysql tuner script. Then, you will obtain the output as:

------------------------------------------


General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries without LIMIT clauses
    Set thread_cache_size to 4 as a starting value
    Increase table_cache gradually to avoid file descriptor limits
    Your applications are not closing MySQL connections properly
Variables to adjust:
    query_cache_size (>= 8M)
    sort_buffer_size (> 8M)
    read_rnd_buffer_size (> 256K)
    tmp_table_size (> 20M)
    max_heap_table_size (> 20M)
    thread_cache_size (start at 4)
    table_cache (> 64)
    innodb_buffer_pool_size (>= 29M)

------------------------------------------------------

By adjusting the parameters listed in " Variables to adjust ", we can increase the performance of mysql

Tweaking Apache in WHM

Apache is the number one Web server running on Linux systems. There are a number of little things that can be done to tune Apache performance and to lessen its impact on system resources. One of these things is tweaking the memory usage.

By default, Apache allocates a maximum number of 256 simultaneous client connections, or 256 processes (one to serve each request). With this setting, a heavily-trafficked site would be taken down in moments (even if you assume 5 MB per process, 1.3 GB of RAM would be required to satisfy that number of requests). If nothing else, it would cause the system to thrash the hard disk by attempting to use swap to handle what can't fit into physical memory.

Inorder to Tweak the apache settings in WHM go to :

Main >> service configuration >> Apache configuration >> Global configuration

Other settings to tweak include the KeepAlive, KeepAliveTimeout, and MaxKeepAliveRequests settings. Recommended settings, which can all be set in the configuration, would be :

----------------------------------
 ServerLimit 150

 MaxClients 150

 KeepAlive On

 KeepAliveTimeout 2

 MaxKeepAliveRequests 1000
----------------------------------

By decreasing the KeepAliveTimeout from 15 seconds to 2 seconds, the MaxClients directive can be increased; 19 is pretty small, and 128 is much better. By reducing the number of seconds that a process can live, you can enable more connections in the same amount of time.


MaximumKeepAlive requset is actually the maximum number of requests to serve on a TCP connection. If you set it up to 100, clients with keepalive support will be forced to reconnect after downloading 100 items. By increasing the value to 1000, The clients can download a full page with a single connection. Bumping that value didn't had any negative impact, it only made everything more faster.



Please save the edited configuration

The value of the MaxClients can be increased if you have sufficent memmory to handle the request.

Social Engine Installation

Before installing social engine you need to create a Mysql database and database user with a strong password. Please also add the user to the database and assign  all privellages on to the database user.

You can download a copy of SocialEngine from the client area of our website :

http://www.socialengine.com/sign-in

Create a directory on your server where SocialEngine will be placed (e.g. "/socialnetwork") or, if you wish, you can simply use your existing HTTP root directory (e.g. "/httpdocs", "/public_html").

Download the SocialEngine4 ZIP file and extract it's contents to your computer.

Upload all the extracted files to your server.

Point your browser to the directory where your SocialEngine files were uploaded (e.g. "http://www.example.com/socialnetwork", "http://www.example.com").

Step 1: Enter your License Key :

Enter your SocialEngine license key and click Continue




Step 2: Check Requirements

Most of the requirements listed on this page should already be meet if your server meets the minimum requirements required by SocialEngine. If your server does not meet the minimum requirements, please contact your hosting provider.

f you are using a Unix server (or Unix variant, like Linux, OS X, FreeBSD, etc.), 777 permissions must be applied to the following directories:

    /install/config
    /temporary
    /public
    /application/themes
    /application/packages
    /application/languages
    /application/settings/

To apply permissions to these directories manually login over FTP and recursively set the permissions of the directories listed above to 777. To have SocialEngine set the permissions for these directories automatically, click on the "do it automatically" link.

Step 3: Select your connection type


If you select FTP/FTPS as your connection type, enter your FTP information and click Continue.



NOTE: If you are not sure what the path is to your SocialEngine installation directory, set the FTP Path to "/" and select "Search for SocialEngine Path". The     installation wizard will automatically find the correct file path to your SocialEngine installation directory.
 If you select None as your connection type, enter the path to your SocialEngine installation directory click Continue.
 
After SocialEngine has found and set the necessary permissions, click the Retry Requirements Test button to check the requirement once more.

  If all requirements have been meet, click the Continue button to proceed to step 3.


 
 Step 3: Setup MySQL Database

    Enter your MySQL database information and click Continue.
If SocialEngine is able to connect to your database, click the Continue button to proceed


If SocialEngine is able to create your database tables successfully, click the Continue button to proceed to step 4.

 Step 4: Create Admin Account

  Enter the name of your SocialEngine website, profile information and click Continue.

 Congratulations! SocialEngine has been installed successfully. You are now ready to login to your SocialEngine administration system and build your social network

Black List Removal/ Whitelisting IP

Steps to be followed when your IP address is Blacklisted :

If your Domain-Name or IP Address is blacklisted at any ISP, you need to send them a  request them to be removed from their blacklist (de-listed).

 Here are the basic steps that you should follow for the whitelisting/de-listing  procedure at the ISP in question:

 a) You should follow the URL links & apply for whitelisting/de-listing using their  online form.

                           or

 b) You should send an email to the mentioned email address.

List of ISP's :

--------------------------------------------------------------------------------------------------
Comcast:
  Follow this URL: www.comcastsupport.com/rbl
  Fill out the online form & submit.

  Cox:
  Follow this URL: http://postmaster.cox.net/confluence/display/postmaster/Error+Codes
  On the page, search the listed error codes to match the one you received when you were blacklisted. Click the URL suggested to get to the appropriate online form.      Then submit.

  EarthLink:
  Send an email to: blockedbyearthlink@abuse.earthlink.net
  Use the subject line <Blocked 'insert your email server's IP'> (example: Blocked 255.255.255.2555)
  More details are given on these pages:
  http://earthlink.net/block
  http://support.earthlink.net/articles/email/email-blocked-by-earthlink.php

  Gmail:
  Read Gmail's Bulk Senders Guidelines here: http://www.google.com/mail/help/bulk_mail.html
  Then follow this URL for the Bulk Sender Contact Form: http://mail.google.com/support/bin/request.py?contact_type=bulk_send&hl=en
  Fill out & submit.

  Hotmail:
  Follow this URL: https://support.msn.com/eform.aspx?productKey=edfsmsbl&ct=eformts
  Fill out the online form & submit.
  AT&T/SBC Global/Bellsouth:
  Follow this URL: http://rbl.att.net/cgi-bin/rbl/block_admin.cgi
  Fill out the online form & submit.
  For questions related to a request, please contact them at: abuse@rbl@abuse-att.net
  Juno/NetZero/Bluelight (United Online):
  Follow this URL: http://www.unitedonline.net/postmaster/blocked.html
  Fill out the online form & submit.
  Roadrunner/Adelphia:
  Follow this URL: http://security.rr.com/mail_blocks.htm
  Follow this URL to find whether your IP is blacklisted: http://security.rr.com/cgi-bin/block-lookup

  USA.NET:
  Follow this URL to find whether your IP is blacklisted: http://postmaster.usa.net/html/error.html

  Verizon:
  Follow this URL: http://www2.verizon.net/micro/whitelist/request_form.asp?id=isp
  Fill out the online form & submit.

  Yahoo:
  Follow this URL: http://help.yahoo.com/l/us/yahoo/mail/postmaster/bulkv2.html
  Fill out the online form & submit.

  Mail.ru:
  Follow this URL for the Google page translator tool: http://translate.google.com
  Check "Translate from Russian" and "Translate to English"
  Enter this link in the form: mail.ru/notspam/ Then and hit Enter or Return.
  Read and follow the directions on the newly translated page.

  AOL.com:
  If you have been blacklisted, visit AOL Postmaster
  You will need to open a Postmaster Support Request to put yourself on AOL's whitelist
  (*The AOL whitelist is meant for permission-based bulk senders. Bear in mind that if you are on their blacklist, you may have done something to violate their      technical guidelines or best practices)
  You can also apply for Whitelist Status immediately.
-----------------------------------------------------------------------------------------------------

     List of Blacklist's [RBL/DNSBL]:

  -----------------------------------------------------------------------------------------------------


  Lashback:
  Follow this URL to find whether your IP is blacklisted:
  http://www.lashback.com/support/UBLQuery.aspx
  Fill out the online box and follow the links.

  BarracudaCentral:
  Follow this URL to find whether your IP is blacklisted: http://www.barracudacentral.org/lookups
  Then follow this URL: http://www.barracudacentral.org/rbl/removal-request Fill out the online form &   submit

  Spamhaus:
  Follow this URL to find whether your IP is blacklisted: http://www.spamhaus.org/lookup.lasso
  Fill out the online form, submit and follow appropriate links.

  Surbl:
  Follow this URL to find whether your IP is blacklisted: http://george.surbl.org/lookup.html
  Fill out the online form & submit.

  Invaluement.com:
  Follow this URL to find whether your IP is blacklisted: http://dnsbl.invaluement.com/lookup/
  Fill out the online form & submit.

  DNSBL Manitu:
  Follow this URL to find whether your IP is blacklisted: http://www.dnsbl.manitu.net/
  Fill out the online form & submit. You can also send an email to the link provided.

  Uribl:
  Follow this URL to find whether your IP is blacklisted: http://lookup.uribl.com/

  Hostkarma blacklist:
  http://ipadmin.junkemailfilter.com/remove.php Fill out the online form & submit.

  Spamcop:
  http://www.spamcop.net/fom-serve/cache/298.html For network and server administers.
  http://www.spamcop.net/fom-serve/cache/405.html For bounce message recipients and end-users.
  http://www.spamcop.net/bl.shtml Blacklist IP look-up
---------------------------------------------------------------------------

SPF records

An SPF record is a type of Domain Name Service (DNS) record that identifies which mail  servers are permitted to send email on behalf of your domain.SPF is an open standard  created to stop forgery of From addresses. SPF helps mail servers distinguish forgeries  from real mail by making it possible for a domain owner to say, "I only send mail from  these machines". That way, if any other machines try to send mail from that domain, the  mail server knows that the From address is forged.






  Creating SPF records
 -----------------------

  You can create the spf records for the domains from this link :

  http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/

 Checking SPF records for a Domain
 ----------------------------------------

You can check if a Domain have valid SPF record via :

 http://mxtoolbox.com/spf.aspx

  Performing a Dig search :

  Dig +trace Domain name txt

  Will display a result like : v=spf1 include:spf.intermedia.net ~all  or
  v=spf1 A:my_smtp_server_name include:spf.intermedia.net ~all

Litespeedserver Installation in WHM

You can install litespeed on a WHM/Cpanel server by simply following the bellow steps :

 Log into server via SSH as ‘root’ user.

 Go to /usr/src

 cd /usr/src

 Download the installation file using wget.

 wget http://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh

 chmod 700 lsws_whm_plugin_install.sh

 sh lsws_whm_plugin_install.sh ( ./lsws_whm_plugin_install.sh)

 rm -rf lsws_whm_plugin_install.sh

 Log into WHM. Go to manage pluggins section.

 Start the installation procedure by clicking on ‘Install LiteSpeed’.

 This will ask you to enter your license information and admin password. Enter these information and click     on ‘Build matching PHP Binary. (Please do not tick the box to  start LiteSpeed immediately).

 Click on ‘Switch to LiteSpeed’

 Click on ‘Admin Web Console’ and login

 Final stages of setup

 Go to Configuration > General > Index Files > Edit

 You need to set the following and save.
 ===============================================
  Index Files: index.html, index.php, index.php5, index.htm
  Auto Index: Yes
  Auto Index URI => /_autoindex/default.php
 ===============================================

  In SSH Type:

  ln -sf /usr/local/lib/php/autoindex /usr/local/lsws/share/autoindex
  ================================================

  Go to Configuration > Log > Server Log > Edit

Set the following:
 ===============
 Log Level: Info
 Debug Level: None
 ===============

 Finally click on Actions > Graceful Restart to make these changes permanent.

 Now, you have successfully installed Litespeed on WHM/cpanel server.