Thursday, February 28, 2008

Postgres gives an error of 'Password authentication failed

Postgres gives an error of 'Password authentication failed for user.

Make sure the password is in /var/lib/pgsql/.pgpass The format is as follows... *:*:*:postgres:PASSWORD Modify /var/lib/pgsql/data/pg_hba.conf It should contain the following... local all all md5 host all all 127.0.0.1 255.255.255.255 md5 Change 'md5' to 'trust' to disable authentication then restart postgres. `/etc/init.d/postgresql restart` Now you should be able to connect to postgresql as user 'postgres' without a password to modify the password. `psql -u template1` Run the following sql command. "alter user postgres with password 'NEW PASSWORD HERE';" Finally change /var/lib/pgsql/data/pg_hba.conf back to its original format and restart postgresql one more time. Now you should be able to authenticate using user postgres and the password you specified.

Where do i go to find out if a new build of cpanel is release ?

Where do i go to find out if a new build of cpanel is released?

Some sort of builds are released quicker than others, for example, CURRENT builds are released quicker than RELEASE builds, and EDGE builds are released quicker than CURRENT Builds. To find the latest builds, go to http://layer2.cpanel.net , look for your operating system (FreeBSD/Linux).

How do I block an IP address from my server ?

If you want to block access to your server for whatever reason, you will need to log into the shell as root. Your server should either have ipchains or iptables to help accomplish this.

In this example, the attacking IP is 192.168.56.210 .

If you are using ipchains, type "ipchains -A input -j DENY -p all -l -s 192.168.56.210/32"

If you are using iptables, type "iptables -A INPUT -s 192.168.56.210/32 -j DROP"

If you just want to block access to one port from an ip :

iptables -A INPUT -s 192.168.56.210/32 -p tcp --destination-port 23 -j DROP

The above would drop all packets from 192.168.56.210/32 to port 23 (telnet) on the server.

There are many indepth tutorials available on the internet, search google.com for some more information on it.

PHP Myadmin error

PHP Myadmin error
----------------------

==================
Error
==================
2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

==================
FIX
==================

nano /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php

change

$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address

to

$cfg['Servers'][$i]['host'] = '127.0.0.1'; // MySQL hostname or IP address

Horde webmail Authentication Error (Cpanel)

Horde webmail Authentication Error (Cpanel) :

/scripts/restartsrv_imap

Try this procedure to fix mysql.sock error: Cpanel

Try this procedure to fix mysql.sock error: Cpanel

cd /var/lib/mysql
touch mysql.sock
chown mysql:mysql mysql.sock
chmod 1777 mysql.sock

now make a sym link into /tmp

ln -s /var/lib/mysql/mysql.sock /tmp
then
chmod 1777 /tmp

now
/scripts/mysqlup --force


now just restart mysql
/etc/rc.d/init.d/mysql restart

How to check cron is running or not ?

How to check cron is running or not.


tail -f /var/log/cron

Will show the crons that had been executed.

Installing zend optimiser on whm cpanel

Installing zend optimiser on whm cpanel :


First go to this directory "cd /usr/local/src" then run this command "/scripts/installzendopt"

Complete details
Visit http://www.webhostgear.com/184.html

MySQL :: General Information and Errors

MySQL :: General Information and Errors :

General Information and Errors

/var/lib/mysql/$(hostname).err

This path could vary, but is generally located in /var/lib/mysql. Could also be located at

/var/log/mysqld.log

IMAP/POP/SpamAssassin logs

IMAP/POP/SpamAssassin logs :

General Logging and Errors

/var/log/maillog»»
/var/log/messages»»

The IMAP, POP, and SpamAssassin services all log here. This includes all general logging information (login attempts, transactions, spam scoring), along with fatal errors.

lsof -U command :

lsof -U command :

is a command meaning "list open files", which is used in many Unix-like systems to report a list of all open files and the processes that opened them. It works in and supports several UNIX flavors.

<-U> means list file open by user.

