Server Monkey is looking for tutorial writers to join our staff. Interested applicants can send a quick introduction of themselves to apply@server-monkey.com

Verify Email Password With Telnet

posted by Mark Muyskens

The quickest way to verify an email password is by using telnet. The few steps below will show you how to do so;

telnet server-monkey.com 110

+OK Hello there.
USER tut@server-monkey.com
+OK Password required.
PASS testpassword
+OK logged in.
quit
+OK Bye-bye.
Connection closed by foreign host.



Download It;

wget http://downloads.ioncube.com/loader_download /ioncube_loaders_lin_x86.tar.gz
tar zfx ioncube_loaders_lin_x86.tar.gz
mv ioncube /usr/local

Find PHP.ini
php -i | grep php.ini

Edit your php.ini
pico /usr/local/lib/php.ini or nano /usr/local/lib/php.ini

Add Extension to PHP.ini
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.2.so

Restart Apache
service httpd restart

Check
php -v
PHP 5.2.10 (cli) (built: Aug 10 2009 05:47:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with the ionCube PHP Loader v3.1.34, Copyright (c) 2002-2009, by ionCube Ltd.
with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH


Back The F:\ Up!

posted by Mark Muyskens

Remember kids, always be on the safe and back the f:\ up!

This random post brought to you by Mozy; for an ultimate kick ass backup solution visit Mozy.com today!

P.S. Enter “mark@server-monkey.com” as your referrer and get additional diskspace TOTALLY FREE!


Exim Cheatsheet

posted by Mark Muyskens

While surfing the web, I discovered this great cheat sheet for troubleshoot mail issues in cPanel/DirectAdmin or any exim mail server.

You can check it out at;
http://bradthemad.org/tech/notes/exim_cheatsheet.php


Chattr, a more indepth look

posted by Thor Erik

Chatter is a utility you’d find on most Linux systems, it’s sole purpose is to change file attributes.

when you use Chattr you’ll probably use it in symbolic mode, this means you will be using +, – and =(plus, minus and equals) plus either of the attributes: A, S, a, c, D, d, I, i, j, s, T, t, u.

Symbols

+ adds a attribute

- removes a attribute

= causes the attribute to be the only

Attributes

a (small A) is append only, this only allows someone to add to a file.

c (small C) is compressed

d (small D) is no dump

i (small I) is immutable, meaning no delete for anyone, not even root

j (small J) is journaling

s (small S) is secure deletion, incase you want to remove a file completely with no way of recovery(except IBAS)

t (small T) is no tailing

u (small U) is undeleteable

A (capital A) is no atime updates

D (capital D) is synchronousdirectory updates

S (capital S) is synchronous updates

T (capital T) is top of directory hierarchy, useful for important files

Options

As with most commands you got options as well

chattr got most of the common ones:

-R, recursive

-V, verbose

-f, suppress most errors

-v, version

options go first of course

Common use

most of the time you won’t use all of these options, but some you will run into quite often would be

chattr +i/chattr =i to protect files from accidental deletion

chattr +T to make a important file top of the file listings

chattr +d to prevent dumping of a file

and in some rare cases
chattr +ad to only allowing appending and prevent backup using

dump

, this could be useful for log files etc. that you only want to be appended to and not backed up

Source: man chattr


Here’s a quick htaccess edit that will redirect your domain to a subfolder;

RewriteEngine On

Options +FollowSymlinks

RewriteBase /

RewriteCond %{HTTP_HOST} www.domainname [OR]

RewriteCond %{HTTP_HOST} domainname

RewriteCond %{REQUEST_URI} !subfolder/

RewriteRule ^(.*)$ subfolder/$1 [L]


Keep your clocks in sync

posted by Thor Erik

An issue I’ve come across a lot is that clocks don’t stay correct for a long time…

Now some smart heads thought up a way to fix that, it’s called NTP, Network Time Protocol.

Setting it up is easy:

on RHEL/Fedora/CentOS:

centos ~ # yum install ntp

on Debian and debian based distributions:

debian ~ # apt-get install ntp

(everything is root of course)

on debian you are done now, NTPD should be started, of course if you want to specify your own NTP server or NTP pool, you just edit /etc/ntp.conf

on RHEL it’s just a few more steps:

chkconfig ntpd on

ntpdate pool.ntp.org

/etc/init.d/ntpd start

and that should be it, please do know that if it’s a VPS forget about NTP, the system time is inherited from the host, unless you run it on a windows host(ex. Windows 2008 or in my debian server’s case, Windows 2008 R2 and using Hyper-V)

The error you get will be something like this:

ntpdate[18411]: step-systime: Operation not permitted

after trying to run ntpdate pool.ntp.org

On Windows it’s all a hell lot easier(in gui that is)

Right click on the clock and choose Adjust time and date

go to the Internet time tab.

then click the button saying Change settings.

make sure the checkbox is checked, and if you prefer a different ntp server, change it from time.microsoft.com (but it’s good as well, NTP takes latency into account when setting clock)

Windows does not support ntp pools, so please define a proper NTP server.


Mozy

posted by Mark Muyskens

Lets face it. Most of us suck when it comes to backing up our systems, but what if there was a quick, simple, painless way of backing up you system without the headaches of extra work.

Well, now there is! Mozy is the ultimate backup solution for quick and painless backups. Simply signup for an account, download the software, and select your folders, ITS THAT SIMPLE! Mozy provides unlimited backups for the low price of $4.95 per month. Still not sure if you want to use this service? Mozy offers 2GB of storage COMPLETELY FREE. No credit card needed, no setup fees,  no expiration date, BUT ABSOLUTELY FREE! You’ll be up and running within minutes!

What are you waiting for! Give it a try today!

Signup now at https://mozy.com/?ref=JARRZH

Use the above referral line or enter “mark@server-monkey.com” as your referral and we both get extra storage space! Signup now!


cPanel and DomainKeys

posted by Mark Muyskens

Lets face it. Sending mail to some domains such as yahoo and hotmail can become a pain in the ass. Installing DomainKeys can help with the delivery of mail.

Installation on a single domain;
/usr/local/cpanel/bin/domain_keys_installer user

Where user is the user’s cPanel username
If running this command gives you an error, then your more then likely not running the latest version of cPanel or you have not converted to maildir.

Installing on all domains;
for i in `ls /var/cpanel/users` ;do /usr/local/cpanel/bin/domain_keys_installer $i ;done

Bash script to parse all cPanel users and run the command.

Now, what about when you add new account;
Modify cPanel’s PostWWW script “/scripts/postwwwacct”
add;

my %OPTS = @ARGV;
my $user = $OPTS{’user’};
/usr/local/cpanel/bin/domain_keys_installer $user

Done.

More Info on DomainKeys; http://domainkeys.sourceforge.net/