Sunday, December 11, 2011

How To Fix “Missing Dependency: perl(URI) >= 1.17 is needed by package subversion”

How To Fix “Missing Dependency: perl(URI) >= 1.17 is needed by package subversion”


If you are a cPanel user on CentOS 5.6 64 bit and wanting to install Subversion, you might get this error after running ‘yum install subversion’

Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.4.x86_64

yum seems to unable to find needed dependency and just fails

To fix this issue there’s a workaround.

++++++++++++++++++++
cd /tmp
wget http://sdkit.com/download/centos/5/rpms/perl-URI-1.35-3.noarch.rpm
rpm -i perl-URI-1.35-3.noarch.rpm
The dependency is now fixed. You can proceed to installing subversion by running:
+++++++++++++++++++++++++++++

yum install subversion

Saturday, September 24, 2011

How To Add DomainKeys and SPF Records on CPanel Servers

This how to describe how to add domainkeys and SPF (Sender Policy Framework) records on CPanel Servers. Whenever you create a domain on CPanel server using WHM, it wont add domainkeys and SPF records for particular domains. To add domainkeys and SPF records please use following steps.

We consider here we have a domain sohailriaz.com with cpanel username sohailri

Please note on CPanel servers most of the work is done using cpanel username which then reflect setting on particular domains. If you have several domains / sub domains under one username, it will add domainkeys and SPF records for all domains / subdomains.

Execute the following command on your CPanel server using root.

=================================================================================================
1 DomainKeys
1.1 Add DomainKeys for single user

/usr/local/cpanel/bin/domain_keys_installer sohailri

where sohailri is a username
1.2 Add DomainKeys for all CPanel users.

If you wish to add DomainKeys for all Cpanel users on your server, execute following command.

ls /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/domain_keys_installer $a
done
=================================================================================================


2 SPF (Sender Policy Framework)
2.1 Add SPF for single account.

/usr/local/cpanel/bin/spf_installer sohailri

2.2 Add SPF for all Cpanel accounts.

If you want to add SPF records for all cpanel accounts exist on your server then use the following command.

ls /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/spf_installer $a
done
=================================================================================================

3 Enable DomainKeys and SPF for every new CPanel account.

If you want to add DomainKeys and SPF for every new account created on Cpanel, then do the following.

vi /scripts/postwwwacct

postwwwacct is a file which execute after wwwacct (used to create account), paste following lines in the file

#!/usr/bin/perl

my %OPTS = @ARGV;
$ENV{USER} = “$OPTS{‘user’}”;
system q(/usr/local/cpanel/bin/domain_keys_installer $USER);
system q(/usr/local/cpanel/bin/spf_installer $USER);

RLimitMEM Directive

Description: Limits the memory consumption of processes launched by Apache children
Syntax: RLimitMEM bytes|max [bytes|max]
Default: Unset; uses operating system defaults
Context: server config, virtual host, directory, .htaccess
Override: All
Status: Core
Module: core

Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. Either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating system configuration. Raising the maximum resource limit requires that the server is running as root, or in the initial startup phase.

This applies to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.

Memory resource limits are expressed in bytes per process.

Monday, May 2, 2011

Sender Policy Framework check

Record wizard

Use our record setup wizard to help you create an SPF record for your domain.
Form based record testers

* Our reference SPF-result-explanation page
* Scott Kitterman's SPF record testing tools

E-mail based record testers

*

We provide an e-mail based record tester. Send an e-mail to spf-test@openspf.org. Your message will be rejected (this is by design) and you will get the SPF result either in your MTA mail logs or via however your MTA reports errors to message senders (e.g. a bounce message). This is done to avoid the risk of backscatter from the tester. This test tests both MAIL FROM and HELO and provides results for both.

It uses the Python SPF (pySPF) library, which is fully compliant with the SPF specification. MTA services for this test are provided by Controlled Mail. This is an Open Patent service.

An example result is:

: Recipient address rejected: SPF Tests: Mail-From Result="pass": Mail
From="you@example.com" HELO name="mail.example.net" HELO Result="pass" Remote IP="10.210.38.56">

*

Port25.com provides another tool to test whether your SPF record is working. Send an e-mail to "check-auth@verifier.port25.com" and you will receive a reply containing the results of the SPF check.

Form based TXT record viewer

* Beveridge DNS lookup (Web interface for dig emphasizing v=spf1 TXT records)
* Beveridge SPF check

For implementors

* Test Suite - not a tool like others on this page, but maybe what you are looking for.

Thursday, March 17, 2011

How to avoid TCP time stamp issues in linux

How to avoid TCP time stamp issues in linux

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Hello,

Here is the solution to avoid tcp fingerprinting . This need to be added in your linux server to get pcidss compilance .

# echo “net.ipv4.tcp_timestamps = 0″ >> /etc/sysctl.conf

# sysctl -p

This will fix the tcp fingerprint issue.

Disable sslv2 in cPanel/whm services

Disable sslv2 in cPanel/whm services

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

It is easy to disable sslv2 in cpanel / whm services ( ports 2083 , 2087, etc,. ) . To do this you need to enable stunnel from the tweak settings , After that edit the file