How to watch for file and file size changes of one folder live and not by email ?

How to watch for file and file size changes of one folder live and not by email ?

How to watch for file and file size changes of one folder live and not by email ?

# cd your-folder
# watch ls -la

How to find a specific filename and delete it ?

How to find a specific filename and delete it ?

# find / -name specific-filename.txt -exec rm -rf {} \;

Mysql user logsout after few minutes

Mysql user logsout after few minutes :

few minutes of inactivity and it logs members out of mysql

nano /etc/my.cnf

add the below lines to my.cnf before

interactive_timeout=10
wait_timeout=10

add it in between

[mysqld]

[safe_mysqld]

[mysqld]
set-variable = max_connections=500
safe-show-database
set-variable = connect_timeout=15
interactive_timeout=10
wait_timeout=10
[safe_mysqld]
err-log=/var/log/mysqld.log

Exim Commands

Exim Commands

Display Number of mails in queue :
exim -bpru | wc -l

Display mails :
exim -bpru | awk '{print $3}'

Remove mails from queue :
exim -bpru | awk '{print $3}' | xargs exim -Mrm

kill nobody process
ps aux | grep nobody | awk '{print $2}' | xargs kill -9


exim -bp
mailq --- The mailq is relevant as it gives your the email IDs.

exim -M emailID
force delivery of one message

exim -qf
Force another queue run

exim -qff
Force another queue run and attempt to flush frozen messages

exim -Mvl messageID
View Log for message

exim -Mvb messageID
View Body for message

exim -Mvh messageID
View Header for message

exim -Mrm messageID
ReMove message (no errors sent)

exim -Mg messageID
Give up and fail message, message bounces to sender.

Exim Logs

Exim Logs
--------------------

Message Reception and Delivery

/var/log/exim_mainlog»» ( Linux )
/var/log/exim/mainlog»» (FreeBSD)

Receives an entry every time a message is received or delivered
Rejections based on ACLs/Policies

/var/log/exim_rejectlog »» ( Linux )
/var/log/exim/rejectlog»» (FreeBSD)

Receives an entry every time a message is rejected based on either ACLs or other policies (for example, aliases configured to :fail:)

Unexpected or Fatal Errors

/var/log/exim_paniclog»» ( Linux )
/var/log/exim/paniclog»» (FreeBSD)

Receives all entries exim doesn’t know how to handle. It’s generally a really bad thing when log entries are being written here, and they should be thoroughly investigated.

General Information and Configuration for Exim Logs:
http://exim.org/exim-html-current/doc/html/spec_html/ch49.html

How can I debug problems with an email account ?

How can I debug problems with an email account ?

Trace the path of the email when sent from the server and see what path it follows:
exim -d2 -bt user@domain.com

How do I manually kill the exim mail queue?

/usr/local/cpanel/whostmgr/bin/whostmgr2 killeximq

How to Find a Members List of a Mailing list

To Find a Members list of a Mailing list on the server you can use this command to find it
"/usr/local/cpanel/3rdparty/mailman/bin/list_members List name (user_domainname.com)". This will display the members list of that mailing list.

-------------------------------------------------------------------------------------

To add a mailing list:
1)Click on the Mailing Lists link in the Mail area.
2)Click on the Add Mailing List link.
3)Enter the name of the mailing list in the List Name field, the password for the list in the Password field, and the domain it is for from the Domain drop-down list.
4)Click on the Create button. The list is created in the /usr/local/cpanel/3rdparty/mailman/lists folder.

General solutions to Email problems

Basic steps to check for email problems :-

If your client is getting problem for emails then please check with the following steps

1.Check the domain name by putting it on the domain dossier
>> a. Address lookup : IP resolves properly to your nameserver or it is in DNS propagation
>> b. Domain Whois record : Registration Status is not "HOLD" which indicates the domain name registrar has been blocking
>> c. Service scan : SMTP and POP3 are working properly with out giving " Time out "

2. Configure the account in the outlook Express at your end with following details of the clients

