Archive

Archive for December, 2012

Command to check mod_pagespeed

December 21st, 2012 No comments

Command to check mod_pagespeed is installed in server.

curl -D http://127.0.0.1

You will get below output.

 

Date: Fri, 07 Sep 2012 21:51:06 GMT
Server: Apache/2.2.3 (CentOS)
X-Mod-Pagespeed: 0.10.22.4-1633

 

Categories: Apache, CPanel / WHM, Installation Tags:

How to: Install mod_pagespeed in cpanel

December 21st, 2012 No comments

How to: Install mod_pagespeed in cpanel

Login to the server via SSH

Go to below folder

cd /usr/local/src

create directory

mkdir mod_pagespeed

Download pagespeed rpm

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.rpm

Extract the rpm

rpm2cpio mod-pagespeed-beta_current_i386.rpm | cpio -idmv

Copy the modules to apache modules folder

cp /usr/local/src/mod-pagespeed/usr/lib/httpd/modules/mod_pagespeed.so /usr/local/apache/modules/

cp /usr/local/src/mod-pagespeed/etc/httpd/conf.d/pagespeed.conf /usr/local/apache/conf/

Provide execute permission

chmod 755 /usr/local/apache/modules/mod_pagespeed.so

Create below folders

mkdir /var/mod_pagespeed/{cache,files} -p

Provide correct ownership

chown nobody:nobody /var/mod_pagespeed/*

mod_pagespeed has a dependency that you’ll want to enable: mod_deflate (the httpd source directory (2.2.16) may vary depending on your install):

/usr/local/apache/bin/apxs -c -i /home/cpeasyapache/src/httpd-2.2.16/modules/filters/mod_deflate.c

We have to edit mod_pagespeed configuration file located at /usr/local/apache/conf/pagespeed.conf to reflect the correct paths, the LoadModule directives should fetch the modules in “modules/module_name.so”

LoadModule pagespeed_module modules/mod_pagespeed.so
LoadModule deflate_module modules/mod_deflate.so
ModPagespeedFileCachePath "/var/mod_pagespeed/cache/"
ModPagespeedGeneratedFilePrefix "/var/mod_pagespeed/files/"

After that, we’ll need to include the mod_pagespeed configuration in Apache’s configuration file (/usr/local/apache/conf/httpd.conf):

Include conf/pagespeed.conf

In order to keep the changes permanant run the command below.

/usr/local/cpanel/bin/apache_conf_distiller –update

Now restart apache service.

 

 

Categories: Apache, CPanel / WHM, Installation Tags:

Unknown License File Version in cpanel : Failed to get a new license, or part of the update process failed

December 15th, 2012 No comments

Sometime while accessing WHM, some links are giving below error.

===============================================
Unknown License File Version (has = 23, needed = 22, length=1554). This means that the system failed to get a new license, or part of the update process failed. If you are the server admin,
===============================================

 

To resolve this issue follow the below steps

/usr/local/cpanel/cpkeyclt

If above commands work then it’s ok but if it is still show above error then follow the below steps

run the below command to stop cpsrvd service

/usr/local/cpanel/etc/init/stopcpsrvd

then sync the files from cpanel server using below command this will fix your issue.

/usr/local/cpanel/scripts/upcp –sync

Categories: CPanel / WHM Tags:

How To: Find Symlink under UNIX / Linux

December 15th, 2012 No comments

How To: Find Symlink under UNIX / Linux

Now, a days sym/root hacking is famous and hacker can create a sym/root folder by using script.
How do I find symlink(s) under UNIX and Linux operating systems?

Use the below command to find symlink directory

find /path/to/dir -lname /path/to/file

OR

If you want to search sym/root folder under users account on server then run the below command in /home

cd /home

find -lname /root

The above command will find sym/root folder under all the users but it will take time. There is another method which is described below.

Install mlocate on server using yum.

yum install mlocate -y

Once it is installed then run below command to update locate database.

updatedb

then run below command to search the server

locate sym/root

Above command will locate all the folder which is having symlink of root.

 

mysql is disabled by sys admin while restarting mysql service

December 15th, 2012 No comments

Sometimes it may happen that while restarting mysql service on server you are getting below error.

mysql is disabled by sys admin

Try running below script to bring mysql up again

/scripts/mysqlup

If it’s Up then ok, but sometime it will give below error

Updates for mysql /etc/mysql disabled

If it is not working then go to /etc folder

cd /etc

Run the below command there

[email protected] [/etc]#ls -ld mysql*

It will give below output

-rw-r–r– 1 root root 0 Aug 16 21:19 mysqldisable

Move that file using below command

[email protected][/etc]# mv mysqldisable mysqldisable-bak

Then restart mysql will fix your issue.

[email protected][/etc]# /scripts/mysqlup

 

Categories: CPanel / WHM, MySql Tags:

Log folder contents deleted getting error mails

December 15th, 2012 No comments

Log folder contents deleted getting cron mails and getting below error.

Cannot open /var/log/sa/sa03: No such file or directory

 

Login to server via SSH

Go inside /var/log/ folder

cd /var/log/

Check for sa folder, if it is not present then create it manually using below command. Files will be generated automatically inside that folder

mkdir sa

To check try running sar command after 1 to  hours it will start working.

 

Categories: CPanel / WHM, Uncategorized Tags:

IP remove from Brute Force Attack database by SSH

December 15th, 2012 No comments

Sometimes, because of the Brute Force Attack we are unable to login to WHM if we are using correct details also. Then at that time try using below method.

 

Login to server via SSH.

Connect with mysql database using mysql command. It will show below output.

[email protected] [/var/log]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 172123
Server version: 5.1.65-cll MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

Then type show databases commands in mysql it will show all databases.

 

mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| cphulkd |
| eximstats |
| horde |
| leechprotect |
| logaholicDB_test |
| modsec |
| mysql |
| roundcube |
+——————–+
9 rows in set (0.00 sec)

Then go to cphulkd database using below command.

mysql> use cphulkd;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

Now, it’s time to show tables.

mysql> show tables;
+——————-+
| Tables_in_cphulkd |
+——————-+
| auths |
| blacklist |
| brutes |
| good_logins |
| logins |
| report |
| whitelist |
+——————-+
7 rows in set (0.00 sec)

You can take backup of tables using below command

mysql>BACKUP TABLE `brutes` TO ‘/path/to/backup/directory’;

Run below command to check your IP is blocked in CPHulk Brute Froce database. Replace xxx.xxx.xxx.xxx with your IP

mysql> SELECT * FROM `brutes` WHERE `IP`=’xxx.xxx.xxx.xxx’;

Run below command to remove IP from database

mysql> DELETE FROM `brutes` WHERE `IP`=’xxx.xxx.xxx.xxx’;

Also, check IP in login table also by running the below command

mysql> SELECT * FROM ‘logins’ WHERE ‘IP’ =’xxx.xxx.xxx.xxx’;

Remove the IP from login table using below command.

mysql> DELETE FROM ‘logins’ WHERE ‘IP’ =’xxx.xxx.xxx.xxx’;

OR

You can use below method to clear brutes and login tables. Please note it will remove all the IP’s from database.

Now empty some tables by giving the below commands.

mysql> DELETE FROM brutes;
Query OK, 60 rows affected (0.00 sec)

mysql> DELETE FROM logins;
Query OK, 34 rows affected (0.00 sec)

 

 

9 rows in set (0.00 sec)

 

Categories: CPanel / WHM, MySql Tags: