Posts Tagged “Cpanel”

If you are getting the following message, this basically means that your cPanel server’s Hostname is not properly setup and the server is failing to look it up;

IMPORTANT: Do not ignore this email.

The hostname (hostname.server.com) resolves to . It should resolve to xx.xx.xx.xx. Please be sure to correct /etc/hosts as well as the ‘A’ entry in zone file for the domain.

Some are all of these problems can be caused by
/etc/resolv.conf being setup incorrectly. Please check this file if you
believe everything else is correct.

You may be able to automaticly correct this problem by using the
‘Add an A entry for your hostname’ under ‘Dns Functions’
in your Web Host Manager

Until you correct this, you will constantly be bombarded with messages, so it’s probably best if you resolve this. But how you ask? Simple.

The first thing you need to do is log into your cPanel server and make sure the Hostname is a FQDN. By default its likely some random computer name or hosting account number if you rent / lease from a webhost provider. To this check this scroll down the left hand Functions Menu until you find the heading ‘DNS Functions’. Click on ‘Add an A entry for your hostname’. WHM will try to analyze your hostname and then present you with a button to click that says Add the entry, go ahead and click on that. WHM should automatically try to add the relevant A record for your hostname to the DNS zone present on your system. Best practice is to make the Hostname a subdomain of your FQDN, so for example if I wanted to do this for Keithdmitchell.com, I would make my Hostname cpanel.keithdmitchell.com or something to that affect. Then I would add an “A” record to my DNS zone pointing back to the server with the same IP address.

Once you have done this, log into your server via SSH / Shell and run the following command;

“/scripts/ipcheck”

If the hostname change was either incorrect or did not address the issue, you will receive an email stating that the hostname is still resolving incorrectly. This usually corrects the issue, but in the event it does not, you will want to also make sure that your name servers are also correct. To check your name servers, you will need to check your “/etc/resolv.conf” file. Open this up in a text editor such as Nano, Pico or VI and make sure that they have entries in them. They should look like the following;

search myserver (this should be your domain name, also may not be present in your config)

nameserver 98.59.5.1
nameserver 56.51.96.1
If you aren’t sure what you name server’s IP’s are, ask your webhost / ISP. If you are running your own name servers, they would be what ever IP address you assigned them and they must be external accessible IP’s and not internal. If they look like this, then they are incorrect;
search myserver (this should be your domain name, also may not be present in your config)
nameserver 127.0.0.1
nameserver 192.168.0.1
If you still aren’t sure about your name servers, simply do a DNS lookup on your domain to find out what they are. I recommend using Http://www.network-tools.com.
Assuming you added a correct hostname and your name servers are correct, your issue will be resolved!
Tags: , ,

Comments No Comments »

While Cpanel comes with 2 different FTP programs; PureFTP and Proftp, there isn’t any way in Cpanel to change the default FTP ports. This leaves the server open to a possible brute force attack at the default port of 21. However by changing just one line in your FTP server configuration files, you can change up the FTP port and securing your server.

To do so, you must be logged into your server via SSH/Shell and you must use a text editior such as Nano, Pico, Vi / Vim.

Changing the port for Pure-FTP

1) Edit /etc/pure-ftpd.conf and look for the following line:

#Bind 127.0.0.1,21

The default example, 127.0.0.1, will cause the socket to bind locally but then this connection won’t serve externally. You’ll need to uncomment the line and change that to 0.0.0.0 so all IP’s will listen on that range and change the port of 40 to your desired ftp port.

2) If needed, add the new FTP port to your server’s firewall

3) Edit /etc/chkserv.d/ftpd and change the port, which is the first comma-separated entry to the right of ‘=’ on the line in the file, to match the port you put the service on.

Finally:

/etc/init.d/pure-ftpd restart
/etc/init.d/cpanel restart (restarts tailwatchd/chkservd)

Changing the port for ProFTP

Edit /etc/proftpd.conf and change:

Port 21

Tags: , ,

Comments No Comments »

The error is due to a bug in a Perl library Munin uses which causes $PATH variable to be lost, and then causes the plugin cannot find the mysqladmin program which it needs to retrieve the numbers to populate in the graphs. Uninstall and reinstall Munin Service Monitor may make it works again, however, a more permanent solution is to hardcode the path of the program, which will fix the problem. Here the guide on how to specify the path to mysqladmin to Munin.