Email Address : anybody@domain.com
Username : anybody@domain.com
Password : Password
SMTP : mail.domain.com
POP3 : mail.domain.com
Please tick the option for "My server requires authentication"

Note : All the details are entered properly.

3. If you get error at your end, check the error properly if there is some thing like
>> a. Account was suspended :- Which indicates your billing department or somebody else has suspended the hosting account due to some reasons
>> b. Rejected username or password : Check if you have entered the username and password properly, If still does not then try to reset the password for that email address on Control Panel.
>> c. Next check for the Quota for the email if exceeded ? Then try to increase the limit otherwise he will not be able to receive mails
>> d. "My server requires authentication" not ticked you will get the error while sending emails.
>> f. Otherwise copy the error on google and search for it

4. If you can send and receive mails successfully but the client is not able to send and recieve.
>> a. Provide the details for the account you configured in the outlook express in step 2.
>> b. If still not tell him to check by disabling firewall at his end.
>> c. Tell him to change SMTP and POP3 as that of his ISP i.e HisISPname.domain.com
>> d. If he is able to receive mails but cannot send then ask him to change the port for SMTP to 465 (SMTP SSL) with setting in 4.a and 4.c steps above
>> e. Otherwise there is possiblity that his ISP has blocked the port and ask him to contact his ISP for more information.

Horde error /usr/local/cpanel/base/horde/lib/Prefs/sql.php

Hello Friends,

If anyone face the following error with horde :

Fatal error has occurred:
DB Error: connect failed
[line 102 of /usr/local/cpanel/base/horde/lib/Prefs/sql.php]
Details have been logged for the administrator.

Use the following scripts to fix it :
cd /scripts/
/scripts/resethorde
/scripts/fullhordereset
------------------------------------------------------------------------------
------------------------------------------------------------------------------
If you get this error while login to webmail through cpanel :
Fatal error: Call to undefined function: _() in /usr/local/cpanel/base/horde/config/registry.php on line 86

or something like:
undefined class name 'log in user/local/cpanel/base/horde/lib/horde/php


do this:
cp /usr/local/cpanel/3rdparty/bin/imapd /usr/sbin

touch /var/cpanel/usecpphp

How to Install Java on cpanel server ?

How to Install Java on cpanel server ?

1. Download the SDK, Standard Edition 1.4.2_04 from java.sun.com (RPM) in the local machine (Not to the server)
2. upload the file via filemanager from Cpanel to /usr/local (Around 35 MB)
3. chmod 755 j2sdk.....bin
4. ./j2sdk....bin
5. cd /usr - > mkdir java
6.cd local
7. mv j2sdk1.4.2_04/ ../java
8. cd..
9. cd java
10. cd ../local
11. ln -s /usr/java/j2sdk1.4.2_04/ jdk
12. ln -s /usr/java/j2sdk1.4.2_04/jre/ jre
13. cd ..
14. set classpath=/usr/local/jdk
15. check up with typing java / javac if installed


-----------------------------------------------------------

For installation on plain linux server refer:

http://www.dougsparling.com/comp/howto/linux_java.html

Disabling Password Reset Option : Cpanel

url : http://www.webhostgear.com/70.html

Disabling Password Reset Option

Cpanel recently announced a new vulnerability for their servers for the password reset option.
We'll show you how to turn off the password reset option for failed logins to Cpanel through Web Host Manager.

Description
The feature "Allow cPanel users to reset their password via email",
found in WebHostManager in the "Tweak Settings" section allows for a
cpanel user to run some commands as the root user.

It's strongly suggested that all Cpanel users disable this feature.

Affected Systems
All builds of Cpanel on all platforms are vulnerable up to and including (9.1.0
build 34), all builds after that have been fixed.

Step 1) Fixing The Problem - Disable It

1. Login into you WHM control panel as root.

2. Click on Tweak Settings in the upper left hand corner.

3. Scroll down until you see "Allow cPanel users to reset their password via email"

4. Uncheck the check box and click Save.

