Archive for April, 2010

How to Uninstall cPanel (no, not really)

April 22nd, 2010

You shouldn’t try to uninstall cPanel (reinstall your OS), and the cPanel “uninstall” script reenforces that:

# cat /usr/local/cpanel/uninstall

#!/bin/sh
# Uninstall script for Cpanel
rm -f "/usr/local/cpanel/uninstall"
#### END OF UNINSTALL
echo "Cpanel has been uninstalled."

Share

PHPInfo

April 22nd, 2010

PHPInfo pages can be useful when needing to verify what php modules are installed/loading properly, or to see which php.ini a site is using.

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

http://us3.php.net/phpinfo

Share

How to Install Fantastico

April 22nd, 2010

cd /usr/local/cpanel/whostmgr/docroot/cgi
wget -N http://files.betaservant.com/files/free/fantastico_whm_admin.tgz
tar -xzpf fantastico_whm_admin.tgz
rm -rf fantastico_whm_admin.tgz

Now login to WHM, and navigate to Fantastico De Luxe WHM Admin to continue your install.

If the install hangs, try again, but first increase the wget timeout. I see this happen quite a bit, unfortunately.

Share

WHMCS: Chunky Parser Error

April 22nd, 2010

This is caused by Display Errors in cPanel being set in Tweak Settings (or from /var/cpanel/cpanel.config, errortostdout=1). Uncheck that, which should resolve your issue.

Share

How to Install OpenVZ on a 64-bit Server

April 22nd, 2010

These are more of a note for myself than anything, so I don’t have to navigate through the docs to do an install. The more verbose install guide can be found here, and includes instructions for 32-bit architecture:

http://wiki.openvz.org/Quick_installation

#cd /etc/yum.repos.d
#wget http://download.openvz.org/openvz.repo
#rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
#yum install ovzkernel.x86_64

Verify the new kernel is set to boot in /boot/grub/grub.conf, then reboot into this new kernel.

Once you’re back online, edit /etc/sysctl.conf, adding/modifying the following values:

# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0

# Enables source route verification
net.ipv4.conf.all.rp_filter = 1

# Enables the magic-sysrq key
kernel.sysrq = 1

# We do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

# yum install vzctl.x86_64 vzquota.x86_64
# wget -c http://download.openvz.org/template/utils/vzyum/2.4.0-11/vzyum-2.4.0-11.noarch.rpm
# rpm -ivh vzyum*
#yum install vzpkg vzrpm43-python vzrpm44-python vzctl-lib

The installation is now complete, and you can download a CentOS OpenVZ image template to get you started.

#cd /vz/template/cache
#wget http://download.openvz.org/template/precreated/centos-5-x86_64.tar.gz

Share

Update 3Ware Firmware

April 22nd, 2010

1. Grab the tw_cli software, as well as the firmware for your RAID card from http://3ware.com/support/download.asp
2. Extract the firmare .zip file with “unzip”, then extract the tw_cli software and make it executable.

[root@vz ~]# tar -xvf tw_cli-linux-x86_64-x.x.x.tgz
#chmod +x tw_cli

3. Then you can update the firmware (this assumes that you’re doing so on the first array)

# ./tw_cli /c0 update fw=/root/prom0006.img

Warning: Updating the firmware can render the device driver and/or
management tools incompatible. Before you update the firmware,
it is recommended that you:

1) Back up your data.

2) Make sure you have a copy of the current firmware image so that
you can roll back, if necessary.

3) Close all applications.

Examining compatibility data from firmware image and /c0 ... Done.

New-Firmware Current-Firmware Current-Driver Current-API
------------------------------------------------------------------------
FE9X 3.08.00.029 FE9X 3.04.00.005 2.26.08.003-2.6.18RH2.06.01.006

Both API and Driver are compatible with the new firmware.
Recommendation: proceed to update.

Given the above recommendation...
Do you want to continue ? Y|N [N]: Y
Downloading the firmware from file /root/prom0006.img ...

4. Finally, reboot to enable the new firmware.

