Friday, November 25, 2016

E-mail usage seems to show incorrectly in cPanel

Try running /scripts/generate_maildirsize on the affected account.
The syntax would be:

Code:

# /scripts/generate_maildirsize --confirm --allaccounts --verbose $USER

Replace $USER with the actual cPanel account username (the cPanel user, not the DOMAIN ).

If this does not help, log out of cPanel and delete the email_accounts.yaml and email_accounts.cache files from the cPanel account's .cpanel directory. The files will automatically be created the next time you log into cPanel.

If neither of these actions solves the problem, please submit a ticket so that we may look at your server directly.

LITESPEED INSTALLATION ON CPANEL SERVER

LITESPEED INSTALLATION ON CPANEL SERVER


Purpose:LiteSpeed Web Server is a high-performance web server that is an alternative to Apache, yet fully compatible with existing Apache configuration files. It is very well suited to high traffic websites, and those that use a large number of scripts.

Overview
cPanel officially supports LiteSpeed Web Server use through our WHM Plugin. The WHM Plugin is our longest running control panel plugin. It includes all the basic plugin features as well as some cPanel-exclusive features.


Prerequisites

1. This auto-installer can only be used for cPanel/WHM installations.
2. Make sure beforehand that all sites are working fine with Apache.
3. PHP must have been built with EasyApache. LiteSpeed will build its matching PHP (with LSAPI)         based on this build of PHP.
4. This only works with LiteSpeed Enterprise Edition, you need a trial key or an Enterprise         License serial number.


Step 1: Install LiteSpeed WHM plugin


Run the following commands from ssh as root

cd /usr/src; curl http://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh | sh

Step 2: Install LiteSpeed Speed Web Server from within WHM

1. Click the “LiteSpeed Web Server” plugin. (In the “Plugins” section at the bottom of the         scroll menu)
2. Click “Install LiteSpeed Web Server”
3. Fill in the form to specify
Trial license key or serial number
LiteSpeed target installation directory
Port Offset (set to 0 to replace Apache otherwise set a number like “2000” for example to         try LiteSpeed on port 2080)
Whether to enable PHP SuEXEC
Your Administrators email address.
Username and password for LWSW WebAdmin Console
4. Click “Next” to install LiteSpeed


Step 3: Config PHP


For EA4, Plugin will handle it through script
Our plugin will detect the right configuration and correct them when needed. You don't need to build matching PHP any more.
For EA3, Build matching PHP binary
LSWS comes with a pre-built PHP 4 binary. However, you should build your own PHP binary using configuration options matching those used by Apache mod_php.
Then, click “Build Matching LSPHP”. This step will take a while.
NOTE:If you see one of the below error messages when running “Build Matching LSPHP”, try increasing “Max cPanel process memory (minimum: 512)” in the side menu under Server Configuration » Tweak Settings to at least 512MB.
Found Errors

ERROR: /usr/local/bin/php -i returns 6

You can try to build matching PHP from command line:
"/usr/local/cpanel/whostmgr/cgi/lsws/cmd_buildmatchingphp.sh"
Or
Found Errors

ERROR: /usr/local/bin/php -i returns 134

You can try to build matching PHP from command line:
"/usr/local/cpanel/whostmgr/cgi/lsws/cmd_buildmatchingphp.sh"


Step 4: Start LiteSpeed again

Click “Restart LiteSpeed”.
You can now verify if everything is working as expected. It should be!
You can now replace Apache with LiteSpeed Web Server. Click “Change Port Offset” and set the value to 0 if you had not done so previously. Click “Switch to LiteSpeed” and that's it!

WARNING: Do NOT uncheck the “Apache Web Server” (httpd) service under WHM's service manager. If you do this WHM will not restart LiteSpeed automatically when configuration changes have been made.

Note: To uninstall WHM LiteSpeed plugin, run the following command:

/usr/local/cpanel/whostmgr/docroot/cgi/lsws/lsws_whm_plugin_uninstall.sh

How to install Python 2.7 or Python 3.x + Django 1.8 + on CentOS 6 + cPanel

Python is one of the core packages that comes by default with CentOS Linux. However, it is not updated at all on CentOS 6.x, the default version is 2.6.6, which is a little bit old for the current dev requirements when you are building a web app based on this language.
If you need to install Python 2.7 or 3.x versions on CentOS 6, there is one way to install this alternatives without breaking the default Python version, which is widely used by the OS and its tools like yum/dnf.
This may work on CentOS plain servers, but also on cPanel servers.

3 steps to Install Python 2.7 and Django on CentOS 6

1) Get latest Python 2.7.x version
Extract, configure, compile and install.
In the last step make sure you run: make altinstall, to avoid any conflicts with the default CentOS python version.
mkdir /root/temp && cd /root/temp
wget http://python.org/ftp/python/2.7.10/Python-2.7.10.tgz
tar -xvpzf Python-2.7.10.tgz
./configure
cd Python-2.7.10
./configure
make
make altinstall
At this point you should be able to execute python 2.7.x using this binary:
/usr/local/bin/python2.7
or simply:
python2.7
Now that we have Python 2.7 working, let’s get PIP to install some additional modules:
2) Install PIP
PIP is the right tool to manage and install python packages, make sure you run the installer calling the python2.7 binary.
cd /root/temp
wget https://bootstrap.pypa.io/get-pip.py
/usr/local/bin/python2.7 /root/temp/get-pip.py 
3) Install Django 1.8
Django is one of the most popular Python frameworks. Let’s use PIP to install Django 1.8.x.
pip2.7 install Django==1.8.3
Need to Install additional Python modules?
Let’s use pip too, as easy as it looks:
pip2.7 install django-debug-toolbar
pip2.7 install django-smart-selects
pip2.7 install mysqlclient
pip2.7 install Pillow
pip2.7 install python-dateutil
pip2.7 install PyYAML
Repeat the same procedure for all the python/django modules you need.
That’s all. At this point you should have two Python versions, the default from CentOS and the alternative we installed. 

command to check swap utilization

for file in /proc/*/status; do awk '/VmSwap|Name/{printf $2 " " $3}END{print ""}' $file; done | less