Click the screenshot for a larger image.


Step 2) Fixing The Problem - Update Cpanel
You can also update your Cpanel server to the latest release, which now fixes this issue.

1. Login into you WHM control panel as root.

2. Click on Upgrade to Latest Version on the bottom right hand corner.

Your server is now protected from this exploit!

cPanel/WHM Initial Installation Errors

cPanel/WHM Initial Installation Errors:
------------------------------------------


/var/log/cpanel*install* »

Cmd to restart service pop3 on centos /cpanel

Cmd to restart service pop3 on centos /cpanel

/etc/init.d/xinetd restart

How to find php info

How to find php info :

< ?phpinfo();? >

How to check OS Version (Linux)

How to check OS Version (Linux) :

cat /etc/redhat-release

How to find php.ini path

How to find php.ini path :

php -i | grep php.ini

How to change the cpanel to stable

how to change the cpanel to stable :

cat /etc/cpupdate.conf
nano /etc/cpupdate.conf

CPANEL=stable release

You have to change this option to upgrade cpanel from stable to relase and release to stable.

you have to nano this file cpupdate.conf


cat /etc/cpupdate.conf
nano /etc/cpupdate.conf
/scripts/upcp --force

How to update Cpanel lisence

How to update CPanel lisence :

/usr/local/cpanel/cpkeyclt

cPanel/WHM Requests and Errors

cPanel/WHM Requests and Errors:
---------------------------------------

/usr/local/cpanel/logs/error_log

For cpanel error logs

-----------

/usr/local/cpanel/logs/license_log

For license error log

-----------

/usr/local/cpanel/logs/stats_log

the statsdemon (awstats, Webalizer, analog)

-----------

/usr/local/cpanel/logs/access_log

cPanel/WHM Update Logs

cPanel/WHM Update Logs :
-------------------------------

/var/cpanel/updatelogs/update-[TIMESTAMP].log

Cpanel/WHM Service Status Logs :

/var/log/chkservd.log

The service monitoring demon (chkservd) logs all service checks here. Failed service are represented with a [-] and active services are represented by [+]

ports should be open running my cPanel server behind a firewall

What ports should be open if I'm running my cPanel server behind a firewall?

Ports that must be open to run cPanel behind a firewall:
port service protocol direction

20 ftp tcp inbound/outbound
21 ftp tcp,udp inbound/outbound
22 ssh tcp inbound
25 smtp tcp inbound/outbound
26 smtp tcp inbound/outbound
37 rdate tcp outbound
43 whois tcp outbound
53 DNS tcp/udp inbound/outbound (inbound is only needed if you run your own public DNS server you)
80 http tcp inbound/outbound
110 pop3 tcp inbound
113 ident tcp outbound
143 imap4 tcp inbound
443 https tcp inbound
465 smtp tls/ssl tcp/udp inbound/outbound
873 rsync tcp/udp outbound
993 imap4 ssl tcp inbound
995 pop3 ssl tcp inbound
2082 cpanel tcp inbound
2083 cpanel ssl tcp inbound
2086 whm tcp inbound
2087 whm ssl tcp inbound
2089 cp licence tcp outbound
2095 Webmail tcp inbound
2096 Webmail SSL tcp inbound
3306 mysql tcp (only if you need to connect remotely)
6666 chat tcp inbound

Enable php code to work inside a .html / .htm file

Enable php code to work inside a .html / .htm file

To get this to work you need to edit your
httpd.conf file.

Find the line that looks similar to this:
AddType application/x-httpd-php .php
and change it to look like this:
AddType application/x-httpd-php .php .htm .html
and all should be fine

Please restart httpd service after this .

------> If the server is shared then it is not possible to add these lines in httpd.conf

Instead it can be put in .htaccess for the site.

AddType application/x-httpd-php .php .htm .html

Configuring SSI (Server Side Includes)