/usr/local/cpanel/etc/stunnel/mycabundle/stunnel.conf and add the following line ,

options = NO_SSLv2

Now restart cPanel server. This will fix the issue. And you will get pcidss compilance.

Tuesday, February 8, 2011

Difference Between InnoDB and MyISAM

* The big difference between MySQL Table Type MyISAM and InnoDB is that InnoDB supports transaction
* InnoDB supports some newer features: Transactions, row-level locking, foreign keys
* InnoDB is for high volume, high performance

Most people use MyISAM if they need speed and InnoDB for data integrity. You can use more than one or any combination of these table types in your database. Remember to asses the needs of your application before building it. Even though MyISAM is faster than InnoDB in the MySQL world, InnoDB is fast compared to any database engine.With InnoDB you get transactions, speed and integrity three features not usually used in the same sentence.

InnoDB has been designed for maximum performance when processing large data volumes. Its CPU efficiency is probably not matched by any other disk-based relational database engine.

Fully integrated with MySQL Server, the InnoDB storage engine maintains its own buffer pool for caching data and indexes in main memory. InnoDB stores its tables and indexes in a tablespace, which may consist of several files (or raw disk partitions). This is different from, for example, MyISAM tables where each table is stored using separate files. InnoDB tables can be of any size even on operating systems where file size is limited to 2GB.

Thursday, February 3, 2011

Some examples of using UNIX find command.

The find command allows the Unix user to process a set of files and/or directories in a file subtree.

You can specify the following:

* where to search (pathname)
* what type of file to search for (-type: directories, data files, links)
* how to process the files (-exec: run a process against a selected file)
* the name of the file(s) (-name)
* perform logical operations on selections (-o and -a)

Search for file with a specific name in a set of files (-name)

find . -name "rc.conf" -print

This command will search in the current directory and all sub directories for a file named rc.conf.

Note: The -print option will print out the path of any file that is found with that name. In general -print wil print out the path of any file that meets the find criteria.
How to apply a unix command to a set of file (-exec).

find . -name "rc.conf" -exec chmod o+r '{}' \;

This command will search in the current directory and all sub directories. All files named rc.conf will be processed by the chmod -o+r command. The argument '{}' inserts each found file into the chmod command line. The \; argument indicates the exec command line has ended.

The end results of this command is all rc.conf files have the other permissions set to read access (if the operator is the owner of the file).

How to apply a complex selection of files (-o and -a).

find /usr/src -not \( -name "*,v" -o -name ".*,v" \) '{}' \; -print

This command will search in the /usr/src directory and all sub directories. All files that are of the form '*,v' and '.*,v' are excluded. Important arguments to note are:

* -not means the negation of the expression that follows
* \( means the start of a complex expression.
* \) means the end of a complex expression.
* -o means a logical or of a complex expression.
In this case the complex expression is all files like '*,v' or '.*,v'

The above example is shows how to select all file that are not part of the RCS system. This is important when you want go through a source tree and modify all the source files... but ... you don't want to affect the RCS version control files.

How to search for a string in a selection of files (-exec grep ...).

find . -exec grep "www.athabasca" '{}' \; -print

This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output.

If you want to just find each file then pass it on for processing use the -q grep option. This finds the first occurrance of the search string. It then signals success to find and find continues searching for more files.

find . -exec grep -q "www.athabasca" '{}' \; -print

This command is very important for process a series of files that contain a specific string. You can then process each file appropriately. An example is find all html files with the string "www.athabascau.ca". You can then process the files with a sed script to change those occurrances of "www.athabascau.ca" with "intra.athabascau.ca".

Tuesday, January 25, 2011

Mathematical Operator in Shell Script

-eq is equal to 5 == 6 if test 5 -eq 6 if [ 5 -eq 6 ]
-ne is not equal to 5 != 6 if test 5 -ne 6 if [ 5 -ne 6 ]
-lt is less than 5 < 6 if test 5 -lt 6 if [ 5 -lt 6 ]
-le is less than or equal to 5 <= 6 if test 5 -le 6 if [ 5 -le 6 ]
-gt is greater than 5 > 6 if test 5 -gt 6 if [ 5 -gt 6 ]
-ge is greater than or equal to 5 >= 6 if test 5 -ge 6 if [ 5 -ge 6 ]

NOTE: == is equal, != is not equal.

For string Comparisons use
Operator Meaning
string1 = string2 string1 is equal to string2
string1 != string2 string1 is NOT equal to string2
string1 string1 is NOT NULL or not defined
-n string1 string1 is NOT NULL and does exist
-z string1 string1 is NULL and does exist

Shell also test for file and directory types

Test Meaning

-s file Non empty file
-f file Is File exist or normal file and not a directory
-d dir Is Directory exist and not a file
-w file Is writeable file
-r file Is read-only file
-x file Is file is executable

Logical Operators

Logical operators are used to combine two or more condition at a time

Operator Meaning
! expression Logical NOT
expression1 -a expression2 Logical AND
expression1 -o expression2 Logical OR