Posts

Showing posts from 2012

cPanel command-line:

cPanel: To assign file owerships for webusers: # /scripts/chownpublichtmls To assign mail permission: # /scripts/mailperm or WHM >> Email >> Repair Mailbox permissions. Limit webuser resources (cpu / memory / etc): # vi /etc/security/limits.conf Set all files / directory recursively to secure permissions. Only in users "pwd" # find . -type d -exec chmod 755 {} \; # find . -type f -exec chmod 644 {} \; Set files / directory secure permissions rest of proper. Only in users "pwd" # find . -type f -not -perm 644 -exec chmod 644 {} \; # find . -type d -not -perm 755 -exec chmod 755 {} \; (suspect spam)To check maillog with sending path details. # grep "cwd=" /var/log/exim_mainlog|awk '{for(i=1;i<=10;i++){print $i}}'|sort|uniq -c|grep cwd|sort -n cPanel & Linux EL: Change default linux editor (I selected VI): # VISUAL=vi;export VISUAL;EDITOR=vi;export EDITOR; (suspect attack)TO check current /  connection on port:80 # netstat -an

Ports (tcp / udp)

Ports: Simply, The term port can refer to either physical or virtual connection points. Well Known Ports: 0 through 1023: The well-known port numbers are the port numbers that are reserved for assignment by the Internet Corporation for Assigned Names and Numbers (ICANN) for use by the application end points that communicate using the Internet's Transmission Control Protocol ( TCP ) or the User Datagram Protocol (UDP). Each kind of application has a designated (and thus "well-known") port number. For example, a remote job entry application has the port number of 5; the Hypertext Transfer Protocol (HTTP) application has the port number of 80; and the Post Office Protocol Version 3 (POP3) application, commonly used for e-mail delivery, has the port number of 110. When one application communicates with another application at another host computer on the Internet, it specifies that application in each data transmission by using its port number. The well-known

nPULSE - Web-based network monitoring package for Linux and Unix

Image
nPULS: nPulse is a web-based network monitoring package for Linux and Unix-like operating systems. It can quickly monitor tens, hundreds, even thousands of sites/devices at a time on multiple ports. nPulse is written in Perl and comes with its own (SSL optional) web server for extra security. Also, instead of re-inventing existing code, nPulse uses many excellent OpenSource (GPL) products including  * Nmap                              www.insecure.org/nmap [required]  * Perl                              www.cpan.org          [required]  * OpenSSL                           www.openssl.com       [optional]  * Net::SSLeay and Mail::Mailer      www.cpan.org          [optional]  * Java Telnet App                   www.mud.de/se/jta     [included]  * A modified version of miniserv.pl www.webmin.com        [included] ------------------ Required Software ------------------ Linux/Unix Version 2.1 or greater  (www.redhat.com) Perl       Version 5.004 or later  (www.cpan.org) Nmap       Version

ImageMagick

ImageMagick:             It is a powerful set of image manipulation utilities. It can read, write and manipulate images in many image formats. It can resize, rotate, sharpen, color reduce or add any other special effect to your images. And, best of all, ImageMagick is directly available from the command line. In this article, we will write a script to make it available from the query string. You can then use it, for example, to automatically generate thumbnails of your images. Installation on cPanel server: Command-line: To check whether imagemagick installed? # /scripts/checkimagemagick If not, proceed Installation with # /scripts/installimagemagick This will take couple of minutes as it will install other packages needed by ImageMagick. After the installation, you can check your ImageMagick version through: # /usr/bin/convert --version … root@server [~]# /usr/bin/convert --version Version: ImageMagick 6.8.0-1 2012-12-27 Q16 http://www.imagemagick.org Cop

yasm not found

How to install yasm: While installing ffmpeg, Maybe a chance to face below error: "yasm not found, use --disable-yasm for a crippled build" Installation of yasm: source: cd /usr/local/src/ wget http://www.tortall.net/projects/yasm/releases/yasm-1.0.1.tar.gz tar zfvx yasm-1.0.1.tar.gz cd yasm-1.0.1 ./configure make && make install RPM: wget http://packages.sw.be/yasm/yasm-1.0.1-1.el5.rf.`uname -p`.rpm rpm -ivh yasm-1.0.1-1.el5.rf.`uname -p`.rpm

cPanel and Plesk log path

Some log path information in cPanel/WHM server and Plesk server: cPanel , WHM & Webmail     Login Attempts to cpsrvd /usr/local/cpanel/logs/login_log     Account Transfers & Misc. Logs /var/cpanel/logs     Per-Account Bandwidth History Human Readable /var/cpanel/bandwidth/(USERNAME)     Per-Account Bandwidth History – Cached /var/cpanel/bandwidth.cache/(USERNAME)     Service Status Logs /var/log/chkservd.log     Error Log for cpsrvd /usr/local/cpanel/logs/error_log     Panic Log for cpsrvd /usr/local/cpanel/logs/panic_log     Backup Logs /usr/local/cpanel/logs/cpbackup     Update (UPCP) Log /var/cpanel/updatelogs/update-(TIMESTAMP).log     Mailman Logs /usr/local/cpanel/3rdparty/mailman/logs     Auditing Log (Account Creations, Deletions, etc.) /var/cpanel/accounting.log     Access Log & User Actions in cpsrvd /usr/local/cpanel/logs/access_log     Website Statistics Logs /usr/local/cpanel/logs/stats_log     Logs for Specific Webmail Applications        

