Friday, 4 February 2011

Easy Linux backups

We would all like to think that, since we are using Linux, we will never really need a backup of our data. Now, let's look at this realistically. Even if your OS is 100% rock solid, with nary a nanosecond of downtime, that hardware running that OS can not possibly give 100% forever. Add to that the irresistible urge to upgrade hardware and you have the serious makings for the need to back up.
When you need to back up where do you turn? Of course you could slap together a good ol' fashion Bash script using rsync, ssh, tar, and a few other Linux tools. But for those who haven't the slightest idea how to cobble together their own Bash scripts, what is there to use to back up all of that precious data? Those of you who don't want to “roll your own” or those just looking for something easy to use, you're in luck... thanks to Lucky Backup! Lucky Backup is a very user-friendly backup tool that will have you backing up remotely or locally in no time. Once you've seen Lucky Backup in action you will never think Linux backups are difficult again.

Features

Of all the backup utilities I have used I have to say Lucky Backup is the easiest. It has a user-friendly interface that will make any user happy, and has the following features:
  • Create full backups.
  • Create snapshot backups.
  • Sync data directories.
  • Data checks to ensure nothing is erased.
  • Simple and advanced options.
  • Include/Exclude files.
  • Local or remote backups.
  • Scheduled backups.
  • Backup simulation.
  • Logging.
  • Command line option.
  • Profiles.

Installation

Installing Lucky Backup is simple. All you need to do is open up your Add/Remove Software utility, search for “luckybackup” (no quotes), select Lucky Backup for installation, and click Apply to install. Once installed you will find the tool in Applications > Accessories on GNOME. It might vary on other desktops.

Using Lucky Backup


When you open Lucky Backup the main window (see Figure 1) has pretty much everything you need to create and run a backup. Let's take a look at the process for creating a scheduled local backup.
Let's assume you are only going to need one profile for backup. You could, of course, create multiple profiles which would allow you to have multiple backup sets that could be run at different times (making Lucky Backup fairly flexible). But for the sake of simplicity, let's stick with a single profile.
The first step is to click the Add button which will open up the Task Properties window (see Figure 2). In this window you will need fill out a few pieces of information. As you can see you can only add one directory
per task. If you need multiple sources for this profile you simply create a task for each source.
Obviously you will not want your Source and Destination to be located on the same drive. For a local backup you will want to have either a second drive or an external drive attached. This drive will be your Destination for your tasks. You will also want to pay close attention to the Type of backup you are creating. You can do a full backup (copy all files/sub-folders from the source to the destination) or a synchronized backup (make sure source and destination are the same).
If you want to do any file/folder exclusion make sure you click on the Advanced button. In the Advanced section you can setup excludes, remote options, command options, and extra executables. Before you click the OK button it is always wise to click the Validate button to ensure your backup settings are good to go.

Once you have all of your tasks created you will want to set up the scheduled aspect of the backup. To do this click Profile > Schedule and then click the Add button in the new window (see Figure 3).
When the Schedule window opens click the Add button which will open up the scheduler. From here you can choose a Profile to schedule and then set the interval in which to back up. After you set the time for the backup click OK and the schedule is set...but not complete. After you set the schedule up you then need to click the crontIT! button which will then automatically create a cron job for the backup job.
Multiple backups
Let's say you have multiple directories you want to back up. You might even want different directories to back up in different way, to different locations, or to be run at different times or intervals. For this you will want to create multiple tasks. You could easily create a task for such backups as:
  • Documents
  • Music
  • Pictures
  • Videos
You get the idea. You can have as many tasks as you want. You can even create specific profiles and then create different tasks for each profile. Very flexible.

Remote backups

ou can do remote backups with Lucky Backup as well. Attended remote backups are actually quite easy to do. It is only when you want to do scheduled remote backups that you run into any difficulty. Let's take a look at how to do a single instance of a remote backup first. To do this you would create your backup as you normally would, but you must click on the Advanced button. From the Advanced properties click the Remote tab and begin to fill out the information necessary (see Figure 4).
To do an attended remote backup you will only need to fill out the following:
  • Destination (you need to make sure this directory exists on the remote machine).
  • User (this user must exist on the remote machine).
  • Host (this IP address or host name of the remote machine).
