Search For Answers
What type of Control Panels are in use on your Network
Last updated: April 25, 2011
The majority of our clients use WHM/cPane, l which is available for $10 a month.
What is WHM?
Last updated: March 28, 2011
WebHost Manager (WHM) is a browser based tool used by system administrators and resellers to manage services and aspects of the server that would usually require command line interaction. It is also used to create and manage hosting accounts on a web server. WHM listens on ports 2086 and 2087 (secure) by default.
Usually WHM is access using the root account but WHM is also accessible to users with reseller privileges. Reseller users of WHM have a smaller set of features than the root user, generally defined by the server administrator. These features usually only affect the resellers customers accounts rather than the server as a whole. From WHM, the server administrator can perform maintenance operations such as compile Apache and upgrade RPMs installed on the system as well as add, suspend or terminated reseller or individual accounts.
What is cPanel?
Last updated: March 28, 2011
There are two answers to this simple question!
1) cPanel is the company that creates WHM/cPanel software
2) cPanel is a browser based interface to allow the user to control the aspects of their domain such as email and FTP accounts, view their stats and even edit code through the built in file manager. Every account made through WHM will have a cPanel interface.
How do I enable Spam Assassin in cPanel?
Last updated: March 28, 2011
Spam Assassin is an excellent way to filter out spam at the server level before it gets to your mail client.
To enable it in cPanel:
From the Mail section on the main page click on the Spam Assassin icon.
Then click on the Enable Spam Assassin button.
That's it.
Now that Spam Assassin is enabled there are two methods to getting it get rid of all that spam
1) Auto Delete
This is the default method and is what is enabled when you turn on spam assassin.
To change the threshold that Spam Assassin uses to determine what spam score is required to auto delete a message just change the number in the Filters section.
5 is the default and is pretty conservative. If you want you can set it to a higher number like 7 to allow more possible spam through and then look at the spam score listed in the header of and spam you get to see what would be a good final setting for you.
2) Disable Auto Delete and use Filters
If you want more control over how spam is managed at the server level you've got it!
First disable auto delete on the spam assassin main page. This means spam assassin is monitoring the spam coming through the server, adding it's spam score headers to the emails but not doing anything else. This is where filters come in.
Go back out to the cPanel main page by clicking the home link near the top of the page.
From the Mail section on the main page click on the Account Level Filtering icon.
Here you have lots of control over how the system deals with spam and you can set up multiple levels of filters so you can delete all spam with a score of X and then route all spam with a score of Y-Z to a separate holding email account. This lets you have a buffer zone so stuff you are sure is spam with a high rating the server deals with and emails that are in that not sure range you can still review but are not mixed in with your other email!
To get started click on the Create a New Filter button.
To set up the filter to delete spam with a rating of 7 or greater first name this new rule something like Spam Assassin delete at 7
For Rules
Change the From drop down to Spam Bar.
Change the Equals drop down to Contains.
In the field below those enter 7 plus signs like this:
+++++++
In the Actions section make sure it is set to Discard Message.
Click the Activate button.
Now all spam with a score of 7 or greater will automatically be discarded.
Next if you want to create that buffer zone discussed earlier just make a new filter to manage that.
For Rules
Change the From drop down to Spam Bar.
Change the Equals drop down to Contains.
In the field below those enter 4 plus signs like this:
++++
In the Actions section set it to Redirect to Email and enter an email account on your domain. Do not send these messages to an off server email address as doing so could get your mail server blacklists as a spam source!
Click the Activate button.
Note!: If setting up a unique email account to send these possible spam messages to do not use the word spam in the name of the mail account as it will not work. Also if you would rather filter the possible spam via your mail client rather than using a filter onthe server you can do that to. Just skip adding the second filter and then configure your mail client to filter those emails. Most mail clients have rules that lets you filter by content in the header of the email. If you look at an email that comes into your inbox after you have enabled spam assassin you can see the custom headers and set rules based on that content.
That's it!
You now have set up a domain wide spam filtering system.
How do I install WordPress in cPanel?
Last updated: March 28, 2011
Installing wordpress in a domain managed by cPanel is done in four easy parts. We will walk you through each and explain what we do and why for each step.
1) Get the files onto your server.
2) Set up the database.
3) Modify the config file.
4) Run the installer from a browser.
1) Get the files onto your server.
First you will download the latest version of wordpress to your computer.
It will be a zip file that contains all the files for WordPress. You then need to get those files onto your server and there are a few ways to do this. If you wish your WordPress install to be at the root of your website example.com then the location for the WordPress files will be right in public_html. If you want the install to be in a sub directory like example.com/blog then put them in public_html/blog and if that directory does not exist then you would need to create it in public_html.
Do one of the following:
a) Open the zip archive on your computer. A folder will appear called wordpress containing all the WordPress files. Using an FTP client upload those files to the location you wish to install WordPress.
b) Open the zip archive on your computer. A folder will appear called wordpress containing all the WordPress files. Using the cPanel File Manager upload those files to the location you wish to install WordPress.
c) Upload the zip archive to your server using an FTP client of the cPanel File Manager and contact your web host to have them unpack the archive for you. Make sure to let them know where you want the files installed.
2) Set Up the Database
In cPanel's main page scroll down to the Databases section and click on the MySQL databases link.
Here you will create a database and a new user for that database. Sounds complicated but it's just a few clicks!
First a little important info on how cPanel names databases and users. Since in a cPanel environment there are multiple domains and accounts on the server the way cPanel keeps track of which databases and which database users are associated with a specific domain is with a prefix. It auto-generates this prefix on any database name and database username you create. This means that if your cPanel account name is monkey then any database you create in cPanel and any database user you create in cPanel wil have that prefix like this:
monkey_databasename
monkey_databaseuser
You need to keep that in mind for later when you set up the configuration file for WordPress as it's a common mistake to leave off the prefix there and then when trying to install WordPress cannot connect to the database.
OK Enough of the background and on to the good stuff.
On the cPanel MySQL databases page you will see a Create New Database section right near the top. There will be a field for you to enter your database name (see the prefix cPanel is letting you know will be added?). Enter the name for your database here and click Create Database.
You should get a confirmation that the database has been created. Click the Go Back link.
Now you need to add a database user.
In the MySQL Users section enter a username (7 character max!). Then enter a password, and again. Make it a decent password! 8 or more characters with some capitals, numbers and puntuation marks for good measure. Make sure you remember this password as you will need it later.
Click Create User.
You should get a confirmation that the user has been created. Click the Go Back link.
OK now notice in the current databases and current users sections your database and user are listed and they have that pesky prefix! Write down or cut and past both of those somewhere as you will need those later (With the prefix!)
Now you need associate that user with the database and give it the correct privileges.
Near the bottom of the MySQL Databases page the is the Add User to Database section.
Select your new user from the User drop down and then select your new database from the Database drop down and click Add.
Your next page is the Manage USer Privileges page. Click the All Privileges checkbox at the top of the table.
Click Make Changes.
You should get a confirmation that the user has been added to the database. Click the Go Back link.
Whew! OK well that wasn't so bad. Now you are ready for the next step.
3) Modify the config file.
The configuration file for wordpress is called wp-config.php and when you first upload the WordPress files this file does not exist yet but don't freak out! The nice folks at WordPress provide a sample file for you called wp-config-sample.php.
Using a FTP client or the File Manager in cPanel make a copy of this file and call it wp-config.php.
Now open that wp-config.php file in an editor. Some FTP clients allow you to edit remote files or you can use the File Manager in cPanel.
The file is not very big and there are only a few edits you need to make.
Look for the three lines where you will add your database name, the MySQL user for that database and that user's password.
They look like this:
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');
/** MySQL database username */
define('DB_USER', 'username_here');
/** MySQL database password */
define('DB_PASSWORD', 'password_here');
Now since you just created the database and the user fill that info in (remember to use the prefix!) and then fill in the password. You wrote it down in the steps above right?
Make sure you did not accidentally delete on the of the ' marks on each side of the data you entered.
Ok now save the file and you are almost there!
4) Run the installer from a browser.
In a browser you now need to do the final step that ties it all together and actually does the install.
What you will do is point your browser to the installer page and the location of that page depends on where you uploaded your WordPress install. If you put the WordPress files at your site root in public_html then that page will be here:
example.com/wp-admin/install.php
If you installed in a folder with a name like blog then the install page will be here:
example.com/blog/wp-admin/install.php
Go to that page in a browser.
You should see the WordPress installation configuration page.
Enter your Site's title.
Enter your Username. This will be a unique name and will be the initial admin for the site. (Does not need to be the same as any other username you used to get this far)
Enter a password twice. Make it a good one as people will likely get in if you use a simple one.
Enter your email address.
Click the Install Wordpress button.
If all went well and you did everything correctly you will presented with a Success! page and a login button.
Now comes the part we can't help you with and that's filling your site with great content!
cPanel installing Ruby
Last updated: March 28, 2011
Ruby is an object-oriented programming language. Please note that this install references a server with the cPanel control panel already installed.
From the command line:
[root@host /]# /scripts/installruby
[root@host /]# /usr/local/cpanel/bin/ror_setup
[root@host /]# ruby -v
ruby 1.8.7 (2009-06-08 patchlevel 173) [x86_64-linux]
Package Management
[root@host /]# gem help
RubyGems is a sophisticated package manager for Ruby. This is a
basic help message containing pointers to more information.
Usage:
gem -h/--help
gem -v/--version
gem command [arguments...] [options...]
Examples:
gem install rake
gem list --local
gem build package.gemspec
gem help install
Further help:
gem help commands list all 'gem' commands
gem help examples show some examples of usage
gem help platforms show information about platforms
gem help <COMMAND> show help on COMMAND
(e.g. 'gem help install')
gem server present a web page at
http://localhost:8808/
with info about installed gems
Further information:
http://rubygems.rubyforge.org
Rub on Rails will now also be an available option through the cPanel control panel under Software / Services.
New Relic for PHP w/cPanel
Last updated: April 22, 2011
This article was created in relation to our 64-bit VS product line by following detailed instructions from New Relic at http://support.newrelic.com/kb
Getting started
Download the latest php_agent-linux-version.tar.gz from http://download.newrelic.com/php_agent/release/ using wget and then unpack it.
root@example [~/]# wget http://download.newrelic.com/php_agent/release/php_agent-linux-1.2.1.528.tar.gz
root@example [~/]# tar -zxpf php_agent-linux-1.2.1.528.tar.gz
Install the daemon from one of the following directories
root@example [~/php_agent-linux-1.2.1.528]# cd daemon-
daemon-i686/ daemon-x86_64/
Note: identify 32-bit or 64-bit with the command uname -i
root@example [~/php_agent-linux-1.2.1.528]# cp daemon-x86_64/newrelic-daemon /usr/bin/newrelic-daemon
root@example [~/php_agent-linux-1.2.1.528]# cp newrelic-daemon.init.redhat /etc/init.d/newrelic-daemon
root@example [~/php_agent-linux-1.2.1.528]# chmod 755 /etc/init.d/newrelic-daemon
Prepare the configuration
root@example [~]# mkdir /etc/newrelic
root@example [~]# mkdir /var/log/newrelic/
root@example [~]# touch /var/log/newrelic/newrelic-daemon.log
Add the following to your configuration
root@example [~]# vi /etc/newrelic/newrelic.cfg
license_key =
pidfile = /var/run/newrelic-daemon.pid
logfile = /var/log/newrelic/newrelic-daemon.log
loglevel = info
collector_host = collector.newrelic.com
ssl = no
trace_rpm_calls = false
Now install the agent from one of the following directories
php-5.1/ php-5.2/ php-5.3/
Note: identify your php version with the command php -v and don't forget the corresponding 32-bit or 64-bit directory structure.
Backup your PHP configuration
Note: Identify php.ini location with the command php -i |grep php.ini
Then Include the following (under extensions)
extension=newrelic.so
newrelic.appname = PHP Application
newrelic.enabled = 1
newrelic.logfile = /var/log/newrelic/php_agent.log
newrelic.loglevel = WARNING
Start the service and restart apache
New Relic RPM Monitoring: Enabled
New Relic Version: 1.2.1.528
Installing cPanel & WHM
Last updated: May 19, 2011
Licensing
cPanel licensing is available for $10/Month or $120/Year and may be licensed upon request simply by issuing a support request through our dashboard.
Once your ip address is licensed you may execute /usr/local/cpanel/cpkeyclt from the command line to activate your license if cPanel is already installed.
Installation
DO NOT PERFORM IF YOUR VS IS SERVING CONTENT.
* cPanel requires a fresh/clean server and will overwrite your current configuration.
From the command line you will navigate to the /home directory, download the install file and execute the installation process as follows:
root@example [/]# cd /home
root@example [/home]# wget layer1.cpanel.net/latest
root@example [/home]# sh latest
Getting started - Initial setup
Webhost Manager (WHM) will now be accessible through your ip address over port :2087 and you may now proceed through the Initial Setup Wizard.
WHM Interface: https://youripaddress:2087/
Username: root
Password: [root password]
This Connection is Untrusted: This is simply because a self-signed certificate is installed by default. Should you prefer a signed certificate please open a support request through our dashboard.
Step 1 - Agreement
- Please read the license agreement. This will need to be accepted in order to proceed.
Step 2 - Setup Networking
- Server contact email address is a required field on initial setup. The rest of the contact information may be defined as desired, left empty or modified at a later date.
- Hostname should already be defined (default) and is based on the hostname of your virtual server.
- Both resolvlers [primary and secondary] should already be defined for you by default.
- Main Network/Ethernet Device (default)
Step 3 - Setup IP Addresses
- You may use default settings simply by proceeding to the next step.
Step 4 - Nameservers
- BIND should be default and may be preferred, but ulmately your choice unless you intend to manage DNS remotely then this service may be disabled.
- Custom [NS1/NS2] nameservers should already be defined based on your hostname.
- Add an 'A' entry for each nameserver and your hostname. This will typically be the same ip address of your virtual server unless you will be managing a cluster.
Step 5 - FTP Configuration
- Pure-FTPd should be default and may be preferred, but ultimately your choice unless you would like FTP services disabled.
- While courier was a more traditional and reliable choice, dovecot is now default whereas the choice is yours unless mail services are not required and may be disabled if desired. If courier is chosen it will then install by proceeding to the next step.
- Enabling convert mailbox format should be enabled by default and may be preferred.
- cPHulk is enabled by default, but may be disabled if you intend to install a more thorough firewall such as APF or CSF.
Step 6 - Quotas
- Using the file system quotas should be default.
If you are seeing trial license in the top left corner you will need to activate your cPanel license once your ip address has been licensed by executing /usr/local/cpanel/cpkeyclt from the command line.
Fine tuning cPanel & WHM
Last updated: May 19, 2011
Fine tuning cPanel & WHM
The following is based on a fairly generic cPanel environment and is only for reference. Understanding what is being enabled or disabled is avdised before making a decision.
Once logged into WebHost Manager (WHM) through https://youripaddress:2087/ as the root user (username: root); You may then relate to the following actions from the left-hand column.
Server Configuration -> Update Preferences
- cPanel/WHM Updates: STABLE Builds (Automatic)
- cPanel Package Updates: Automatic
- Operating System Package Updates: Automatic
- SpamAssasin Rules Updates: Automatic
When your prefered update settings have been chosen and saved you may then execute /scripts/upcp --force from the command line to run the update.
Upon completion return to your browser and refresh then proceed.
Server Configuration -> Tweak Settings
Refer to [?] for a detailed description of each setting.
- Mail - Initial default/catch-all forwarder destination: FAIL
- Mail - Track email origin via X-Source email headers: ON
- Mail - Max hourly emails: 250
- Mail - Prevent “nobody” from sending mail: ON
- Mail - Enable RoundCube webmail: OFF
- Stats Programs - Enable Awstats stats: ON
Security Center -> Apache mod_userdir Tweak
- Enable mod_userdir Protection
Security Center -> Password Strength Configuration
- Default Required Password Strength: 65
Security Center -> PHP open_basedir Tweak
- Enable php open_basedir Protection.
Service Configuration -> Apache Configuration -> Global Configuration
- TraceEnable: OFF
- ServerSignature: OFF
- ServerTokens: ProductOnly
- FileETag: NONE
Save and rebuild the apache configuration for changes to take affect.
Service Configuration -> Exim Configuration Editor
- RBL: zen.spamhaus.org and bl.spamcop.net: ON
Service Configuration -> FTP Server Configuration
- Allow Anonymous Logins: NO
- Allow Anonymous Uploads: NO
- Allow Logins w/Root Password: NO
Service Configuration -> Service Manager
- Services may be enabled or disabled accordingly depending on your requirements.
System Health -> Background Process Killer
- Enable: bitchx, bnc, eggdrop, generic-sniffers, ircd, psyBNC
APC for cPanel
Last updated: June 20, 2011
Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.
Supported only when running in a persistent (DSO/FCGID) manner and not suPHP.
root@example [/]# /usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers: dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: dso
SUEXEC: enabled
Installation
root@example [~]# yum install pcre-devel -y
root@example [~]# pecl install apc
Once installed you should see similar to the following:
Build process completed successfully
Installing '/usr/include/php/ext/apc/apc_serializer.h'
Installing '/usr/lib/php/extensions/no-debug-non-zts-20060613/apc.so'
install ok: channel://pecl.php.net/APC-3.1.9
Extension apc enabled in php.ini
NOTE: Make sure it was installed in the correct location.
root@example [~]# grep extension /usr/local/lib/php.ini
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
In this example "apc.so" was installed to '/usr/lib/php/extensions/' whereas going by your php.ini's extension_dir it should be in '/usr/local/lib/php/extensions/' (missing /local/ in the path) and will need to be copied over accordingly.
To identify the location of your php configuration:
root@example [~]# php -i |grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
If not installed to the correct location, then copy "apc.so" to the correct location.
root@example [~]# cd /usr/lib/php/extensions/no-debug-non-zts-20060613/
root@example [/usr/lib/php/extensions/no-debug-non-zts-20060613]# cp apc.so /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
Make sure apc is enabled. If so confirm apahe is happy and then restart for changes to take affect.
root@example [~]# grep apc /usr/local/lib/php.ini
extension="apc.so"
root@example [~]# apachectl configtest
Syntax OK
root@example [~] service httpd restart
Configuration
Fine tuning for a production environment.
; Example APC Configuration
extension="apc.so"
apc.ttl=0
apc.stat=0
apc.shm_size=96M
apc.cache_by_default=0
apc.filters="+public_html"
Save your changes to the php.ini file and restart apache for changes to take affect.
Please see http://php.net/manual/en/apc.configuration.php for clarification on these parameters.
Monitoring APC
The following script "apc.php" is bundled with APC and can be copied to a docroot then viewed through a browser and it will provide a detailed analysis of the internal workings of APC.
root@example [~]# locate apc.php
root@example [~]# cd /usr ; find * |grep apc.php
NOTE: It may also be advised to copy the script to a password protected sub-directory.
To gain admin access the user/pass will need to be defined in the header of the script. If left by default the feature will be disabled.
defaults('ADMIN_USERNAME','apc');
defaults('ADMIN_PASSWORD','password');