Hi, URL : http://www.phpfreaks.com/apache_manual/page/howto/ssi.html
-------------------------------------------------------------------------------------
What are SSI? SSI (Server Side Includes) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served. They let you add dynamically generated content to an existing HTML page, without having to serve the entire page via a CGI program, or other dynamic technology. The decision of when to use SSI, and when to have your page entirely generated by some program, is usually a matter of how much of the page is static, and how much needs to be recalculated every time the page is served. SSI is a great way to add small pieces of information, such as the current time. But if a majority of your page is being generated at the time that it is served, you need to look for some other solution.
--------------------------------------------------------------------------------
Configuring your server to permit SSI To permit SSI on your server, you must have mod_include installed and enabled. Additionally, you must have the following directive either in your httpd.conf file, or in a .htaccess file:
Options +Includes This tells Apache that you want to permit files to be parsed for SSI directives. Note that most configurations contain multiple Options directives that can override each other. You will probably need to apply the Options to the specific directory where you want SSI enabled in order to assure that it gets evaluated last.
Not just any file is parsed for SSI directives. You have to tell Apache which files should be parsed. There are two ways to do this. You can tell Apache to parse any file with a particular file extension, such as .shtml, with the following directives:
AddType text/html .shtml AddHandler server-parsed .shtml One disadvantage to this approach is that if you wanted to add SSI directives to an existing page, you would have to change the name of that page, and all links to that page, in order to give it a .shtml extension, so that those directives would be executed.
The other method is to use the XBitHack directive:
XBitHack on XBitHack tells Apache to parse files for SSI directives if they have the execute bit set. So, to add SSI directives to an existing page, rather than having to change the file name, you would just need to make the file executable using chmod.
chmod +x pagename.html A brief comment about what not to do. You'll occasionally see people recommending that you just tell Apache to parse all .html files for SSI, so that you don't have to mess with .shtml file names. These folks have perhaps not heard about XBitHack. The thing to keep in mind is that, by doing this, you're requiring that Apache read through every single file that it sends out to clients, even if they don't contain any SSI directives. This can slow things down quite a bit, and is not a good idea.
Of course, on Windows, there is no such thing as an execute bit to set, so that limits your options a little.
In its default configuration, Apache does not send the last modified date or content length HTTP headers on SSI pages, because these values are difficult to calculate for dynamic content. This can prevent your document from being cached, and result in slower perceived client performance. There are two ways to solve this: Use the XBitHack Full configuration. This tells Apache to determine the last modified date by looking only at the date of the originally requested file, ignoring the modification date of any included files.
Use the directives provided by mod_expires to set an explicit expiration time on your files, thereby letting browsers and proxies know that it is acceptable to cache them.
--------------------------------------------------------------------------------
Basic SSI directives SSI directives have the following syntax:

It is formatted like an HTML comment, so if you don't have SSI correctly enabled, the browser will ignore it, but it will still be visible in the HTML source. If you have SSI correctly configured, the directive will be replaced with its results.
The element can be one of a number of things, and we'll talk some more about most of these in the next installment of this series. For now, here are some examples of what you can do with SSI Today's date

The echo element just spits out the value of a variable. There are a number of standard variables, which include the whole set of environment variables that are available to CGI programs. Also, you can define your own variables with the set element.
If you don't like the format in which the date gets printed, you can use the config element, with a timefmt attribute, to modify that formatting.

Today is
Modification date of the file
This document last modified
This element is also subject to timefmt format configurations.
Including the results of a CGI program
This is one of the more common uses of SSI - to output the results of a CGI program, such as everybody's favorite, a ``hit counter.''

--------------------------------------------------------------------------------
Additional examples Following are some specific examples of things you can do in your HTML documents with SSI.
--------------------------------------------------------------------------------
When was this document modified?
Earlier, we mentioned that you could use SSI to inform the user when the document was most recently modified. However, the actual method for doing that was left somewhat in question. The following code, placed in your HTML document, will put such a time stamp on your page. Of course, you will have to have SSI correctly enabled, as discussed above.

