Posts

Showing posts with the label cPanel

How to Create a WHM Privileged/Full Control User

Image
I have been working on WHM/cPanel service since long. Sometimes, we get request from our customer that they would like to manage their VPS fully/partially. In such cases, we can directly provide them root user access or we can provide some privileges access based on the requirement. Here, I shall describe how to achieve the goal. Step 1: Login to shell by using root account. Step 2: Create desired user. In this case it is newuser. You have to change the username as per your requirement. [root@vps ~]#useradd newuser [root@vps ~]#passwd newuser [root@vps ~]#usermod -aG wheel newuser [root@vps ~]#echo "newuser:all" >> /var/cpanel/resellers After performing the above operation, you will be able to login into the system using ssh and WHM. This “newuser” has the full privilege in the system. Suppose, you need a user with some privileged access. You may provide such permission following below procedure. Step 3: Login to WHM using root account Step 4: Se...

PHPMailer Email Sending Issue in cPanel

Issue: Suddenly, one of my cPanel based VPS customers raised an issue. They usually send emails by using PHPMailer in cPanel. An email address was configured to send emails. Recipient should be able to receive emails from that email address. Their server hostname is like vps.domain.com. Sender email address is set like alice@domain.com. While they are sending emails from the system, the recipient are being received the email form alice@vps.domain.com. It creates a problem of sender identity. Moreover, some email system blocked their email due to nonexistence of the domain vps.domain.com.  Solution: We analyzed the issue and came up with a solution forcing the PHPMailer to send emails using designated from address. We added a line in PHPMailer configuration as below. mail($mail_to, $subject, $mail_html, $headers, '-f alice@domain.com') After that we again sent the email and received the email using alice@domain.com.

Redirecting a Website from http to https in cPanel

It is very common to have SSL certificate in website now-a-days. In general, the website is configured to access using http and https both separately. It is a security hole to access such websites using http. For this reason, http to https redirection is required. It can be achievable in some ways. The most popular is using the .htaccess file. Step 1: Login to cPanel Step 2: Go to public_html under file manager. Step 3: Create a .htaccess file if it is already not created. Add below lines. RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Step 4: Save and close. Now, the website should be redirected from http to https.