Nameserver error while trying to add a domain
Posted by Unknown at 07:42 0 commentsThe system will allow users to create parked/addon domains if the nameserver IP is listed in this file.
Error : You cannot unpark a user’s main domain name
Posted by Unknown at 06:50 0 commentsIssue :
While trying to delete a parked domain , you might get the following error :
Error from park wrapper: You cannot unpark a user’s main domain name.
Fix :
Just go to the following location :
cd /var/cpanel/userdata/username/
vi main
Delete the ‘ServerAlias’ entry corresponding to the domain you want to remove.
Now you should be able to remove the parked domain through the control panel.
How do i fix the error “License File Expired” ?
Posted by Unknown at 06:10 0 commentsIf it is not, please contact who you purchase the license from directly.
If it says it is valid, try the following as root via SSH:
# rdate -s rdate.cpanel.net
# /usr/local/cpanel/cpkeyclt
Changing multiple account ownerships via SSH
Posted by Unknown at 13:54 0 commentsIssue:
How to change the ownership of multiple accounts under /home via SSH? The option in WHM is a bit tedious.
Solution :
To change the ownership of all accounts to the respective user.user :
cd /home
ls -al | grep rootfor i in `ls /var/cpanel/users/`; do chown $i:$i /home/$i ; done
for i in `ls /var/cpanel/users/`; do chown -R $i:$i /home/$i/* ; doneThen change the ownership of the individual public_htmls to their respective user.nobody:
for i in `ls /var/cpanel/users/`; do chown $i:nobody /home/$i/public_html ; done
Change the permissions for public_htmls to 750:
for i in `ls /var/cpanel/users/`; do chmod 750 /home/$i/public_html ; done
Fix the permissions for mail to work fine:
/scripts/mailperm
Fix the ownership of /home:
chown root.root /home
Fixing a Suddenly “Broken” cPanel Installation
Posted by Unknown at 13:09 0 commentsHow do I know it’s broken?
It’s usually pretty obvious, but when you get error every time you open cPanel or WHM, or get perl errors when you try to run any of the scripts in /scripts, accompanied by a slew of errors in the cPanel error log (/usr/local/cpanel/logs/error_log), it’s clear that cPanel and/or Perl is malfunctioning.
The good thing is, cPanel and Perl can usually be fixed rather easily.
First things first, if you’re just getting a simple Perl error, you may just be missing a couple Perl modules. Take for example an error that looks like this:
Can't locate IPC/Open3.pm in @INC (@INC contains: /scripts /usr/local/cpanel /usr/local/lib/perl5/5.8.8/x86_64-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .) at /scripts/pkgacct line 22.
BEGIN failed--compilation aborted at /scripts/pkgacct line 22.
This references a Perl module that does not exist, in which case you can just install it. The name of the Perl module is indicated in the error, just replace the slash with double-colons and pass it through /scripts/perlinstaller :
/scripts/perlinstaller IPC::Open3
If that fixes the problem, great…you may have to do this a couple more times for other perl modules. But you know there’s a REAL problem when the Perl installer fails, or the perl module is made by cPanel and doesn’t exist in the standard CPAN repos. In that case, you may need to resync the cPanel scripts.
First, run the following command to get your cPanel version branch:
cat /usr/local/cpanel/version
This should return something like 11.24.5-STABLE_38506, indicating that the branch is STABLE. Other branches indicated could be RELEASE, CURRENT, BETA, or EDGE. Use this branch to download the scripts folder from the cPanel repo. The below example is for STABLE:
wget -O scripts.tar.bz2 http://httpupdate.cpanel.net/cpanelsync/STABLE/scripts.tar.bz2
tar -xvC / -j -p -f scripts.tar.bz2
chmod 755 /scripts/cpanelsync
/scripts/cpanelsync httpupdate.cpanel.net /cpanelsync/STABLE/scripts /scripts
/scripts/upcp –force
Problem still not fixed? Try reinstalling Perl:
cd /usr/src
wget http://layer2.cpanel.net/perl588installer.tar.gz
tar -xvzf perl588installer.tar.gz
cd perl588installer
./install
Then run /scripts/upcp –force again to reinstall the cPanel files
Installing DomainKeys and SPF Records
Posted by Unknown at 02:51 1 commentsYou’ll want DomainKeys and SPF records if your users have trouble sending email to certain providers, or they are having issues with spoofed (forged) email. CPanel currently allows two easy ways for you or your users to set up email verification. This is supported at least from cPanel 11.18 onward.
User-Level:
You can enable the “Email Authentication” feature in WHM ~> Feature Manager, which will enable the Email Authentication icon in the users’ cPanels where they can create DomainKeys and SPF records for their domain(s).
Root-level:
There are scripts in /usr/local/cpanel/bin that can install these on a per-user basis:
/usr/local/cpanel/bin/domain_keys_installer $user
/usr/local/cpanel/bin/spf_installer $user
(and corresponding scripts to remove, like spf_uninstaller and domain_keys_uninstaller)
If you want to hit up everyone on the server, you can run my for loop one-liner:
for user in `ls -A /var/cpanel/users` ; do /usr/local/cpanel/bin/domain_keys_installer $user && /usr/local/cpanel/bin/spf_installer $user ; done
Now what about new users? cPanel already though of that, and has options to create hooks for when after an account is created. To set up the server to automatically create an SPF record and DomainKey for new accounts, edit /scripts/postwwwacct and paste in the following code:
#!/usr/bin/perl
my %OPTS = @ARGV;
$ENV{USER} = “$OPTS{‘user’}”;
system q(/usr/local/cpanel/bin/domain_keys_installer $USER);
system q(/usr/local/cpanel/bin/spf_installer $USER);
To verify an SPF record and/or DomainKey, you can run a DNS check:
dig default._domainkey.$domain TXT
dig $domain TXT
A technical note about DKIM:
You might know that DKIM is actually a generated key pair, similar to an SSH or SSL Certificate’s RSA key. CPanel stores these files in /var/cpanel/domain_keys, where thepublic folder contains the key reflected in the DNS zone, and the private folder contains the private key. You may have users that actually authenticate via DKIM in their mail clients, in which case you may need to provide them with the private key in order for them to sent email.
Unable to delete an email account from cPanel
Posted by Unknown at 01:15 1 commentsError Message:
The e-mail address postmaster@mydomain.com deleted successfully.
Sorry, you do not have access to the domain mydomain.com
The error message is displayed when you delete an email account of a domain from cPanel >> ‘Email Accounts’ that is either shifted under another users account OR usually happens when a domain is swapped from add-on domain to main domain OR vice-versa. In this case, you have to manually remove the email account entries for domain mydomain.com from the existing account.
The files you need to remove the entries from are
/home/user/etc/domainname.tld/passwd
/home/user/etc/domainname.tld/shadow
/home/user/.cpanel/email_accounts.yaml
The directory that need to be removed is
/home/user/mail/mydomain.com
where, ‘user’ is the one under who’s account the email address of ‘mydomain.com’ exist.
Installation of cpanel in the server
Posted by Unknown at 20:41 0 commentsmkdir /home/cpins
cd /home/cpins
wget http://layer1.cpanel.net/latest
sh latest
Fatal! Write Failure: /etc/valiases/domain.tld
Posted by Unknown at 00:13 0 commentsYou may see error “Fatal! Write failure” error message while adding email forwarders OR setting a catchall email address from cPanel >> “Email Accounts” section. The error is:
Fatal! Write Failure: /etc/valiases/domainname.tld. Ignore any messages of success this can only result in failure!
The reason is the /etc/valiases/domainname.tld file is missing OR having incorrect permissions. In order to correct the valiases file, ssh to your server as root and create the file with the appropriate permissions:
# cd /etc/valiases/
# touch domainname.tld
# chown user.mail domainname.tld
# chmod 644 domainname.tld
Once the valiases file is created for the user with appropriate permissions, you will be able to add email forwarders and catchall email address from cPanel again.
Reinstalling Webmail
Posted by Unknown at 18:47 0 commentsRoundcube:
/usr/local/cpanel/bin/update-roundcube –force
Horde:
/usr/local/cpanel/bin/update-horde –force
or
/scripts/fullhordereset
Squirrelmail
/usr/local/cpanel/bin/update-squirrelmail –force
110 Can’t open SMTP stream
Posted by Unknown at 05:48 0 comments/usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
I just changed:
$useSendmail = false;
to:
$useSendmail = true;
(around line 33)
This will probably get written over with the next cpanel update, but it at least helps get my users sending mail again for
cPanel Updates on Redhat 9 Can Break Stuff
Posted by Unknown at 12:18 2 comments…until you run a cPanel update and find that something doesn’t work right. From what I’ve seen, cPanel updates on Redhat 9 servers tend to break either FTP or IMAP, causing Webmail not to work. You may see errors like this:
HORDE: Login failed because your username or password was entered incorrectly.
SquirrelMail: ERROR: Connection dropped by IMAP server.
RoundCube: Unexpected condition from IMAP server, closed or corrupt connection to IMAP. Possible mailbox corruption.
To resolve this, you need to reinstall the fam package. You can do this by running:
rpm Uvhhttp://archive.download.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/fam-2.6.8-9.i386.rpm
For FTP, try reinstalling the RPM, or downgrading to the previous version:
???rpm -Uvh http://httpupdate.cpanel.net/ftpinstall/pure-ftpd/redhat/9/pure-ftpd-1.0.27-1.tls.i386.rpm
If that doesn’t work, you can go to http://httpupdate.cpanel.net/ftpinstall/pure-ftpd/redhat/9/ and keep installing the previous version down until you find the one that works on your server.
Simple steps of changing your exim IP
Posted by Unknown at 06:10 7 commentsIf you are in the danger of getting your main server IP block by SpamCop because you had a few anoying spamers abusing your server then you could simply change your exim mailserver IP to avoid the effect of your main IP beeing blacklisted…………
Below are some simple steps of changing your exim IP
Inside both incoming and outgoing exim mail server you will need to add an interface :
so just edit
pico /etc/exim_outgoing.conf
and
pico /etc/exim.conf
find
remote_smtp:
driver = smtp
and add interface = ip.you.want.to.use
example as shown below:
________________________
remote_smtp:
driver = smtp
interface = 22.22.22.22
_________________________
IP needs to be on server in order for this to work, hopefully this will help
BTW: Just a reminder – If there is an exim update when you upgrade your cpanel server you will need to re-enter the interface again
Cannot send emails- RoundCube just shows “Sending Message”
Posted by Unknown at 13:03 0 commentsProblem with Roundcube, installed when updated to newest CURRENT release. – Page 3 – cPanel Forums:
vi /usr/local/cpanel/base/3rdparty/roundcube/config/main.inc.php
and changed
$rcmail_config['smtp_user'] = ‘%u’;
to
$rcmail_config['smtp_user'] = ”;
How to install Zend Optimizer on a cPanel server?
Posted by Unknown at 00:16 0 commentsHow to install Zend Optimizer on a cPanel server?
cPanel offers ‘phpextensionmgr’ script through which you can install various extensions. To list the available PHP extensions, execute the command as root
root@LHS [~]# /scripts/phpextensionmgr list
Available Extensions:
EAccelerator
IonCubeLoader
Zendopt
SourceGuardian
PHPSuHosin
To list the available Options and Actions, execute
root@LHS [~]# /scripts/phpextensionmgr –help
Usage:
phpextensionmgr [options] [action] [extension]
Options:
–help Help message
–prefix Installation prefix for PHP (normally /usr/local or /usr/local/php4)
Actions:
install Install or update the extension
uninstall Uninstall the extension
status Display the installation status of the extension
list Show available extensions
To install Zend Optimizer, execute the command
root@LHS [~]# /scripts/phpextensionmgr install Zendopt
To verify whether Zend Optimizer is installed, execute:
root@LHS [~]# php -v
You can install the other available extensions using the same command, just replace ‘Zendopt’ with the extension name you wish to install.
Modifying SMTP Relay Settings for Exim
Posted by Unknown at 06:25 0 commentsBy default on all cPanel servers, authentication is required to send email via SMTP. Exim lets you authenticate two ways:
- Directly through SMTP with a valid username/password
- Through POP3 login, which allows the user to relay through the mail server for 30 minutes without re-authenticating
To always force SMTP authentication regardless of POP authentication, type the following command via SSH as root:
/usr/local/cpanel/bin/tailwatchd –disable=Cpanel::TailWatch::Antirelayd
To reverse this setting back to the default:
/usr/local/cpanel/bin/tailwatchd –enable=Cpanel::TailWatch::Antirelayd
You can alternatively disable/enable Antirelayd in WHM > Service Manager.
It’s generally not a good idea to allow open relaying through your mail server unless you want to get blacklisted. There may be situations where you need to permanently let another server send mail through your server without authentication, in which case you can add their IP to /etc/alwaysrelay . A post in the cpanel forums suggests an alternate solution as well:
In WHM > Exim Configuration Editor > Advanced Editor, find this section:
accept hosts = +auth_relay_hosts
endpass
message = $sender_fullhost is currently not permitted to \
relay through this server. Perhaps you \
have not logged into the pop/imap server in the \
last 30 minutes or do not have SMTP Authentication turned on in your email client.
authenticated = *
Appended to this suggestion is changing:
accept hosts = +auth_relay_hosts
to
accept hosts = /etc/exim_smtp_whitelist
There are minor tweaks you can make to exim.conf to remove SMTP authentication altogether, but you won’t find that information here. We don’t want to encourage bad mail server setup that will make the SPAM problem on the Internet even worse.
You can test to see if your server is open relay by sending an email via Telnet and getting a 550 error:
:~$ telnet thecpaneladmin.com 25
Trying 69.174.52.38...
Connected to thecpaneladmin.com.
Escape character is '^]'.
220-thecpaneladmin.com ESMTP Exim 4.69 #1 Tue, 23 Feb 2010 20:37:54 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
helo thecpaneladmin.com
250 thecpaneladmin.com Hello myserver.com [x.x.x.x]
mail from: admin@thecpaneladmin.com
250 OK
rcpt to: test@test.com
550-vaoffice.inmotionhosting.com (thecpaneladmin.com) [68.106.154.170] is
550-currently not permitted to relay through this server. Perhaps you have not
550-logged into the pop/imap server in the last 30 minutes or do not have SMTP
550 Authentication turned on in your email client.
aquota.user: Permission denied
Posted by Unknown at 11:42 0 commentstouch: cannot touch `/aquota.user': Permission denied
This generally occurs when performing any function where the quota system is being modified, such as changing an account’s quota, suspending/unsuspended an account, or running one of cPanel’s quota scripts. First, check the permissions of /aquota.user (or the actual quota file being referenced in the error):
lsattr /aquota.user
It should ideally return this output:
------------- /aquota.user
If you see an ‘i’ in there though, it means that for some reason the quota file has been made immutable, and therefore cannot be modified by the system. You can remove the immutable flag by running:
chattr -ia /aquota.user
That should correct the problem, and allow you to proceed with the account function you were trying to perform.
Cpanel- How can we solve the problem "Unable to login FAQMasterFlex admin area" ?
Posted by Unknown at 18:41 0 commentsThis might be due to 'register globals =off'. Because of that, the server variables must be expli
citly pulled into the script in order for the authentication to work. Add the following two state
ments to admin_authorize.php, just above the "if" statement that tests their values:
$PHP_AUTH_USER = $_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW = $_SERVER['PHP_AUTH_PW'];