WHM Scripts

Posted by Clayton | Posted in Tutorial | Posted on 07-18-2011

1

Did you know that if you have cPanel/WHM on your server, you also have a bunch of serverside commands that you can use?  These are good for advanced users, or the people who prefer to manage their servers in a hurry via the command line rather than waiting for a web interface to load.

Nearly everything that you can do in the WHM backend can be performed via command line.  These scripts are located in your server’s /scripts/ directory.  Only use scripts that have been verified by cPanel, or that you know yourself are safe as an unsafe script may damage your server.

Long list of scripts after the break…

cPanel 11.30

Posted by Clayton | Posted in Uncategorized | Posted on 05-12-2011

0

Just got this e-mail from cPanel ^_^

We are pleased to announce the release of cPanel & WHM 11.30

This release is available immediately in the EDGE and CURRENT release tier.  cPanel & WHM 11.30 will soon be available in all public release tiers.

This version includes:

• Over 600 maintenance and bug fixes
• Over 30 feature improvements and additions
• Over 150 product optimizations for performance and usability

For a full list of changes, please see our product change logs:

http://go.cpanel.net/changelog

In order to receive immediate notification of build availability, including updates for individual release tiers, please subscribe to our Releases Mailing List here:

http://go.cpanel.net/releaselist

To report concerns or issues related to your cPanel & WHM system, please contact our support team:

http://www.cpanel.net/support.html

For general discussions related to cPanel & WHM, please visit the official cPanel forums:

http://forums.cpanel.net/

cPanel is also very excited to announce our first ever formal partnership with CloudLinux.

To more effectively serve your needs, licensing for cPanel and CloudLinux can be done through one location.  We’re also offering direct support for CloudLinux in the event you’re in need of help.  By unifying our licensing systems and integrating direct support, we’ve made it easy for you to use cPanel with Cloudlinux.

Curious about how cPanel with CloudLinux will help you better serve your customers?  Visit http://go.cpanel.net/cl or contact cs@cpanel.net for more information.

Installing Perl on a cPanel server

Posted by Clayton | Posted in Linux, SSH, Tutorial | Posted on 05-07-2011

0

Installing/upgrading perl is a pretty straight forward task and is necessary for cPanel to function properly.

root@ohhai [~]# wget http://layer1.cpanel.net/perl588installer.tar.gz
root@ohhai [~]# tar -xvzf perl588installer.tar.gz
root@ohhai [~]# cd perl588installer
root@ohhai [~]# ./install

If I remember correctly, the install takes 25-30 minutes to complete depending on your server setup.

A few updates…

Posted by Clayton | Posted in TLN.com | Posted on 04-27-2011

0

I’ve finally found some time to start working on this site again. Changed the theme, made some entries to the /var/ section of the site, added twittergrid, and working on a few more cheatsheets. Check back for some more updates.

Cheat Sheets

Posted by Clayton | Posted in TLN.com | Posted on 02-22-2011

0

Added a list of cheat sheets that I’ve posted to the nav bar for easier searching. I will continue to update the list as I post more.

Internal Server Error — User is over quota

Posted by Clayton | Posted in Linux, SSH, Tutorial | Posted on 09-06-2010

1

Came across this issue at work where a client was receiving this message when trying to enter webmail, even though the e-mail account and cPanel account were not over quota.

Internal Server Error

User ‘useraccount’ is over quota.

This happens when the users ‘overquota’ status is cached and can be fixed by removing the users folder located at the following.

/var/cpanel/overquota/username

cPanel Port Usage

Posted by Clayton | Posted in Uncategorized | Posted on 08-20-2010

0

I came across this nice cheatsheet that lists all of the cPanel ports and what services they work with, so I figured I would post it up here for my own personal use, if no one else needs it.

Port Service Protcol In/out
20 FTP TCP Both
21 FTP TCP, UDP Both
22 SSH TCP Inbound
25 SMTP TCP Both
26 SMTP TCP Both
37 Rdate TCP Outbound
43 Whois TCP Outbound
53 DNS TCP, UDP Both
80 HTTP TCP Both
110 POP3 TCP Inbound
113 Ident TCP Outbound
143 IMAP4 TCP Inbound
443 HTTPS TCP Inbound
465 SMTP (TLS/SSL) TCP, UDP Both
873 Rsync TCP, UDP Outbound
993 IMAP4 (SSL) TCP Inbound
995 POP3 (SSL) TCP Inbound
2077 WebDAV TCP, UDP Both
2078 WebDAV (SSL) TCP, UDP Both
2082 cPanel TCP Inbound
2083 cPanel (SSL) TCP Inbound
2086 WHM TCP Inbound
2087 WHM (SSL) TCP Inbound
2095 Webmail TCP Inbound
2096 Webmail (SSL) TCP Inbound
3306 MySQL TCP Inbound
6666 Melange Chat TCP Inbound

VPN via the TUN/TAP device

Posted by Clayton | Posted in Linux, openvz, Tutorial, vps | Posted on 08-13-2010

1

I had a client contact me earlier this morning because one of their clients was receiving the following error on their VPS when trying to run OpenVPN.

Note: Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)
Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Cannot open TUN/TAP dev /dev/tun0: No such file or directory (errno=2)

I’ve never run into this issue before, but was able to find an awesome tutorial on the OpenVZ website.

First, make sure the tun module has been already loaded on the hardware node:

# lsmod | grep tun

If it is not there, use the following command to load tun module:

# modprobe tun

To make sure that tun module will be automatically loaded on every reboot you can also add it or into /etc/modules.conf (on RHEL see /etc/sysconfig/modules/ directory) or into /etc/sysconfig/vz-scripts/VEID.mount.

echo 'modprobe tun' /etc/sysconfig/vz-scripts/VEID.mount

Allow your container to use the tun/tap device by running the following commands on the host node:

vzctl set VEID --devices c:10:200:rw --save
vzctl set VEID --capability net_admin:on --save

And create the character device file inside the container (execute the following on the host node):

vzctl exec VEID mkdir -p /dev/net
vzctl exec VEID mknod /dev/net/tun c 10 200
vzctl exec VEID chmod 600 /dev/net/tun

Enter cat /dev/net/tun to test whether the TUN/TAP device is available:

  • If you receive the message cat: /dev/net/tun: File descriptor in bad state your TUN/TAP device is ready for use.
  • If you receive the message cat: /dev/net/tun: No such device the TUN/TAP device was not successfully created.

Enable NAT module for VPS can’t initialize iptables table `nat’: Table does not exist

Posted by Clayton | Posted in Linux, openvz, SSH, Tutorial, vps | Posted on 08-10-2010

2

I was getting the following error in a container on one of my nodes.

[root@server1 ~]# iptables -t nat -F
iptables v1.3.5: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
[root@server1 ~]# iptables -t nat -nvL
iptables v1.3.5: can’t initialize iptables table `nat’: Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

You can fix this by using the following commands.

[root@yoshi ~]# vzctl stop 150
[root@yoshi ~]# vzctl set 150 --iptables "iptable_nat iptable_filter iptable_mangle  ip_conntrack ipt_conntrack ipt_REDIRECT ipt_REJECT ipt_multiport  ipt_helper ipt_LOG ipt_state" --save
Saved parameters for VE 150
[root@yoshi ~]# vzctl restart 150
[root@yoshi ~]# vzctl enter 150
[root@server1 ~]# iptables -t nat -nvL
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination

cPHulk Brute Force Detection

Posted by Clayton | Posted in Linux, Security, SSH, Tutorial | Posted on 07-28-2010

1

Ever run into issues with typing in your root password, or forgot what you set it to, then got locked out of WHM? Well, here’s a quick and easy way to get your access back when receiving this error message.

This account is currently locked out because a brute force attempt  was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.

Run the following as root in SSH.

mysql cphulkd
mysql> delete from brutes;
mysql> delete from logins;