Fix for Munin installed by cPanel/WHM

   1. Determine where is mysqladmin program located with the one of the following command:

      which mysqladmin
      type mysqladmin
      locate mysqladmin

      If should return a path to mysqladmin which looks similar or the same to /usr/bin/mysqladmin.

   2. Edit the /etc/munin/plugin-conf.d/cpanel.conf Munin configuration file, and modify the [mysql*] to look like below:
      [mysql*]
      user root
      group wheel
      env.mysqladmin /usr/bin/mysqladmin
      env.mysqlopts –defaults-extra-file=/root/.my.cnf
Read the rest of this entry »

Tags: , ,

Comments No Comments »

Nothing more than a “make sure you do this”, not really a knowledge base. It’s come to my attention that when people make changes to the httpd.conf on a server that is running Cpanel, that they don’t update the distiller file. So when they recompile apache, they lose any changes they made. Please be sure when you manually update httpd.conf that you save the changes to the distiller file by running the following;

/usr/local/cpanel/bin/apache_conf_distiller --update --main
*make sure if you copy and paste the command that it doesn’t replace the “-” with a “.”

Make sure that you modify the proper files when making the changes. For example to modify the number of servers that the Apache process can run, you will need to modify  /usr/local/apache/conf/extra/httpd-mpm.conf .

 StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0

 

If you need to modify the Time out settings, yo will need to modify the /usr/local/apache/conf/extra/httpd-default.conf .

# Timeout: The number of seconds before receives and sends time out.
#
Timeout 150

# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive Off 

 

 

 

It will confirm that the changes were saved and this will save the changes to the main distiller config, saving them for all apache compiles.

You can test this by running the following to reload the httpd.conf and confirm the change;

/scripts/rebuildhttpdconf

Tags: , ,

Comments No Comments »

EasyApache is a pre configured script that allows you to easily update Apache Web server through WHM or SSH.
In this tutorial we will show you how to update apache using SSH /scripts/easyapache.

Requirements:
Root SSH access to your server

Login as root through SSH.
1) Login to your server and su - to root.

Run EasyApache
2) /scripts/easyapache
3) Now once you are logged in and have ran the script, you will be presented with an option to choose a profile. Seeing that this is your first time (or not) you will want to choose “Start customizing based on profile” and hit enter. You move by using the arrow keys and using the space bar or mouse to choose and option if you need to fill one out (later in the tutorial).

easyapache11

4) Your next screen will to choose what version of apache you wish to run. Depending on what version of cpanel you are running, your options will be different. In my instance, I am using 11.24, so I have the option for Apache 1.3, 2.0 or 2.2. Your choose will depend on if you need certain features of that version of Apache. However when in doubt, google it my friends. I’ll choose 2.0 for this instance.

easyapache2

5) The next step will to choose what version of php you wish to use. Keep in might that Apache is constantly upgraded, so it’s usually best to go with the newest version.

easyapache3

6) After you choose your php version, you will be presented with what revision you want. Once again, rule of thumb is the newest should be the one you choose, unless your program requires a specific version of php.

easyapache4

7) Now we get to choose several options for apache / php. Assuming that you don’t need frontpage for example, or you do want mod perl or Zend, you would choose what options you need. These are not the final options for apache / php however, this will be done on the next screen. Unlike the other screens where you selected next step to move on, here you can either finish the build by choosing save and build (which will use previous settings) or you can choose exhaustive options list, where you can customize apache /php. Choose the later to continue.

easyapache5

8) Finally, we can choose what options are available for apache / php. This can be several screens long, so make sure you scroll up and down to view all the options. Once you have selected what you need, hit the next step.

easyapache6

9) Now, after choosing all your options, you have the ability to either save the build but not running it or save the build and running it. Once you decide to save and build, this process takes 15-30 minutes to complete. Once it does complete, httpd will restart and the new settings will take place.

easyapache7

That’s it. Take note that you can also run Apache from inside of WHM/CP, but it uses more memory due to the GUI, so t’s recommended to do this via SSH, esspecially if you are on a VPS with less than 512MB of memory or a heavily trafficed server.

Tags: , , ,

Comments 1 Comment »