buy tb-500

Archive for the ‘Linux’ Category

Cpanel installation.

Friday, June 17th, 2011

Set a valid hostname, such as server123.abc.com
a. mkdir /backup
b. mkdir /home/cpins
c. cd /home/cpins/
wget http://layer1.cpanel.net/latest
d. sh latest

Allow IP address in iptables

Friday, June 17th, 2011

You may use the command below:
iptables -A INPUT -s XXX.XXX.XXX.XXX -j ACCEPT

Block IP address in iptables

Friday, June 17th, 2011

You may use the command below to block:
iptables -A INPUT -s xxx.xxx.xxx.xxx -j DROP

Manually update stats for cPanel

Friday, June 17th, 2011

If you see the stats is not showing correct data in cPanel, you can run the command below to update it manually:
/scripts/runweblogs <username>

Sorry, you are out of ips to assign as nameservers

Friday, June 17th, 2011

Sorry, you are out of ips to assign as nameservers
If you see the error above, you need to manually add it from the server in order to assign the IP address for the
nameserver.
vi /etc/nameserverips
Edit the line as below:
111.222.333.444=ns1.abc.com
111.222.333.444=ns2.abc.com

How to check the version of ImageMagick

Friday, June 17th, 2011

In you want to check the version of ImageMagick, simply ssh to the server and run the command below:
# convert -version
You will get the answer like below:
Version: ImageMagick 6.2.8 10/20/10 Q16 file:/usr/share/Imag
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC

How to Increase MaxClients in Plesk

Friday, June 17th, 2011