This file last modified
Of course, you will need to replace the ssi.shtml with the actual name of the file that you're referring to. This can be inconvenient if you're just looking for a generic piece of code that you can paste into any file, so you probably want to use the LAST_MODIFIED variable instead:

This file last modified For more details on the timefmt format, go to your favorite search site and look for strftime(). The syntax is the same.
-------------------------------------------------------------------------------
Including a standard footer
If you are managing any site that is more than a few pages, you may find that making changes to all those pages can be a real pain, particularly if you are trying to maintain some kind of standard look across all those pages.
Using an include file for a header and/or a footer can reduce the burden of these updates. You just have to make one footer file, and then include it into each page with the include SSI command. The include element can determine what file to include with either the file attribute, or the virtual attribute. The file attribute is a file path, relative to the current directory. That means that it cannot be an absolute file path (starting with /), nor can it contain ../ as part of that path. The virtual attribute is probably more useful, and should specify a URL relative to the document being served.
It can start with a /, but must be on the same server as the file being served.

I'll frequently combine the last two things, putting a LAST_MODIFIED directive inside a footer file to be included. SSI directives can be contained in the included file, and includes can be nested - that is, the included file can include another file, and so on.
--------------------------------------------------------------------------------
What else can I config?
In addition to being able to config the time format, you can also config two other things.
Usually, when something goes wrong with your SSI directive, you get the message
[an error occurred while processing this directive]
If you want to change that message to something else, you can do so with the errmsg attribute to the config element:

Hopefully, end users will never see this message, because you will have resolved all the problems with your SSI directives before your site goes live. (Right?)
And you can config the format in which file sizes are returned with the sizefmt attribute. You can specify bytes for a full count in bytes, or abbrev for an abbreviated number in Kb or Mb, as appropriate.
--------------------------------------------------------------------------------
Executing commands I expect that I'll have an article some time in the coming months about using SSI with small CGI programs. For now, here's something else that you can do with the exec element. You can actually have SSI execute a command using the shell (/bin/sh, to be precise - or the DOS shell, if you're on Win32). The following, for example, will give you a directory listing.



or, on Windows



You might notice some strange formatting with this directive on Windows, because the output from dir contains the string `` dir'' in it, which confuses browsers.
Note that this feature is exceedingly dangerous, as it will execute whatever code happens to be embedded in the exec tag. If you have any situation where users can edit content on your web pages, such as with a ``guestbook'', for example, make sure that you have this feature disabled. You can allow SSI, but not the exec feature, with the IncludesNOEXEC argument to the Options directive.
--------------------------------------------------------------------------------
Advanced SSI techniques
In addition to spitting out content, Apache SSI gives you the option of setting variables, and using those variables in comparisons and conditionals.
Caveat
Most of the features discussed in this article are only available to you if you are running Apache 1.2 or later. Of course, if you are not running Apache 1.2 or later, you need to upgrade immediately, if not sooner. Go on. Do it now. We'll wait.
--------------------------------------------------------------------------------
Setting variables
Using the set directive, you can set variables for later use. We'll need this later in the discussion, so we'll talk about it here. The syntax of this is as follows:

In addition to merely setting values literally like that, you can use any other variable, including, for example, environment variables, or some of the variables we discussed in the last article (like LAST_MODIFIED, for example) to give values to your variables. You will specify that something is a variable, rather than a literal string, by using the dollar sign ($) before the name of the variable.

To put a literal dollar sign into the value of your variable, you need to escape the dollar sign with a backslash.

Finally, if you want to put a variable in the midst of a longer string, and there's a chance that the name of the variable will run up against some other characters, and thus be confused with those characters, you can place the name of the variable in braces, to remove this confusion. (It's hard to come up with a really good example of this, but hopefully you'll get the point.)

--------------------------------------------------------------------------------
Conditional expressions
Now that we have variables, and are able to set and compare their values, we can use them to express conditionals. This lets SSI be a tiny programming language of sorts. mod_include provides an if, elif, else, endif structure for building conditional statements. This allows you to effectively generate multiple logical pages out of one actual page.
The structure of this conditional construct is:




A test_condition can be any sort of logical comparison - either comparing values to one another, or testing the ``truth'' of a particular value. (A given string is true if it is nonempty.) For a full list of the comparison operators available to you, see the mod_include documentation. Here are some examples of how one might use this construct.
In your configuration file, you could put the following line:
BrowserMatchNoCase macintosh Mac
BrowserMatchNoCase MSIE InternetExplorer
This will set environment variables ``Mac'' and ``InternetExplorer'' to true, if the client is running Internet Explorer on a Macintosh.
Then, in your SSI-enabled document, you might do the following:

Apologetic text goes here

Cool JavaScript code goes here

Not that I have anything against IE on Macs - I just struggled for a few hours last week trying to get some JavaScript working on IE on a Mac, when it was working everywhere else. The above was the interim workaround.
Any other variable (either ones that you define, or normal environment variables) can be used in conditional statements. With Apache's ability to set environment variables with the SetEnvIf directives, and other related directives, this functionality can let you do some pretty involved dynamic stuff without ever resorting to CGI.
--------------------------------------------------------------------------------
Conclusion SSI is certainly not a replacement for CGI, or other technologies used for generating dynamic web pages. But it is a great way to add small amounts of dynamic content to pages, without doing a lot of extra work.

Installation and Configuration Of WHM (Linux server)

Hello Folks, Following are the steps to Install and Configure the WHM. WHM Installation Instructions:
========================
cPanel now uses a universal install script which can be found at http://layer1.cpanel.net/. You can use the following commands in the root shell to download and start the installation script: mkdir /home/cpins cd /home/cpins wget http://layer1.cpanel.net/latest sh latest
========================
Configuration Of WHM:
========================
1. First of all you need to collect all the data that is needed to configure the WHM. The following are the informations required for configuring the name servers.
1.1. IP and the hostname of the server for which you are configuring the WHM.
1.2. The name servers hostnames and their respective IPs.
1.3. The Password of the server where the Primary name server is hosted. (Most Important Step).
1.4. The contact email address to send the report when certains server check scripts are executed.
1.5. Default Cpanel themes (which ever the client likes to use it)
2. As soon as you login in to the WHM of the server for the first time, this will give a message that the WHM of this server is configured and you are using it for the first time and below there will be a continue button. Just click that Continue button. The next page is of the agreement which you will have to agree, for which there is button down the page by name I Agree. Just need to click that and you will get the first step of the configuration of the server.
3. Now you are in the most important page of the WHM where you need to fill all the information that is collected by you (as explained in the Step 1). You need to fill this page appropriately as this the core of the WHM configuration as your rest of the configuration depends entirely on this main page. I repeat please fill this page very care fully and correctly as on mistake will cause the problem with the server and also the server where the name servers are hosted. When all the necessary information required are filled up, just save the information and click the next button that is ont he left side of the screen.
4. As soon as you finish this page, you job is almost half done. The next step is of setting the quotas which the scripts runs it. This process takes time depending on the speed of the server. You will find a message which says that you need continue to next step. Please don't follow that message and continue to the next step, as this will cause the trouble of disk quota when you activate an account on the server. So allow the process of the setting the quota to be completed and then proceed further. Once quota is set click the next button on the left side.
5. You will be take to the configuration of the resolv.conf, where you will have to enter the following information:
Primary Resolver : 127.0.0.1 Secondary Resolver : Ip of the Primary name server Teritary Resolver : Ip of the Secondary Name server. Once this information is filled up click the continue button. The result of this page after you click the continue button must be this: ========================================================================== Your resolvers have been setup! Listed in order they are: 127.0.0.1 Ip of the Primary name server Ip of the Secondary Name server ==========================================================================
6. Click the next button and it will ask you to reset the password of the admin user of MySql. Just reset the password. Wait till the password of properly set and the MySql service is restarted.
7. After this step click the finish button. And the WHM is set and configured for the use.
8. After this step, you are in the final stage of the setup. This the setting the DNS functions. The most important step of the the configuration. For this you need to go the section of DNS Functions in WHM.
The first step in this is to Establish a Trust Relationship with a Primary Nameserver. Just click the link Establish a Trust Relationship with a Primary Nameserver and it will ask for the password of the server where the primary name server is resolved. Once the relationship is build. Then go for sychronizing the DNS record with the theme DNS record, by clicking the link Synchronize DNS Records. It should give this message after synchronization:
Rebuilding DNS Zones List from master server ..... Rebuild Complete
It sometimes gives the message SCP failed instead of Rebuild Complete. Dont panic by seeing the message, the step 9 will provide the soution for it.
9. After the synchronization, just create an account through whm. To check whether the WHM is correctly configured just go to the DNS zone and click the edit DNS zone list on the server and also on the server where the name servers are hosted. In both the servers the DNS Zone file should be added. If it is added at both the servers then the WHM is configured properly.
These are the step to configure the server through WHM.

How To Secure /tmp directory in cPanel/WHM

Secure /tmp directory Exploiting the /tmp directory and using it to execute files is a very popular method hackers and those with malcious intent use now days. It's also pretty simple to prevent this, or at least put a roadblock up! First, let me say, I highly recommend taking the easy way out on this one, because the easy way in my opinion in this case is also the best way, to do this simply run this command as root: /scripts/securetmp cPanel wrote this script to make it easier on everyone, this script in my opinion also implements it more safely by not having it mount in /etc/fstab! However, if you are the type who wants to do it manually, here you go... First you will need to SSH into your server and su to root. You'll need to tart off in the /dev directory. cd /dev Now, first you will create a loopback file that is 300mybte, you can create larger by editing the count variable. dd if=/dev/zero of=tmpMnt bs=1024 count=300000 Next, you'll make this loopback file a extended filesystem: /sbin/mke2fs /dev/tmpMnt Let's back up your current /tmp directory just in case, remember /tmp directories are emptied on each reboot anyhow, but just in case: cp -R /tmp /tmp_backup Next, mount the new /tmp as noexec: mount -o loop,noexec,nosuid,rw /dev/tmpMnt /tmp Let's chmod it correctly: chmod 1777 /tmp Almost done..restore the /tmp directory and delete the backup: cp -R /tmp_backup/* /tmp/ rm -rf /tmp_backup Now, next we'll set /tmp to mount on bootup, this is the reason why I recommend at the beginning using the cPanel script, because the script does not use /etc/fstab, instead of loads it after the filesystems are mounted.
It's not very wise to load a non-partition on bootup as it can't be fsck'd if neccessary. At the bottom of your /etc/fstab, add this line: /dev/tmpMnt /tmp ext2 loop,noexec,nosuid,rw 0 0 The above lines, should look very similar. Remember each space in the above line is a tab, after this is done, just save and exit out of your editor. Lastly, you'll create a symlink between /var/tmp/ and /tmp. To do this simply: ln -s /var/tmp /tmp http://www.cpanelfaq.com/006/12.html

Webalizer not showing country names (unknown/unresolved)

Hi , Solution :

Step 1) Edit the /etc/resolv.conf file Check if the IP addresses for nameservers are as follows (provided the server is on RackShack): nameserver 127.0.0.1 nameserver 207.218.192.38 nameserver 207.218.192.39 If not please change it. Webalizer checks resolve.conf file before generating the webstats. Step 2) Go to the path /usr/local/cpanel/src/3rdparty/gpl/webalizer-2.01-10 Then run the following command ./configure --enable-dns --with-dblib=/lib Step 3) Then run /scripts/runweblogs to see if the changes are updated. You need to make one change to your httpd.conf file in the /etc/httpd/conf directory. (It is advised that you make a backup of the file BEFORE making any changes.) Edit the file, look for HostnameLookups and change the value to On. Save the file and restart the web server i.e. /etc/rc.d/init.d/httpd restart

Technical Support Chat