Powered By Blogger

Thursday 28 February 2013

For the issue of CSF "Check /dev/shm is mounted noexec,nosuid"

For the issue of CSF "Check /dev/shm is mounted noexec,nosuid"

Secure " /dev/shm " partition :

#vi /etc/fstab 
and replace the following line

tmpfs /dev/shm tmpfs defaults 0 0

with the following line

tmpfs /dev/shm tmpfs noexec,nosuid 0 0


Then run the following commands :

# umount /dev/shm
#mount /dev/shm

Done.  :)


Regards,
Anzil Ali Liyakkath
Technical support
Myloth Technologies Pvt. Ltd.
Technical Wing: WebHostRepo Software Solutions

web:http://www.webhostrepo.com
twitter:http://twitter.com/webhostrepo
facebook:http://facebook.com/webhostreposs
linkedin:http://in.linkedin.com/in/webhostrepo

 

Wednesday 27 February 2013

MUNIN PLUGIN INSTALLATION IN CPANEL

Munin is a networked resource monitoring tool that can help analyze resource  trends and usage. It can monitor a wide variety of servers and equipment e.g.  servers, vpss, networks, applications etc
Munin provides very useful graphs with resource usage listed for different time periods like , daily , weekly and monthly graphs.
Installation of Munin as plugin on cPanel servers or vpss is very easy and straight forward.
===================================
 Go to below link in your WHM interface :

WHM >> cPanel >> Manage Plugins

You will find the Munin in the plugins section. Just check the check box in that section which says ‘ Install and keep updated ‘ and press save from the bottom of the page.
You will see the installation steps in the gui and it will complete in 5 to 10 minutes.
 ===========================================================
Once the installation is complete, you will find the plugin available at below path :

WHM >> Plugins >> Munin Service Monitor

In some cases you may encounter a blank page when you click on this link , in that case upgrade cpanel to latest CURRENT/STABLE release depending on your requirements using /scripts/upcp.

At this link you will find graphs for following services and equipment :
Apache, Disk, Exim, Mysql, Network, Other, Processes, System
Be default both daily and weekly graphs for each the above are available. Which give you very good idea on your resource consumption and to identify any bottle necks.
Its also a very good tool to identify if and when you need to upgrade to a higher plan for your hosting requirements.

For a non cPanel server you can do the installation by downloading the source directly and then install it. Or you can also do simple yum based installation.

After the installation you will need to configure the related files at /etc/munin path.  I will not be covering the manual installation details in this article , however the steps are not difficult and you can find plenty of articles covering them on internet.

Regards,
Anzil Ali Liyakkath
Technical support
Myloth Technologies Pvt. Ltd.
Technical Wing: WebHostRepo Software Solutions

web:http://www.webhostrepo.com
twitter:http://twitter.com/webhostrepo
facebook:http://facebook.com/webhostreposs
linkedin:http://in.linkedin.com/in/webhostrepo









 

Tuesday 26 February 2013

How to Set Up nginx Virtual Hosts

About Virtual Hosts in nginx


Virtual Hosts are used to run more than one website or domain off of a single server.

Note: according to the nginx website, virtual hosts are called Server Blocks on the nginx. However, for easy comparison with apache, I'll refer to them as virtual hosts in this tutorial.

Set Up

The steps in this tutorial require the user to have root privileges on the virtual private server. You can see how to set that up in the Initial Server Setup Tutorial in steps 3 and 4. Furthermore, if I reference the user in a step, I’ll use the name www. You can implement whatever username suits you.

Additionally, you need to have nginx already installed on your VPS.

If this is not the case, you can download it with this command:
 
#sudo apt-get install nginx

Step One— Create a New Directory


The first step in creating a virtual host is to a create a directory where we will keep the new website’s information.

This location will be your Document Root in the Apache virtual configuration file later on. By adding a -p to the line of code, the command automatically generates all the parents for the new directory.
 
#sudo mkdir -p /var/www/example.com/public_html

