Friday, August 31, 2012

Mysql:Give Root User Logon Permission From Any Host
------------------------

 Note that this is Not very secure, and should only be used for a local development box .

To configure this feature, you’ll need to update the mysql user table to allow access from any remote host, using the % wildcard.

Open the command-line mysql client on the server using the root account. There is a chance getting Access denied error.
-------------------

[root@vps mysql]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO
 -------------------

 Then you need to reset mysql password. For doing the same you need to stop the current mysql instance and then start mysql in safe mode.

--------------------

 #service mysqld stop or
#killall mysqld


 /usr/bin/mysqld_safe  --skip-grant-tables&


Now Connect to MySQL
#/usr/bin/mysql
Use the mysql database:
mysql>use mysql;
Change the MySQL admin(root) Password using following command


update user set password=password('wgstlfdse') where user='root' and host='localhost';

lush the privileges so everything will take (It removes any privileges set by the server)
mysql>flush privileges;
Then Quit : mysql>quit
Stop MySQL Service
/etc/init.d/mysqld stop
Start MySQL Service
/etc/init.d/mysqld start


Then connect mysql again 

 
 [root@vps ~]# mysql -u root -p
Enter password:


Use the mysql database:
mysql>use mysql;

Now I’ll update the server host to use the wildcard, and then issue the command to reload the privilege tables.

 update user set host='%' where user='root' and host='localhost';

FLUSH PRIVILEGES;


Also change  bind-address value in my.cnf like below.

--------------------
bind-address= *
---------------------


That’s all there is to it.


 

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.