If you see the error below:
[Tue May 24 18:17:16 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting
You need to increase the value for MaxClients and ServerLimit in /etc/httpd/conf.d/swtune.conf
After that remember to restart apache service by using the command below:
# service httpd restart

Install Horde in Plesk server using SSH

Friday, June 17th, 2011

You may follow the steps below to install Horde webmail:
# cd /usr/local/psa/admin/bin
After that run the autoinstaller:
# ./autoinstaller –select-release-current –install-component horde
Please wait until the command finish install.

Know WHM/Cpanel Logs in details

Saturday, June 4th, 2011

cPanel/WHM Initial Installation Errors:
Location : /var/log/cpanel*install*
Description : These log files contain cPanel installation logs & should be referenced first for any issues resulting from new cPanel installations..

————————————————————————————————————————————————–

Cpanel/WHM Accounting Logs:
Location : /var/cpanel/accounting.log
Description : Contains a list of accounting functions performed through WHM, including account removal and creation..

————————————————————————————————————————————————–

Cpanel/WHM Service Status Logs:
Location : /var/log/chkservd.log
Description :The service monitoring demon (chkservd) logs all service checks here. Failed service are represented with a [-] and active services are represented by [+].

————————————————————————————————————————————————–

cPanel error logs:
Location : /usr/local/cpanel/logs/error_log
Description : cPanel logs any error it incurs here. This should be checked when you encounter errors or strange behavior in cPanel/WHM…

————————————————————————————————————————————————–

cPanel License Error Logs:
Location : /usr/local/cpanel/logs/license_log
Description : All license update attempts are logged here. If you run into any errors related to license when logging in, check here.

————————————————————————————————————————————————–

Stats Daemon Logs:
Location : /usr/local/cpanel/logs/stats_log
Description : The stats daemon (cpanellogd) logs the output from all stats generators (Awstats, Webalizer, Analog) here.

————————————————————————————————————————————————–

Client Information, Requested URL Logs:
Location : /usr/local/cpanel/logs/access_log
Description : General information related to access cPanel requests is logged here.

————————————————————————————————————————————————–

cPanel/WHM Update Logs:
Location : /var/cpanel/updatelogs/update-[TIMESTAMP].log
Description : Contains all output from each cPanel update [upcp]. It’s named with the timestamp at which the upcp process was initiated..

————————————————————————————————————————————————–

Bandwidth Logs:
Location : /var/cpanel/bandwidth
Description : Files contain a list of the bandwidth history for each account. Each named after their respective user.

————————————————————————————————————————————————–

Tailwatchd [New]:
Location : /usr/local/cpanel/logs/tailwatchd_log
Description : Logs for daemon configuired under tailwatchd ie. cPBandwd, Eximstats, Antirelayd.

————————————————————————————————————————————————–

————————————————————————————————————————————————–

Apache Logs:.

General Error and Auditing Logs:
Location : /usr/local/apache/logs/error_log
Description : All exceptions caught by httpd along with standard error output from CGI applications are logged here..
The first place you should look when httpd crashes or you incur errors when accessing website.

————————————————————————————————————————————————–

Apache SuExec Logs:
Location : /usr/local/apache/logs/suexec_log
Description : Auditing information reported by suexec each time a CGI application is executed. Useful for debugging internal server errors, with no relevant information being reported to the Apache error_log, check here for potential suexec policy violations…

————————————————————————————————————————————————–

Domain Access Logs:
Location : /usr/local/apache/domlogs/domain.com
Description : General access log file for each domain configured with cPanel.

————————————————————————————————————————————————–

Apache Access Logs:
Location : /usr/local/apache/logs/access_log
Description : Complete web server access log records all requests processed by the server.

————————————————————————————————————————————————–

————————————————————————————————————————————————–

Exim Logs :.

Message Reception and Delivery:
Location : /var/log/exim_mainlog or /var/log/exim/mainlog
Description : Receives an entry every time a message is received or delivered.

————————————————————————————————————————————————–

Exim ACLs/Policies based RejectLog :
Location : /var/log/exim_rejectlog
Description : An entry is written to this log every time a message is rejected based on either ACLs or other policies eg: aliases configured to :fail

————————————————————————————————————————————————–

Unexpected or Fatal Errors:
Location : /var/log/exim_paniclog
Description : Logs any 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 properly investigated..

————————————————————————————————————————————————–

IMAP/POP/SpamAssassin General Logging and Errors:
Location : /var/log/maillog & /var/log/messages
Description : The IMAP, POP, and SpamAssassin services all log here. This includes all general logging information (login attempts, transactions, spam scoring), along with fatal errors.

————————————————————————————————————————————————–

————————————————————————————————————————————————–

FTP Logs:

FTP Logins and General Errors:
Location : /var/log/messages
Description : General information and login attempts are logged here..

————————————————————————————————————————————————–

FTP Transactions logging:
Location : /var/log/xferlog or /var/log/messages
Description : Is a symbolic link in most cases to /usr/local/apache/domlogs/ftpxferlog, which contains a history of the transactions made by FTP users…

————————————————————————————————————————————————–

————————————————————————————————————————————————–

MySQL Logs:.

MySQL General Information and Errors :
Location : /var/lib/mysql/$(hostname).err
Description : This path could vary, but is generally located in /var/lib/mysql. Could also be located at /var/log/mysqld.log

————————————————————————————————————————————————–

————————————————————————————————————————————————–

Security Logs:

Authentication attempts:
Location : /var/log/secure
Description : Logs all daemons which requires PAM Authentication.

————————————————————————————————————————————————–

Authentication attempts:
Location : /var/log/secure
Description : Logs all daemons which requires PAM Authentication.

————————————————————————————————————————————————–

Tracking all Logins and Logouts:
Location : /var/log/wtmp
Description : The wtmp file records all logins and logouts.

————————————————————————————————————————————————–

Last Logins:
Location : /var/log/lastlog
Description : Database times of previous user logins. The lastlog file is a database which contains info on the last login of each user.

————————————————————————————————————————————————–

WebDav or WebDisk Log :
Location : /usr/local/cpanel/logs/cpdavd_error_log
Description : The cpdavd daemon is “WebDav” (better known as “WebDisk”) which was introduced in cPanel 11 to allow users to mount their home directory on their personal computer, always having access to the files and content…

————————————————————————————————————————————————–

Cphulkd Logs:
Location : /usr/local/cpanel/logs/cphulkd_errors.log
Description : cPHulk Brute Force Protection prevents malicious forces from trying to access your server’s services by guessing the login password for that service….
It blacklists IPs that it thinks are trying to run a brute force attack.

————————————————————————————————————————————————–

Failure Logging:
Location : /var/log/faillog
Description : Faillog formats the contents of the failure log from /var/log/faillog database. It also can be used for maintains failure counters and limits. Run faillog without arguments display only list of user faillog records who have ever had a login failure.

————————————————————————————————————————————————–

Startup/Boot, Kernel & Hardware error messages :
Location : /var/log/dmesg
Description : dmesg is a “window” into the kernels ring-buffer. It’s a message buffer of the kernel. The content of this file is referred to by the dmesg command. It shows bootlog and the hardware errors..

————————————————————————————————————————————————–

————————————————————————————————————————————————–

Tomcat Logs:

General Startup, Shutdown & Error Logs:
Location : /usr/local/jakarta/tomcat/logs/catalina.err and /usr/local/jakarta/tomcat/logs/catalina.out
Description : Logs for Tomcat and all tomcat based applications…

————————————————————————————————————————————————–

THANK YOU

————————————————————————————————————————————————–

How to move an addon domain from one cPanel to another

Saturday, June 4th, 2011
  1. Download the content of your addon domain to your local PC.
  2. Backup any associated database(s).
  3. Create a subfolder inside the new cPanel’s public_html folder.
  4. Upload the content of your addon domain to this new folder.
  5. Restore the database backup(s) into the new cPanel.
  6. If the old cPanel and new cPanel are on the same server, go back to the old cPanel and remove the addon domain from under the Addon Domains icon. (You do not need to delete the original content or original databases.)
  7. Go to the new cPanel and click the Addon Domains icon. Enter the addon domain name where it says “New Domain Name”.
  8. For the “Document Root” you must enter /public_html/subfolder/ (replace ‘subfolder’ with the name you chose in step 3). Fill out the remainder of the form and click the Add Domain button.
  9. If the old cPanel and new cPanel are on different servers, then you will need to update your addon domain name’s nameservers (or other DNS records).