You will need to designate an actual DNS approved domain, or an IP address, to test that a virtual host is working. In this tutorial we will use example.com as a placeholder for a correct domain name.

However, should you want to use an unapproved domain name to test the process you will find information on how to make it work on your local computer in Step Six.

Step Two—Grant Permissions


We need to grant ownership of the directory to the right user, instead of just keeping it on the root system. You can replace the "www" below with the appropriate username.
 
#sudo chown -R www:www /var/www/example.com/public_html

Additionally, it is important to make sure that everyone is able to read our new files.
 
#sudo chmod 755 /var/www

Now you are all done with permissions.

Step Three— Create the Page


We need to create a new file called index.html within the directory we made earlier.
 
#sudo nano /var/www/example.com/public_html/index.html

We can add some text to the file so we will have something to look at when the the site redirects to the virtual host.
<html>
  <head>
    <title>www.example.com</title>
  </head>
  <body>
    <h1>Success: You Have Set Up a Virtual Host</h1>
  </body>
</html>

Save and Exit

Step Four—Create the New Virtual Host File


The next step is to create a new file that will contain all of our virtual host information.

nginx provides us with a layout for this file in the sites-available directory (/etc/nginx/sites-available), and we simply need to copy the text into a new custom file:
 
#sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com

Step Five—Set Up the Virtual Hosts


Open up the new virtual host file— you will see all the information you need to set up virtual host within.
 
#sudo nano /etc/nginx/sites-available/example.com