Share

How to Install cPanel DNSonly

April 22nd, 2010

Installing cPanel DNSonly should only be done on a fresh installation of a supported OS.

cd /home
wget http://layer1.cpanel.net/cpanel-universal-dnsonly-install.sea
sh cpanel-universal-dnsonly-install.sea
cd cpanel-universal-dnsonly-install
sh install

Share

cPanel and WHM Plugins / Addons

April 10th, 2010

I thought I’d put together a quick post with links to various cPanel & WHM plugins. I haven’t used all of these, so don’t consider this an endorsement of any kind. :) For now, check out the cPanel forums apps and plugins area which in you might find better reviews.

Eventually I’ll post a review of these (at least the free ones) as time allows.

Free WHM Plugins

  • ConfigServer.com Firewall – manages iptables, handles brute force attacks, and much more. This is one that I’ve used, and definitely recommend.
  • ConfigServer.com ModSec Control – modify ModSecurity rules on a global or per-user basis, and view logs.
  • NDCHost’s Clean Backups – clean backups for accounts which don’t exist after a certain period, automated, or on a manual basis.
  • NDCHost’s Account DNS Check – Checks and reports domains which don’t resolve to the assigned IPs in http.conf.
  • ConfigServer.com Explorer – provides a “File Manager-like” interface allowing you access to your filesystem via GUI.
  • ConfigServer.com Mail Queues – Stats and management of your server’s mail queue.
  • ConfigServer.com Mail Manage – Management of your email accounts, important statistics, and displays of accounts over quota, over a certain size, etc.

Pay WHM Plugins

  • ConfigServer.com’s eXploit Scanner – active scanning of your server to prevent exploits.
  • NDCHost’s Secondary MX – Turns a cPanel DNSonly install into a backup MX server.

Free cPanel Plugins

  • cPanel’s cPAddons – Allows installation of several popular PHP scripts. Installed via WHM >> Install cPAddons.

Pay cPanel Plugins

  • Netenberg’s Fantastico – Installs over 50 popular PHP scripts [List]. The vast majority are free, open-source software, though a few require a license.
  • Softaculous – over 130 PHP scripts.
Share

Locked out via iptables? Autofix it!

April 10th, 2010

If you’ve locked yourself out of your server via iptables, or made some incorrect updates to your sshd_config, but you can login via WHM, autofixer is about to be your best friend. If you can’t get into WHM, this is not going to be something you can utilize.

https://yourdomain.com:2087/scripts2/doautofixer?autofix=iptablesflush

This script will do a flush of your iptables chains, allowing you to login and correct your configuration.

https://yourdomain.com:2087/scripts2/doautofixer?autofix=safesshrestart

This will terminate your existing sshd daemon, and start SSH on port 22, or, if that’s your normal default port, it will start sshd on port 23, so you can login and make your corrections.

Other autofixer scripts are listed at http://httpupdate.cpanel.net/autofixer/ and can be run by inserting them after the following URL, after logging into WHM:

https://yourdomain.com:2087/scripts2/doautofixer?autofix=

Share

How to Install EAccelerator, IonCube, Zend Optimizer, SourceGuardian, and SuHosin outside of EasyApache

April 10th, 2010

Many don’t know that you don’t need to run EasyApache to install EAccelerator, IonCube Loader, Zend Optimizer, SourceGuardian, or SuHosin. Why waste your time?

You can use /scripts/phpextensionmgr to install or uninstall these modules!

# /scripts/phpextensionmgr list
Available Extensions:
EAccelerator
IonCubeLoader
Zendopt
SourceGuardian
PHPSuHosin

So, if you wanted to install Zend Optimizer, you’d run:

# /scripts/phpextensionmgr install Zendopt
Installing Zendopt
Determining PHP version
Installing Zend Optimizer binary
Activating Zend Optimizer in /usr/local/lib/php.ini
Zend Optimizer activated
Skipping install to /usr/local/php4, missing php.ini

Easy peasy. :)

Share

cPanel Web Site Hosting by IntraHost