TTY vs PTS

Image
Information about TTY vs PTS: TTY Definition: Teletypewriter originally and now also means any terminal on Linux/Unix systems. It also means any serial port on Unix/Linux systems. PTS Definition: Stands for pseudo terminal slave. Actually....... The difference between TTY and PTS is the type of connection to the computer. TTY ports are direct connections to the computer such as a keyboard/mouse or a serial connection to the device. PTS connections are SSH connections or telnet connections. All of these connections can connect to a shell which will allow you to issue commands to the computer.

yum failed 6 times. Cannot continue!

Error while cPanel installation: (ERROR): - ssystem [EXIT_CODE] '/usr/bin/yum' exited with 1 (ignored) (DEBUG): - ssystem [END] (FATAL): yum failed 6 times. Cannot continue! fix: It looks like you have some name resolution issues on the server. Just run the following commands on your server and it will resolve the name resolution issues. #echo "nameserver 8.8.8.8" >> /etc/resolv.conf #echo "nameserver 8.8.4.4" >> /etc/resolv.conf if it is not working properly still facing same error, then here we go, # rpm -e --nodeps bind-chroot # rpm -e --nodeps bind # yum install bind

Apache Error code:

Error code and meaning: Successful Client Requests 200 OK 201 Created 202 Accepted 203 Non-Authorative Information 204 No Content 205 Reset Content 206 Partial Content  Client Request Redirected 300 Multiple Choices 301 Moved Permanently 302 Moved Temporarily 303 See Other 304 Not Modified 305 Use Proxy Client Request Errors 400 Bad Request 401 Authorization Required 402 Payment Required (not used yet) 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable (encoding) 407 Proxy Authentication Required 408 Request Timed Out 409 Conflicting Request 410 Gone 411 Content Length Required 412 Precondition Failed 413 Request Entity Too Long 414 Request URI Too Long 415 Unsupported Media Type  Server Errors 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported

Basic commands

Some Bash command line for Linux( A-Z ). -------------------------------------------------------------------------------------------------   a   adduser  Add a user to the system   addgroup Add a group to the system   alias    Create an alias •   apropos  Search Help manual pages (man -k)   apt-get  Search for and install software packages (Debian/Ubuntu)   aptitude Search for and install software packages (Debian/Ubuntu)   aspell   Spell Checker   awk      Find and Replace text, database sort/validate/index b   basename Strip directory and suffix from filenames   bash     GNU Bourne-Again SHell   bc       Arbitrary precision calculator language   bg       Send to background   break    Exit from a loop •   builtin  Run a shell builtin   bzip2    Compress or decompress named file(s) c   cal      Display a calendar   case     Conditionally perform a command   cat      Display the contents of a file   cd       Change Directory   cfdisk   Partition table ma

How to konw suPHP is enabled ?

To know if suPHP is enabled, In WHM : Main >> Service Configuration >> Apache Configuration >> PHP and SuExec Configuration current configuration.. Apache suEXEC on you can assume this means its enabled. In command-line : # /usr/local/cpanel/bin/rebuild_phpconf --current Available handlers: suphp dso fcgi cgi none DEFAULT PHP: 5 PHP4 SAPI: none PHP5 SAPI: suphp SUEXEC: enabled

eximstats database

Clearing eximstats database: If you would like to clear eximstats database: #mysql #use eximstats; Then run the below query to clear the tables. >delete from sends; >delete from smtp; >delete from failures; >delete from defers; Sometime the above tables shows as crashed like, Table './eximstats/sends' is marked as crashed and should be repaired In this situation, try below command to check "sends" table, # cd /var/lib/mysql/eximstats/ #myisamchk /var/lib/mysql/eximstats/sends.MYI to repair table : # myisamchk /var/lib/mysql/eximstats/sends.MYI -r Remove eximstats: If you would like to remove and recreate eximstats database, emptied the tables like this: # > table.MYD or # cd /var/lib/mysql/eximstats/ # rm -rf * # cd # mysql > DROP DATABASE eximstats; > CREATE DATABASE eximstats; > quit # mysql eximstats < /var/cpanel/sql/eximstats.sql Thats it .....

How to change source SMTP IP address in sendmail:

if you want to change the source SMTP ip address in sendmail. 1. Edit sendmail.cf (/etc/mail/sendmail.cf) through vi, nano or pico from: #O ClientPortOptions=Family=inet, Address=0.0.0.0 to: O ClientPortOptions=Family=inet, Address=< your IP here > # /etc/init.d/sendmail restat