We need to make a couple of changes in these few lines:
 server {
        listen   80; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default ipv6only=on; ## listen for ipv6

        root /var/www/example.com/public_html;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name example.com;
}

  • Uncomment "listen 80" so that all traffic coming in through that port will be directed toward the site

  • Change the root extension to match the directory that we made in Step One. If the document root is incorrect or absent you will not be able to set up the virtual host.

  • Change the server name to your DNS approved domain name or, if you don't have one, you can use your IP address

  • You do not need to make any other changes to this file. Save and Exit.

    The last step is to activate the host by creating a symbolic link between the sites-available directory and the sites-enabled directory. In apache, the command to accomplish this is "a2ensite"—nginx does not have an equivalent shortcut, but it's an easy command nonetheless.
     
    #sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com

    To both avoid the "conflicting server name error" and ensure that going to your site displays the correct information, you can delete the default nginx server block:
     
    #sudo rm /etc/nginx/sites-enabled/default

    Step Six—Restart nginx


    We’ve made a lot of the changes to the configuration. Restart nginx and make the changes visible.
     
    #sudo service nginx restart

    Optional Step Seven—Setting Up the Local Hosts


    If you have pointed your domain name to your server’s IP address you can skip this step—you do not need to set up local hosts. Your virtual hosts should work. However, if want to try out your new virtual hosts without having to connect to an actual domain name, you can set up local hosts on your computer alone.

    For this step, make sure you are on the computer itself, not your droplet.

    To proceed with this step you need to know your computer’s administrative password, otherwise you will be required to use an actual domain name to test the virtual hosts.

    If you are on a Mac or Linux, access the root user (su) on the computer and open up your hosts file:
    #nano /etc/hosts 

    If you are on a Windows Computer, you can find the directions to alter the host file on the Microsoft site

    You can add the local hosts details to this file, as seen in the example below. As long as that line is there, directing your browser toward, say, example.com will give you all the virtual host details for the corresponding IP address.
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##
    127.0.0.1       localhost
    
    #Virtual Hosts 
    12.34.56.789    www.example.com 

    However, it may be a good idea to delete these made up addresses out of the local hosts folder when you are done to avoid any future confusion.

    Step Eight—RESULTS: See Your Virtual Host in Action


    Once you have finished setting up your virtual host, you can see how it looks online. Type your domain name or ip address into the browser (ie. http://12.34.56.789)


    Creating More Virtual Hosts


    To add more virtual hosts, you can just repeat the process above, being careful to set up a new document root with the appropriate domain name, and then creating and activating the new virtual host file.

    How to Install Ruby on Rails

    How to Install Ruby on Rails on Centos 6

    About Ruby on Rails


    Ruby on Rails is an application stack that provides developers with a framework to quickly create a variety of web applications.

    Ruby on Rails does take a little while to install on a virtual private server, but luckily there are a lot of helpful tools to make this process as easy as possible.

    Step One— Install Ruby with RVM


    Before we do anything else, we should run a quick update to make sure that all of the packages we download are up to date:
     
    #sudo yum update

    Once that's done, we can start installing RVM, Ruby Version Manager. This is a great program that lets you use several versions of Ruby on one VPS; however, in this case, we will just use it to install the latest version of Ruby on the droplet.

    If you do not have curl on your system, you can start by installing it:
    #sudo yum install curl

    To install RVM, open terminal and type in this command:
     
    #curl -L get.rvm.io | bash -s stable

    After it is done installing, load RVM.
    #source ~/.rvm/scripts/rvm

    In order to work, RVM has some of its own dependancies that need to be installed. You can see what these are:
    #rvm requirements

    In the text that RVM shows you, look for this paragraph.
    Additional Dependencies:
    # For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
      ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel ## NOTE: For centos >= 5.4 iconv-devel is provided by glibc

    Go ahead and download the recommended dependancies, being careful not to use sudo. Instead, we should use rvmsudo:
    #rvmsudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel

    Step Two—Install Ruby


    Once you are using RVM, installing Ruby is easy.
    #rvm install 1.9.3

    Ruby is now installed. However, since we accessed it through a program that has a variety of Ruby versions, we need to tell the system to use 1.9.3 by default.
    #rvm use 1.9.3 --default

    Step Three—Install RubyGems


    The next step makes sure that we have all the required components of Ruby on Rails. We can continue to use RVM to install gems; type this line into terminal.
     #rvm rubygems current

    Step Four—Install Rails


    Once everything is set up, it is time to install Rails.

    To start, open terminal and type in:
    #gem install rails

    This process may take a while, be patient with it. Once it finishes you will have Ruby on Rails installed on your droplet.

    Once you have installed Ruby on Rails on your VPS, you can proceed to Create a SSL Certificate for your site or Install an FTP server

    How to Set Up a Firewall Using IP Tables on Ubuntu 12.04


    In order to make a server more secure after the initial set up, Ubuntu ships with Iptables which is the distribution’s default firewall. At the outset, although the Ubuntu firewall is configured, it is set up to allow all incoming and outgoing traffic on a vritual private server. To enable some stronger protection on the server, we can add some basic rules to the IP Table.

    The IP table rules come from a series of options that can be combined to create each specific process. Each packet that crossing the firewall is checked by each rule in order. As soon as it matches a rule, the packet follows the associated action, otherwise it proceeds down the line.

    IP Table Commands


    Although this tutorial will go over a limited amount of commands that would provide a server with some basic security, there are a variety of nuanced and specific cases that can be developed for the IP Table. Below are some of the most useful commands for developing a firewall for your VPS, but keep in mind that this is a short list and there are a variety of other options.
     
    -A: (Append), adds a rule to the IP Tables
    -L:  (List), shows the current rules
    -m conntrack: allows rules to be based on the current connection state, elaborated in the the --cstate command.
    --cstate: explains the states that connections can be in, there are 4: New, Related, Established, and Invalid
    -p: (port), refers to the the port through which the machine connects
    -j: (jump), this command refers to the action that needs to be taken if something matches a  rule perfectly. It translates to one of four possibilities:
     -ACCEPT: the packet is accepted, and no further rules are processed
     -REJECT: the packet is rejected, and the  sender is notified, and no further rules are processed
     -DROP: the packet is rejected, but the  sender is not notified, and no further rules are processed
     -LOG: the packet is accepted but logged, and the following rules are processed 
    -I: (Insert), adds a rule between two previous ones
    -I INPUT 3: inserts a rule into the IP Table to make it the third in the list
    -v: (verbose), offers more details about a rule

    Creating the IP Table:


    If you type in the following, you can see the current rules in the virtual server's IP Table:
    sudo iptables -L

    They should look like this:
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination

    If you have another set of rules in place or want to start fresh, you can always set the rules back to the default by flushing and deleting all of them:
     
    sudo iptables -F

    Additionally, if you want speed up your work with IP Table, you can include -n in the command. This option disables DNS lookups and prevents the command from trying to find the reverse of each IP in the ruleset. You could use this to list rules, as an example:
     
    iptables -L -n

    A Basic Firewall


    As it stands the current rules allow all connections, both incoming and outgoing. There are no security measures in place whatsoever. As we build up the table, keep in mind that as soon as a packet is ACCEPTED, REJECTED, or DROPPED, no further rules are processed. Therefore the rules that come first take priority over later ones.

    While creating the rules, we have to be sure to prevent ourselves from accidentally blocking SSH (the method through which we connected to the server).

    To start off, let’s be sure to allow all current connections, all of the connections at the time of making the rule, will stay online:

    sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

    We can go ahead and break this down:
    1. -A tells the IP table to append a rule to the table.

    2. INPUT designates this rule as part of the Input chain.

    3. m conntrack followed by the --cstate ESTABLISHED,RELATED guarantees that the result of this rule will only apply to current connections and those related to them are allowed

    4. -j ACCEPT tells the packet to JUMP to accept and the connections are still in place.

    After we are assured that all the current connections to the virtual private server can stay up uninterrupted, we can proceed to start blocking off other insecure connections.

    • Let’s assume that we want to block all incoming traffic, except for those coming in on 2 common ports: 22 for SSH and 80 for web traffic. We proceed by allowing all traffic on the designated ports with the following commands:
    sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
    sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT

    In both of these commands, the -p option stands for the protocol with which the connection is being made, in this case tcp, while the --dport specifies the port through which the packet is being transmitted.

    After we have guaranteed that the desirable traffic will make it through the firewall, we can finish up by blocking all remaing traffic from accessing our virtual server. Because this is the last rule in the list, all traffic that matches any of the previous rules in the IP Table will not be affected, and will be treated as we set up previously.

    • Let’s make a rule to block all of the remaining traffic:
    sudo iptables -A INPUT -j DROP

    With that, we can see what our updated rules look like:
    sudo iptables -L
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    ACCEPT     all  --  anywhere             anywhere            ctstate RELATED,ESTABLISHED 
    ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 
    ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http 
    DROP       all  --  anywhere             anywhere

    • We are almost finished. However, we are missing one more rule. We need to provide our VPS with loopback access. If we were to add the rule now without further qualifiers, it would go to the end of the list and, since it would follow the rule to block all traffic, would never be put into effect.

    In order to counter this issue, we need to make this rule first in the list, using the INPUT option :
    sudo iptables -I INPUT 1 -i lo -j ACCEPT

    1. -I INPUT 1 places this rule at the beginning of the table

    2. lo refers to the loopback interface

    3. -j ACCEPT then guarantees that the loopback traffic will be accepted
    Now we have finished creating a basic firewall. Your rules should look like this (we can see the details of the iptable by typing -v):
     
    sudo iptables -L -v

    Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
     pkts bytes target     prot opt in     out     source               destination         
        0     0 ACCEPT     all  --  lo     any     anywhere             anywhere            
     1289 93442 ACCEPT     all  --  any    any     anywhere             anywhere             ctstate RELATED,ESTABLISHED
        2   212 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh
        0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:http
       47  2422 DROP       all  --  any    any     anywhere             anywhere            
    
    Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
     pkts bytes target     prot opt in     out     source               destination         
    
    Chain OUTPUT (policy ACCEPT 157 packets, 25300 bytes)
     pkts bytes target     prot opt in     out     source               destination       

    However, as soon as the virtual server reboots, the IP tables will be wiped. The next step will go over saving and restoring the IP tables.

    Saving IP Tables


    Although the IP tables are effective, they will automatically be deleted if the server reboots. To make sure that they remain in effect, we can use a package called IP-Tables persistent.

    We can install it using apt-get:
     
    sudo apt-get install iptables-persistent

    During the installation, you will be asked if you want to save the iptable rules to both the IPv4 rules and the IPv6 rules. Say yes to both.

    Your rules will then be saved in /etc/iptables/rules.v4 and /etc/iptables/rules.v6.

    Once the installation is complete, start iptables-persistent running:
     
    sudo service iptables-persistent start

    After any server reboot, you will see that the rules remain in place.

    Regards,
    Anzil Ali Liyakkath

    Technical support
    Myloth Technologies Pvt. Ltd.
    Technical Wing: WebHostRepo Software Solutions

    web:http://www.webhostrepo.com
    twitter:http://twitter.com/webhostrepo
    facebook:http://facebook.com/webhostreposs
    linkedin:http://in.linkedin.com/in/webhostrepo






    Wednesday 20 February 2013

    Nameserver ips not showing in whm

    Please refer the below steps for your information.

    root@root[~]# cat /etc/nameserverips
    198.168.0.1=ns1.test.com
    198.168.0.2=ns2.test.com

    In that case correct ips entry in the following /var/cpanel/nameserverips.yaml file.

    root@root [~]# cat /var/cpanel/nameserverips.yaml

    ns1.test.com:
    “198.168.0.1″: 1
    count: 1
    zones: test.com
    ns2,.test.com:
    198.168.0.2: 1
    count: 1
    zones: test.com

    run the command #/scripts/updatenameserverips .

    Now check nameserver ips in WHM >> Main >> DNS Functions >> Nameserver IPs.

    Monday 18 February 2013

    Configuring IPv6 networking in Ubuntu server

    Configuring IPv6 networking in Ubuntu server

    First backup current network configuration
    #cp /etc/network/interfaces /etc/network/interfaces.backup

    How to delete an ipv6 address :  #ifconfig eth0 inet6 del 2604:2881::8fe5:27e2/64

    How to add an ipv6 address :  #ifconfig eth0 inet6 add 2604:2881::8fe5:27e2/64

    Add an IPv6 route through gateway

    #route -A inet6 add 2604:2880::8fe5:27e2/64 gw <gateway ip>
    OR
    #ip -6 route add 2604:2880::8fe5:27e2/64 via <gateway ip>

    #/etc/init.d/networking restart

    to see the new ipv6 address :
    #ip -6 address show eth0

    to see ipv6 route :
    # ip -6 route show dev eth0

    PERMANENTLY ADDING IPV6

    Append the below lines in #vi /etc/network/interfaces

    iface eth0 inet6 static
    pre-up modprobe ipv6
    address 2604:2880::8fe5:27e2/64
    netmask 64
    gateway 2247:f0d0:2001:000a:f0d0:2001::1
    dns-nameservers 2001:4860:4860::8888 2001:4860:4860::8844


    If ipv6 nameserver IPs are not there in /etc/resolv.conf then add Google Public DNS IPv6 addresses

    nameserver 2001:4860:4860::8888
    nameserver 2001:4860:4860::8844


    #route -A inet6 add 2604:2880::8fe5:27e2/64 gw 2247:f0d0:2001:000a:f0d0:2001::1

    #/etc/init.d/networking restart

    To test ipv6 connectivity :

    #ping6 google.com
     
    Regards,
    Anzil ALi Liyakkath
    Technical support
    Myloth Technologies Pvt. Ltd.
    Technical Wing: WebHostRepo Software Solutions

    web:http://www.webhostrepo.com
    twitter:http://twitter.com/whrss
    facebook:http://facebook.com/webhostrepo
    linkedin:http://in.linkedin.com/in/webhostrepo

    SYSCTL hardening

    # Turn on execshield
    kernel.exec-shield=1
    kernel.randomize_va_space=1

    # Enable IP spoofing protection
    net.ipv4.conf.all.rp_filter=1

    # Disable IP source routing
    net.ipv4.conf.all.accept_source_route=0

    # Ignoring broadcasts request
    net.ipv4.icmp_echo_ignore_broadcasts=1
    net.ipv4.icmp_ignore_bogus_error_messages=1

    # Make sure spoofed packets get logged
    net.ipv4.conf.all.log_martians = 1
    net.ipv4.conf.default.log_martians = 1

    # Disable ICMP routing redirects
    sysctl -w net.ipv4.conf.all.accept_redirects=0
    sysctl -w net.ipv6.conf.all.accept_redirects=0
    sysctl -w net.ipv4.conf.all.send_redirects=0
    sysctl -w net.ipv6.conf.all.send_redirects=0

    # Disables the magic-sysrq key
    kernel.sysrq = 0

    # Turn off the tcp_sack
    net.ipv4.tcp_sack = 0

    # Turn off the tcp_timestamps
    net.ipv4.tcp_timestamps = 0

    # Enable TCP SYN Cookie Protection
    net.ipv4.tcp_syncookies = 1

    # Enable bad error message Protection
    net.ipv4.icmp_ignore_bogus_error_responses = 1

    Spammers in cpanel cPanel Servers...!

    Steps to Catch Spammers and Scammers on cPanel Servers...!


    To enable extended loggin in exim to trace nobody mails. Try the following
    trick .

    1. Edit /etc/exim.conf

    2. On the second line add :

    log_selector = +address_rewrite +all_parents +arguments +connection_reject
    +delay_delivery +delivery_size +dnslist_defer +incoming_interface
    +incoming_port +lost_incoming_connection +queue_run +received_sender
    +received_recipients +retry_defer +sender_on_delivery +size_reject
    +skip_delivery +smtp_confirmation +smtp_connection +smtp_protocol_error
    +smtp_syntax_error +subject +tls_cipher +tls_peerdn \


    Make sure all that comes on a single line.

    3. Save and exit.

    4. Restart Exim.

    5. tail -f /var/log/exim_mainlog

    A little bit luck and you should be able to catch the spammer by checking exim_mainlog. If you fail to catch the spammer from this then he is using some other way of spamming and to catch him you will need to understand all the steps given below :-

    1 > Get the message ID from the header of the spam. It should be in format like 1DWJj4-00042i-74 ( this is the most important step else all thats given below is crap )

    2 > grep exim_mainlog with the message ID ( Ex : grep 1DWJj4-00042i-74 /var/log/exim_mainlog )

    3 > Check the time on which the spam was sent and also check all that is shown after grep.

    4 > If you find out the domain name or path of the scripts from exim_mainlog then go ahead and suspend the spammer, else proceed to step 5.

    5 > Use this message ID to check the original message or bounced message in /var/spool/exim/input/. You should see 2 files there, one with -D at end and one with -H at the end. ( Ex : /var/spool/exim/input/4/1DWJj4-00042i-74-D & /var/spool/exim/input/4/1DWJj4-00042i-74-H ) This 2 files will have all the information that was sent in the spam message and if it was sent using mailing list then you will catch the username of spammer in auth_sender part of this files. If it shows nobody then its your bad luck Proceed to step 6.

    6 > If exim_mainlog shows the spams originating from /tmp of the server then check the files in /tmp of the server. user of the file will be seen as nobody:nobody. Take down the time of creation of file. This time is what we need to find out who uploaded the script. You will need to convert this time into the time format of /usr/local/apache/logs/error_log & then in the format of the domlogs located at /usr/local/apache/domlogs/*

    7 > for file in /usr/local/apache/domlogs/*; do cat $file |grep "example"; done; ( you cannot do direct grep for the query here as it will give error that the arguement list is too long )

    8 > If the results in step 2 have shown some domain name or some username in common as sender of the spam but now you dont see that domain name on the server then check /var/cpanel/accounting.log to see if that account has been terminated from the server ( Ex : grep ebayspammer.com /var/cpanel/accounting.log )

    All that we need to know is importance of /var/log/exim_mainlog, /var/log/formmail.log, /usr/local/apache/logs/error_log, /usr/local/apache/domlogs/*,
    /var/spool/exim/input/*/* and the files uploaded in /tmp of the server. Major spamming issues are caught using the time of sending the spam. You will need to work on your own when you get across such issue and use your logic to convert the time of sending the spams to the time format of respective log files I mentioned above.

    If you fail to catch active spamming on the server in short time then rename /etc/exim.conf and killall -KILL exim. If this has not stopped the process then check the running mysql processes and stop mysql if needed. If no results then stop http service or find the process ID and kill it.

    Only EXPERIENCE makes you SPAM Catcher.

    IPs that made more number of connections to the mail server

    this will give IPs that made more number of connections to the mail server.


    #tail -3000 /var/log/exim_mainlog |grep  '[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*' | awk -F\[ {'print $2'} |awk -F\] {'print $1'} | sort | uniq -c | sort -k 1 -nr | head -n 20


    if an IP have more than 100 connections block it in csf .


    #csf -d x.x.x.x {mailspammer}

    Tuesday 12 February 2013

    enabling GD in whm

    How to enable GD Support on WHM/CPanel VPS?

    In order to enable GD Support in your WHM/CPanel VPS you need to complete the following steps:
    1. Login to WHM as root
    2. Go to Software -> EasyApache
    3. If prompted to upgrade, do so then repeat step 2
    4. Begin customizing based on the current provile
    5. Proceed through the screens until you get to "Step 5"
    6. On "Step 5," click on "Exhaustive Options"
    7. Under PHP, check the checkbox for GD
    8. Proceed with Build & Compile Process
    9. Make sure you wait for the build to complete.
     Regards,
    Anzil Ali
    Jr.Linux Server Administrator
    Myloth Technologies Pvt. Ltd.
    Technical Wing: WebHostRepo Software Solutions
    9447622905(mobile)

    web:http://www.webhostrepo.com
    twitter:http://twitter.com/whrss
    facebook:http://facebook.com/webhostrepo
    linkedin:http://in.linkedin.com/in/webhostrepo


    Tuesday 5 February 2013

    exim installation in ubuntu

    #sudo apt-get install exim4 mutt
     
    #  sudo dpkg-reconfigure exim4-config
      ----------------------------------------------------------------------------------------
            smarthost - no local delivery
            E-Mail-Name: name of the local machine e.g. 'myLaptop.example.com'
            incoming connections: 127.0.0.1
            local domains: empty
            visible domain name:  'example.com'
            smarthost: mySmarthost.example.com
            limit dns: no
            small config files: yes
        -----------------------------------------------------------------------------------------------------------
          

          #sudo vi /etc/exim4/passwd.client
            mySmarthost.example:login:password
       
           #sudo /etc/init.d/exim4 restart

    test:
    mutt test@example.com

    Monday 4 February 2013

    Webmin installation in debian

    Before you begin, you should install any necessary dependencies for Webmin:


    #apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

    If you are using the DEB version of webmin, first download the file from the downloads page , or run the command :

    # wget http://prdownloads.sourceforge.net/webadmin/webmin_1.610_all.deb 

    then run the command :

    #dpkg --install webmin_1.610_all.deb

    The install will be done automatically to /usr/share/webmin, the administration username set to root and the password to your current root password. You should now be able to login to Webmin at the URL http://localhost:10000/. Or if accessing it remotely, replace localhost with your system's IP address.  

    Regards,
    Anzil Ali
    Jr.Linux Server Administrator
    Myloth Technologies Pvt. Ltd.
    Technical Wing: WebHostRepo Software Solutions

    web:http://www.webhostrepo.com
    twitter:http://twitter.com/whrss
    facebook:http://facebook.com/webhostrepo
    linkedin:http://in.linkedin.com/in/webhostrepo