responded with the following error: 404 (Not Found). A
title="Domain Name System">DNS or web server misconfiguration
may exist.
Edit .htaccess with following code-
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(txt|tmp)$
++++
Why is AutoSSL not working on cPanel?
One of the most common issues for cPanel users while activating AutoSSL is to find that the AutoSSL is not working at all, even if cPanel said it was finished.
There may be a few reasons on why your AutoSSL is not working, let’s explore each one of them:
1) The domain failed domain control validation: The system queried for a temporary file at but the web server responded with the following error: 403 (Forbidden). A DNS or web server misconfiguration may exist. at bin/autossl_check.pl line 565.
This means AutoSSL verification script is not able to create a temporary file for the domain
To fix it, just try to assign 755 permissions and the correct owner to your public_html directory:
Make sure you change user.user with your real cPanel user for that website.
And also check your .htaccess in case you have allow/deny directives that may be preventing the cPanel AutoSSL verification script to access your website.
That will do the trick and allow cPanel to write the temporary file.
2) The domain “mail.yourdomain.com” failed domain control validation: “mail.yourdomain.com” does not resolve to any IPv4 addresses on the internet. at bin/autossl_check.pl line 565.
There is a missing record for your mail.domain.com DNS record, just add a record to fix it.
3) Your domain doesn’t not resolve properly to the server.
As suggested by @tekgurl_kayla, make sure the domain resolves to the server & check redirects, too. Make sure you’re aware of the limits as well.
4) The certificate is not available. (processing)
You noticed this is ‘processing’, and in some cases that can take minutes (normal) or even hours, in this cases AutoSSL process is stuck and it continues to be unable to retrieve a valid AutoSSL certificate.
cPanel & WHM’s AutoSSL/SSL ordering process works on this way: cPanel system will automatically stop attempting to retrieve a certificate after 1 day (86400 secs), so if it hasn’t been completely issued within 24 hours, then it will be removed from the autossl queue.
When you find AutoSSL is not working, the first thing to do is to check the autossl logs, as you see in this image below:
Screenshot of AutoSSL Log Manager, the best tool to figure out why AutoSSL is not not working
Log for the AutoSSL run for “nixcp”: Saturday, February 11, 2017 4:25:39 AM GMT-3 (cPanel (powered by Comodo))[/B][/SIZE]
10:20:32 PM This system has AutoSSL set to use “cPanel (powered by Comodo)”.
10:20:32 PM Checking websites for “nixcp” …
10:20:32 PM The website “nixcp.com”, owned by “nixcp”, has no SSL certificate. AutoSSL will attempt to obtain a new certificate and install it.
10:20:33 PM The system will attempt to renew SSL certificates for the following websites:
10:20:33 PM nixcp.com (nixcp.com nixcp.org. [URL='http://www.nixcp.com']www.nixcp.com[/URL] [URL='http://www.nixcp.org']www.nixcp.org[/URL])
10:20:33 PM The system has completed the AutoSSL check for “cpaeltips.com”.
10:20:33 PM The system has finished checking 1 user.
The following script runs every 5 minutes, you can run it manually to see what’s going on and get your SSL processed:
/usr/local/cpanel/bin/autossl_check_cpstore_queue
After running this script, it will try to force a queue run for your pending autossl requests. The result may look similar to this:
[root@server.nixcp.com:~]/usr/local/cpanel/bin/autossl_check_cpstore_queue
Polling for “user1”’s new certificate for “yoursite.org” (order item ID “113902861”) … The certificate is available. The system will now attempt to install it. The certificate is now installed!
Polling for “user2”’s new certificate for “yoursite2.com” (order item ID “113902877”) … The certificate is available. The system will now attempt to install it. The certificate is now installed! [root@server.nixcp.com:~]
If you still have problems and your autossl not working after running that script, check out this post on cPanel forums, or contact your hosting provider for support.
Unfortunately there is no built-in way in WHM/cPanel to list every
POP3/IMAP account for every domain in one listing, however, using the
command line and our built-in API system, you can run a query to list
true email accounts:
1. as root change to /var/cpanel/users
# cd /var/cpanel/users
2. run the following one-line query against our API system:
# for file in *; do whmapi1 list_pops_for user=$file 2>/dev/null | grep \@ | grep -F @; done
Server version: Apache Tomcat/7.0.65
Server built: Jan 6 2016 18:50:03 UTC
Server number: 7.0.65.0
OS Name: Linux
OS Version: 2.6.32-573.26.1.el6.x86_64
Architecture: amd64
JVM Version: 1.7.0_101-mockbuild_2016_04_21_13_21-b00
JVM Vendor: Oracle Corporation
++++
Below is the code for test.jsp testing script when java/tomcat is enabled on server.
++++
Test JSP page
Working JSP page!
This is a page to verify that .jsp support has been enabled
Date:
<%= new java.util.Date() %>
Remote Address:
<%= request.getRemoteAddr() %>
Request Method:
<%= request.getMethod() %>
Servlet Path:
<%= request.getServletPath() %>
++++
htaccess code
As the servlet mapping only works on port 8080 and doesn't work on the Apache mod_jk proxy on port 80, we have to add below two lines needed for these to work with Apache into the user's .htaccess file at /home/user/public_html location:
CPanel and WHM have been leaning towards support of MariaDB over
other flavors. This is partly due to the upstream repos replacing the
MySQL package with MariaDB (for example, on CentOS).
MySQL 5.6 is still supported though, which means they are keeping
support for core MySQL products. But if you want to get some extra
performance enhancements or enterprise features for free, without
getting too many bells and whistles, you might want to install Percona
Server.
I’ve done this work on a new dedicated server with the latest WHM and
CPanel on CentOS 7, with MySQL 5.6 installed. Besides the backup, this
is a fairly quick process.
It’s pretty simple. From the Percona Server for MySQL 5.7
installation doc, we can get the YUM repo. (Run commands as root if you
can, otherwise as sudo.)
Now that we have a good backup, let’s remove MySQL:
Shell
1
2
service mysql stop
yum remove MySQL*mysql*
Depending on your dependency chain, this could remove Percona XtraBackup, but that can be fixed. Let’s accept this uninstall.
Let’s install Percona Server for MySQL 5.7 and Percona Toolkit:
Now that it’s installed ensure the mysql service is running. If it isn’t, start it. Now let’s upgrade:
Shell
1
mysql_upgrade
NOTE. This works if you can log in as root without a password; if you can’t, you will need to specify the
-u and
-p flags.
Once you run the upgrade, restart the mysql service:
Shell
1
service mysql restart
And there you go, you are now running on Percona Server for MySQL
5.7. If your managed providers tell you it’s not supported, don’t worry!
It works as long as CPanel supports MySQL 5.6.
If you have any issues, just restore the backup. NOTE: One thing to keep in mind is that 5.7
breaks CPanel’s ability to create users in MySQL. I believe this is due
to the changes to the mysql.user table. If this is an issue for you, you
can always use Percona Server for MySQL 5.6.
A PHP handler defines the method that Apache uses to communicate with your PHP scripts. By default, cPanel & WHM offers four PHP handlers – SuPHP, DSO, FastCGI and CGI. Each handler differs in its files and implementation. This affects Apache’s performance because it determines how Apache serves PHP. So, in this tutorial, we will see in detail about how each of these handlers function and how to change PHP Handler in cPanel EasyApache 4.
PHP Handlers
SuPHP
SuPHP requires mod_suphp Apache module. It offers maximum security for the scripts and runs the scripts as the owner of the script. It is technically a CGI module with high security.
The main disadvantage of suPHP is speed and CPU load. suPHP runs much slower than the other handlers, and you will see a significant increase in your overall CPU load when switched to it. It also does not support Opcode caching likeeAccelerator, APC, Memcached etc.
DSO
The DSO handler requires the MPM Prefork Apache module. PHP applications execute as the nobody user when you use the DSO PHP handler unless you use the mod_mpm_itk or mod_ruid2 Apache modules. The major benefits of DSO are speed and the ability to use opcode caching like eAccelerator, APC, Memcached etc.
FastCGI
FastCGI serves PHP applications through the mod_proxy_fcgi Apache module. This method is faster than SuPHP, but may require changes to the FastCGI directives to work efficiently. With SuExec enabled, FastCGI runs PHP scripts as the user (like SuPHP). It also provides enhanced security compared with DSO. The Main disadvantage of FastCGI is high memory usage. This is because FastCGI keeps PHP sessions opened in the background in memory for quicker access and this allows you to use an opcode caching extension such as eAcceleartor or APC with it to increase performance.
CGI
CGI stands for Common Gateway Interface. As the name implies it executes PHP applications through the mod_cgi or the mod_cgid Apache modules. It is highly configurable. However, It is also slow and insecure. Hence not recommended to use.
How to change PHP Handler in cPanel EasyApache 4
*GUI METHOD
cPanel EasyApache 4 provides a very cool interface to change the PHP Version and PHP Handler.
1) Move to WHM >> Home >> Software >> MultiPHP Manager >> PHP Handlers2) Click on the edit button of the particular PHP version for which you need to change the PHP Handler. 3) Select the proper PHP handler and Click on Apply button to save the changes.
Note: If you couldn’t find any of the PHP Handlers in the list, you can easily install it from cPanel WHM >> Home >> Software >> EasyApache 4 or via command line using “yum install module_name”.
The module details are given in the table below.
PHP Handler
Module Name
CGI
ea-apache24-mod_cgi or ea-apache24-mod_cgid
FastCGI
ea-apache24-mod_proxy_fcgi
SuPHP
ea-apache24-mod_suphp
DSO
ea_php5x_php
command line:
Check the current PHP configuration of your server:
You can check the current PHP configuration using the following script:
Above details shows that the other PHP handler available on the server for PHP 5.5 is CGI. So, in this example we will change the PHP handler of PHP version 5.5 from SuPHP to CGI using the command given below.
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.
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:
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.
While checking the exim logs if you are getting "timeout" error then you should check the port as below -
1) IN to OUT port check-
[root@ns1 ~]# telnet mail.xxx.com 25
Trying 1.2.3.4...
Connected to mail.xxx.com.//you will get time-out here
Escape character is '^]'.
220 host.xxx.net ESMTP Postfix
2)Out to IN port check
check with url http://ping.eu
3)Make sure the ports 25,465,587,110 are open for server x.x.x.x on both side.
Replace the "123*" entry with a prefix of what your files within this directory start with. This is a safeguard so you do not use the command incorrectly and delete files you are not supposed to. Ensure you are careful with the directory that you enter in this command because we do not generally recommend mass deletion of files.
2)find ~/user/images/* -maxdepth 1 -type f | wc -l
It will show you the count of images present under specified folder.
3) root@host [/newdata/active_images]# cat rm.php
// Specify the target directory and add forward slash
$path = "images/";
// Loop over all of the files in the folder
foreach(glob($path ."*") as $file) {
unlink($file); // Delete each file through the loop
}
?>
=> This script delete all files present under image folder.
If your server is having cpanel , you should open following ports in firewall
---
20,21,25,26,43,53,80,110,143,443,465,873,993,995,2083,2082,2086,2087,2095,2096,3306,2089
--
Not able to send mails to particular email id only x@xxx.com and getting following logs -
2015-02-17 15:23:39 [3230] 1YNeqU-0000q1-No ** x@xxx.com F= P= R=dkim_lookuphost T=dkim_remote_smtp: SMTP error from remote mail server after initial connection: host x1x.xxx.com [192.8.186.129]: 554 x1x.xxx.com Solution - 1)check hostname file. 2)Make sure that you have setup RDNS for the MX record.
For suphp you should have 644 permissions to all file and 755 permission for directories.
If not then you can modify it with below commands -
--------------------------------------------
find . -type f -exec chmod 0644 {} \;
find . -type d -exec chmod 0755 {} \;
--------------------------------------------