You will also need to select the ssh checkbox. After you complete that information click the Validate button to make sure everything is correct. If it checks out click Okay and you are then ready to run the backup.
There is one thing you will find when running a Lucky Backup remote backup. You will want to start Lucky Backup from the command line so you will be able to enter your ssh password (for the remote host). To start Lucky Backup from the command line open up a terminal window and issue the command luckybackup. Now when you hit the start button on Lucky Backup you will see your console window prompting for your ssh password. Enter the password and hit the Enter key to continue on with your backup.
If you want to schedule a remote backup you will have to set secure shell up to do password-less authentication. This is not necessarily the most secure process. If, however, you want to set this up just follow these steps:
On the local machine issue the command:
ssh-keygen -t dsa
This command will generate public keys that you can then copy to your remote machine. During the key generation do not enter a password, just hit enter when prompted. After the keys are generated copy them to the server with the command:
ssh-copy-id -i .ssh/id_dsa.pub username@destination
Where username is the user you will log into the remote server with and destination is the IP address of the server. To test this go back to the local machine and attempt to ssh into the server. You should automatically be logged into the remote machine. You can now set up scheduled, remote backups.

Running a backup

In order to manually run a backup (such as a remote backup) select the task you want to run and then click the Start button. You can optionally check the “simulator” check box to simulate the backup to make sure it will run properly. That's all you need to do! Let your backup run to completion and you're finished.

How to Enable/Disable IMAP service for a domain from MailEnable?

In order to enable/disable IMAP service for a particular domain from MailEnable one need to perform below mentioned steps:

1) Login into MailEnable Professional.
2) Click on MailEnable -> MailEnable Management -> Messaging Center -> Post Offices.
3) Right Click on domain name -> Properties for which one need to perform the task.
4) Go to the Tab “Service Selection”.
5) Select the ‘Enable or Disable’ from drop down menu against IMAP Service.
6) Click on apply and Ok.

Thursday, 3 February 2011

What are DNS resolvers?

The client-side of the DNS is called a DNS resolver. It is responsible for initiating and sequencing the queries that ultimately lead to a full resolution (translation) of the resource sought, e.g., translation of a domain name into an IP address.

A DNS query may be either a non-recursive query or a recursive query:

    * A non-recursive query is one in which the DNS server provides a record for a domain for which it is authoritative itself, or it provides a partial result without querying other servers.
    * A recursive query is one for which the DNS server will fully answer the query (or give an error) by querying other name servers as needed. DNS servers are not required to support recursive queries.

The resolver, or another DNS server acting recursively on behalf of the resolver, negotiates use of recursive service using bits in the query headers.

Resolving usually entails iterating through several name servers to find the needed information. However, some resolvers function simplistically and can communicate only with a single name server. These simple resolvers (called "stub resolvers") rely on a recursive name server to perform the work of finding information for them Source wikipedia.

What are my DNS Records?

The Internet maintains two principal namespaces, the domain name hierarchy and the Internet Protocol (IP) address system. The Domain Name System maintains the domain namespace and provides translation services between these two namespaces. Internet name servers and a communication protocols implement the Domain Name System. A DNS name server is a server that stores the DNS records for a domain name, such as address (A) records, name server (NS) records, and mail exchanger (MX) records (see also List of DNS record types); a DNS name server responds with answers to queries against its database. Source Wikipedia

How to Fix Server Application Unavailable’ Error

Microsoft identified an issue with the MS03-32 Security Update for Internet Explorer security patch and ASP.NET 1.0 running on Windows XP. This patch can be installed manually or by obtaining recent critical updates from the Windows Update site.
The symptom of this issue is that after installing the patch on a Windows XP machine, all requests to ASP.NET applications running on the local IIS 5.1 web server result in an error message saying “Server Application Unavailable”. Requests to remote web servers are unaffected.
This issue only impacts installations running ASP.NET 1.0 on Windows XP. It does not impact machines running Windows 2000 or Windows Server 2003. It also does not impact machines running Windows XP with ASP.NET 1.1 installed.
Please note that this issue is not a security bug with ASP.NET. It does not open up or allow any malicious attacks against an ASP.NET application or server. Instead, it is purely a functional bug caused by the patch itself.
We are working hard on a permanent solution for this issue. In the meantime, you can execute the following batch file as a workaround for the issue. The batch file does the following:
  1. Stops the IIS and ASP.NET state services
  2. Deletes and recreates the ASPNET account with a known temporary password
  3. Uses the Windows runas command to launch an executable that creates an ASPNET user profile
  4. Re-registers ASP.NET. This creates a new random password for the account and applies default ASP.NET access control settings for it
  5. Restarts the IIS service
The batch file contains a hardcoded temporary password of “1pass@word” which you will be prompted to enter for the runas command when the batch file is run.  After the runas command completes, the ASPNET account password is recreated with a strong random value.  Note that the batch file may fail if the hardcoded password does not meet the password complexity requirements in your environment.  If that's the case, you can change it to another value that is appropriate for your environment.
Important note: If you have added custom access control settings or database account permissions for the ASPNET account, they will need to be recreated after this batch file completes.  This is because when the account is recreated, it will get a new security identifier (SID).
Important note: If you are running the ASP.NET worker process with a custom account other than the ASPNET account, then you should not run this batch file.  Instead, you should log in interactively or use the runas command with that account which will create a user profile for that account.
The batch file is included in the self-extracting archive below. To use it:
  1. You must be running as an account with Administrator privileges
  2. Download and open the self-extracting executable file
  3. Extract the contents to c:\
  4. Select Run... from the start menu, and enter cmd.exe
  5. In the open command windows, type c:\fixup.cmd.
  6. When prompted, enter 1pass@word as the password.
  7. If you have previously custom access control settings or database account permissions for the ASPNET account, you'll need to re-apply these settings now.
Many apologies for the inconvenience that this has caused. We’ll post additional information as it becomes available.
The matrix below details platforms and versions impacted by this issue.
.NET Framework Platform Affected
Version 1.0 Windows 2000 Professional No
Version 1.0 Windows 2000 Server No
Version 1.0 Windows XP Professional Yes
Version 1.0 Windows Server 2003 No
Version 1.0 Windows XP Home with Cassini No
Version 1.1 Windows 2000 Professional No
Version 1.1 Windows 2000 Server No
Version 1.1 Windows XP Professional No
Version 1.1 Windows Server 2003 No
Version 1.1 Windows XP Home with Cassini No
Thanks,
The ASP.NET Team Source ASP.NET

Wednesday, 2 February 2011

how to stop php nobody spammers

Today I will guide you how to  stop php nobody spammers , Its a very very host issue faced by Web hosting Linux System Administrator

PHP and Apache has a history of not being able to track which users are sending out mail through the PHP mail function from the nobody user causing leaks in formmail scripts and malicious users to spam from your server without you knowing who or where.

Stop PHP nobody Spammers

Update: May 25, 2005:
- Added Logrotation details
- Added Sample Log Output

PHP and Apache has a history of not being able to track which users are sending out mail through the PHP mail function from the nobody user causing leaks in formmail scripts and malicious users to spam from your server without you knowing who or where.

Watching your exim_mainlog doesn't exactly help, you see th email going out but you can't track from which user or script is sending it. This is a quick and dirty way to get around the nobody spam problem on your Linux server.

If you check out your PHP.ini file you'll notice that your mail program is set to: /usr/sbin/sendmail and 99.99% of PHP scripts will just use the built in mail(); function for PHP - so everything will go through /usr/sbin/sendmail =)

Requirements:
We assume you're using Apache 1.3x, PHP 4.3x and Exim. This may work on other systems but we're only tested it on a Cpanel/WHM Red Hat Enterprise system.

Time:
10 Minutes, Root access required.

Step 1)
Login to your server and su - to root.

Step 2)
Turn off exim while we do this so it doesn't freak out.
/etc/init.d/exim stop

Step 3)
Backup your original /usr/sbin/sendmail file. On systems using Exim MTA, the sendmail file is just basically a pointer to Exim itself.
mv /usr/sbin/sendmail /usr/sbin/sendmail.hidden

Step 4)
Create the spam monitoring script for the new sendmail.
pico /usr/sbin/sendmail

Paste in the following:


#!/usr/local/bin/perl

# use strict;
 use Env;
 my $date = `date`;
 chomp $date;
 open (INFO, ">>/var/log/spam_log") || die "Failed to open file ::$!";
 my $uid = $>;
 my @info = getpwuid($uid);
 if($REMOTE_ADDR) {
         print INFO "$date - $REMOTE_ADDR ran $SCRIPT_NAME at $SERVER_NAME n";
 }
 else {

        print INFO "$date - $PWD -  @infon";

 }
 my $mailprog = '/usr/sbin/sendmail.hidden';
 foreach  (@ARGV) {
         $arg="$arg" . " $_";
 }

 open (MAIL,"|$mailprog $arg") || die "cannot open $mailprog: $!n";
 while (<STDIN> ) {
         print MAIL;
 }
 close (INFO);
 close (MAIL);


Step 5)
Change the new sendmail permissions
chmod +x /usr/sbin/sendmail

Step 6)
Create a new log file to keep a history of all mail going out of the server using web scripts
touch /var/log/spam_log

chmod 0777 /var/log/spam_log

Step 7)
Start Exim up again.
/etc/init.d/exim start

Step 8)
Monitor your spam_log file for spam, try using any formmail or script that uses a mail function - a message board, a contact script.
tail - f /var/log/spam_log

Sample Log Output

Mon Apr 11 07:12:21 EDT 2005 - /home/username/public_html/directory/subdirectory -  nobody x 99 99   Nobody / /sbin/nologin

Log Rotation Details
Your spam_log file isn't set to be rotated so it might get to be very large quickly. Keep an eye on it and consider adding it to your logrotation.

pico /etc/logrotate.conf

FIND:
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

ADD BELOW:

# SPAM LOG rotation
/var/log/spam_log {
    monthly
    create 0777 root root
    rotate 1
}



Notes:
You may also want to chattr + i /usr/sbin/sendmail so it doesn't get overwritten.

Enjoy knowing you can see nobody is actually somebody =)

Thanks to MattF and others who worked on this.

cheap web hosting in canada price detail of toonie web hosting

Toonie web hosting  the customer, the highest quality Web Hosting at unbelievable low costs. All of our cheap web hosting accounts are fast, reliable, and secure. Connected to our redundant multi network infrastructure and great technical support. Why should YOU pay more for web hosting when you just don't have to! With ToonieHosting.ca, YOU only pay for what you need. Many clients have asked for a web hosting package that will give them what they really need without all the FLASHY glitz and extras which they do not need. Well we listened to YOU, the customer, and here it is. Don't see something you need, please Contact Us and we will see what we can do to get it online for you. Quite a few hosting companies out there advertise UNLIMITED bandwidth and web space but if you read the Terms of Service, you will see they truly limit your site and will suspend you account if your popular. Here at tooniehosting.ca, we don't!
Cost per Month (CAD)     $1.00     $2.00     $5.00     $10.00
    Disk Storage     200 MB     500 MB     1000 MB     2500 MB
?     Monthly Bandwidth Allowance     4 GB     10 GB     40 GB     60 GB
Domains and Subdomains     Loonie     Toonie     Five Buck     Ten Buck
?     International Domains     Yes     Yes     Yes     Yes
?     Add-on Domains     0     0     3     10
?     Sub-Domains     0     5     25     60
Email Features     Loonie     Toonie     Five Buck     Ten Buck
?     POP3 E-mail Accounts     5     20     50     100
?     Web-Based E-mail Interface     No     Yes     Yes     Yes
?     Unlimited E-mail Aliasing     Unlimited     Unlimited     Unlimited     Unlimited
?     Unlimited E-mail Forwarding     Yes     Yes     Yes     Yes
    Unlimited E-mail Autoresponders     No     Yes     Yes     Yes
?     Catch-all E-mail Enabled     Yes     Yes     Yes     Yes
Supported Software     Loonie     Toonie     Five Buck     Ten Buck
    Flash Support     Yes     Yes     Yes     Yes
    Java Support     Yes     Yes     Yes     Yes
    Support for JavaScript     Yes     Yes     Yes     Yes
    Support for Imagemaps     Yes     Yes     Yes     Yes
    Wireless Application Protocol (WAP)     Yes     Yes     Yes     Yes
    Adobe Pagemill     Yes     Yes     Yes     Yes
    Macromedia Dreamweaver     Yes     Yes     Yes     Yes
    Microsoft Office     Yes     Yes     Yes     Yes
    Microsoft Publisher     Yes     Yes     Yes     Yes
    PHP 5.*     PHP 4     Yes     Yes     Yes
?     WordPress.org     Yes     Yes     Yes     Yes
?     drupal.org     Yes     Yes     Yes     Yes
Advanced Features     Loonie     Toonie     Five Buck     Ten Buck
    CGI-BIN Directory     Yes     Yes     Yes     Yes
    Perl 5.8.8 plus modules     Yes     Yes     Yes     Yes
    .htaccess     Yes     Yes     Yes     Yes
    PHP 5     Yes     Yes     Yes     Yes
    Custom Error Pages     Yes     Yes     Yes     Yes
    Password Protected Directories     Yes     Yes     Yes     Yes
    Server Side Includes     Yes     Yes     Yes     Yes
    MySQL Database(s)     1     5     Unlimited     Unlimited
    phpMyAdmin (Web Based MySQL)     Yes     Yes     Yes     Yes
    URL Redirection     Yes     Yes     Yes     Yes
?     DNS Management     Yes     Yes     Yes     Yes
?     Route Email to Gmail     Yes     Yes     Yes     Yes
Website Management     Loonie     Toonie     Five Buck     Ten Buck
?     Parallels Pro Control Panel     Yes     Yes     Yes     Yes
?     Web Based File Manager     Yes     Yes     Yes     Yes
    Unlimited FTP access     Yes     Yes     Yes     Yes
?     User Agent and Referrer Logs     Yes     Yes     Yes     Yes
    Error Logs     Yes     Yes     Yes     Yes
    Access to Raw Log Files     Yes     Yes     Yes     Yes
?     Disk Usage Details     Yes     Yes     Yes     Yes
    Bandwidth Usage Details     Yes     Yes     Yes     Yes
    Detailed Graphical Site Statistics     No     Yes     Yes     Yes
Network Features     Loonie     Toonie     Five Buck     Ten Buck
    Linux Operating System     Yes     Yes     Yes     Yes
    Apache Web Server     Yes     Yes     Yes     Yes
    Multi-homed network connectivity     Yes     Yes     Yes     Yes
    Environmental conditioning for hardware reliability     Yes     Yes     Yes     Yes
    Full power conditioning and backup     Yes     Yes     Yes     Yes
    Firewalls and other security measures for virtual security     Yes     Yes     Yes     Yes
    Controlled access for physical security     Yes     Yes     Yes     Yes
    24/7/365 monitoring for peace of mind     Yes     Yes     Yes     Yes
?     Daily backups for data recovery     Yes     Yes     Yes     Yes
Technical Support     Loonie     Toonie     Five Buck     Ten Buck
?     Unlimited 24/7 technical support     Yes     Yes     Yes     Yes
Payment Terms     Loonie     Toonie     Five Buck     Ten Buck
One-time setup fee     $0     $0     $0     $0
Monthly fee (prepaid 12 months)     $1.00/mo.     $2.00/mo.     $5.00/mo.     $10.00/mo.
Bandwidth Overage (per GB)     $1     $1     $1     $1
30-day Money Back Guarantee     Yes     Yes     Yes     Yes