Categories

Friday 28 December 2012

Ftp command to download all the subdirectories and files in a directlry

Hello,

 Please use the command wget -r ftp://username:password@1.2.3.4/dir/* for downloading all the subdirectories and files under a directory.

Regards


Tuesday 25 December 2012

Script to enable Spam Assasin in all the Cpanel Accounts

Hello,

 Below is the script to enable spam assassin in all the cpanel accounts in WHM.


#!/bin/bash
cd /home
for user in `ls /var/cpanel/users`
do
test ! -d $user && continue
touch  $user/.spamassassinenable $user/.spamassassinboxenable
chown $user:$user  $user/.spamassassinenable $user/.spamassassinboxenable
echo $user complete
done

Regards




Monday 24 December 2012

Minecraft Failed to Bind port error in CentOS

Hello,

 If you got the error on running ./minecraft.sh on the Centos

14:11:07 [WARNING] **** FAILED TO BIND TO PORT!

 exception was: java.lang.NoSuchMethodError: method java.net.ServerSocket.setPerformancePreferences with signature (III)V was not found

Then please check the java version on the Centos.The application need jav version >1.6 to run the application.

So please install it..

Java installation steps

Please follow the link http://blog.secaserver.com/2011/10/installing-java-1-6-centos-6/ to get more information regarding the installation of latest Java using RPM forge repository.

After java is installed please run the application again.It will work!!!!!!!!!!!!!!!!

Regards

Friday 21 December 2012

ssh password less authentication

Hello,

 Please follow the link  http://www.philchen.com/2007/07/28/how-to-enable-passwordless-authentication-with-ssh to get more information about configuring ssh with passwordless authentication.

How to fix Wordpress Permlink showing blankpage

Hello,

 If you encountered any blank page issue on the permlink on wordpress,please do the following,

Just open the configuration file wp-admin/includes/misc.php
And replace the code of got_mod_rewrite with below

website link http://wordpress.org/support/topic/blank-permalink-admin-page-after-changing-permalink-type


function got_mod_rewrite() {
 //$got_rewrite = apache_mod_loaded('mod_rewrite', true); //old line with false negative;
 $got_rewrite = true;//force the response to true as we know mod_rewite is installed;
 return apply_filters('got_rewrite', $got_rewrite);
}                                                                                          

Thursday 6 December 2012

Quota Unlimited issue in CPanel Openvz

Hello,

You can fix this issue by following the steps shown below.

1. Login to HN as root user.

2. [root@HN ~] # vzlist -a | grep <IP of VPS>

                  <VPSID>         59 running   <IP>  server.example.com

3. [root@HN ~] # vzctl stop <VPSID>

4. [root@HN ~] # vzctl set <VPSID> --quotaugidlimit 1000 --save

                  CT configuration saved to /etc/vz/conf/<VPSID>.conf

5. [root@HN ~] # vzctl start <VPSID>

If you are facing Case1 issue only, try creating new accounts.


If you are facing Case2 issue you have to do the following steps too.

6. [root@HN ~] # vzctl enter <VPSID>

7. [root@vps ~] # /scripts/fixquotas


Reference-http://linuxadmintips4u.blogspot.in/2012/10/cpanel-unlimited-quota-issue-in-openvz.html

Saturday 1 December 2012

remove IP ban due to bruteforce

Please follow the link http://forums.cpanel.net/f5/help-i-have-been-locked-out-brute-force-sistem-112341.html.

openvz pptpd VPN installation

Hello,

 Please follow the link http://docs.cslabs.clarkson.edu/wiki/Install_PPTP_on_CentOS_5 to get more information regarding the pptpd installation(there need a lot of work on the iptables to work)

Also change the venet0 to the main IP of the server instead of localhost IP(127.0.0.1).

Thanks

Friday 30 November 2012

cPanel-libgcc_s.so.1 must be installed for pthread_cancel to work

Hello,

 If you ever got this error then it might be due to low memory setting on Cpanel(WHM).So increase the memory of cpanel process by 
go to Tweak Settings (in WHM) then search for “Max cPanel process memory”, you can then increase this to say 512MB from the default 256M

Please go through the link http://webwiki.co/cpanel-libgcc-s-so/ to get more information regarding this.


Wednesday 21 November 2012

magento cart empy issue in /checkout/onepage/

Hello,

 Please get into magento admin page and then

 disable compilation(system>tools>compilation) after doing a compilation..so disabled and back to working cart
refresh/flush cache

This will fix the issue.

Apache Booster plugin reinstall

Hello,

 Please run the command /usr/local/cpanel/scripts/updateapachebooster to reinstall the apache booster.

Regards

Tuesday 20 November 2012

ion cube loader installation in cpanel

Hello,

 Please follow the below steps.

Steps to install ionCube loader in a cPanel server:

1. Script to confirm whether ioncube loader is installed or not:

===
/scripts/phpextensionmgr list
===

If ioncube loader is installed, you will get an output as given below.

===
# /scripts/phpextensionmgr list | grep IonCubeLoader
IonCubeLoader
===

If ioncube loader is not installed, you will get an output as given below.

===
bash# /scripts/phpextensionmgr list | grep IonCubeLoader
bash#
===

2. You can also use the following script to find the status of ioncube loader:

===
# /scripts/phpextensionmgr status ioncubeloader
===

===
# /scripts/phpextensionmgr status ioncubeloader
Updating md5sum list
Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz.yaml  (connected:0).......(request attempt 1/12)...Resolving httpupdate.cpanel.net...(resolve attempt 1/65)...
Fetching http://httpupdate.cpanel.net/mirror_addr_list  (connected:0).......(request attempt 1/3)......connecting to69.50.192.73...@69.50.192.73......connected......receiving...100%......request success......Done
...found 41 host(s) from mirror_addr_list......searching for mirrors (mirror search attempt 1/3)......loaded mirror speeds from cache......mirror searchsuccess...@69.50.192.73......connected......receiving...100%......request success......Done
Determining status of IonCubeLoader
IonCubeLoader extension is installed
===

3. Script to uninstall ioncube loader:

===
# /scripts/phpextensionmgr uninstall ioncubeloader
===

4. Script to install ioncube loader:

===
# /scripts/phpextensionmgr install ioncubeloader
===

centova cast error on accessing

Hello,

 This error may occur due to licensing issues.Please do the following to resolve the issue.

 Open  /usr/local/centovacast/etc/license.conf and replace the old key with your new one
- Delete the file license.key in the folder   /usr/local/centovacast/etc/license/
- Restart     /etc/init.d/centovacast restart

Just delete /usr/local/centovacast/etc/license/license.key and then run '/etc/init.d/centovacast restart' 
 
 
Reference link http://forums.centova.com/index.php?topic=1981.0 

Sunday 18 November 2012

the requested url /phpmyadmin was not found on this server webmin in debian

Hello,

 If you found the error as the requested url /phpmyadmin was not found on this server,then please try to do the following steps.


First re-congigure the installed phpmyadmin,
sudo dpkg-reconfigure -plow phpmyadmin
Select the required web server from the option l(apache or litespeed)


Then
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
sudo /etc/init.d/apache2 reload

If still the problem exists then please check the file

/etc/httpd/conf.d/phpmyadmin.conf
insert the following in the conf

Alias /phpmyadmin /var/www/html/phpMyAdmin
<Directory "/var/www/html/phpMyAdmin">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
SSLRequireSSL
</Directory>

add an alias for phpmyadmin

Regards


Sunday 5 August 2012

Empty named.conf file in zpanel

Hello,

 When we add additional domains in zpanel some times the named.conf may go blank.to reload it.Actually it is a bug in zpanel.

Go to zpanel>Admin>moduleAdmin>DNS config>Tools>Force Records Update on Next Daemon Run

Then run the daemon by going to Admin>Zpanelconfig>Run Daemon now option in the top bottom of it.


Alos location of named.conf in zpanel is /etc/zpanel/configs/bind/etc/named.conf and /etc/zpanel/panel/local/zpanel/etc/build/config_packs/centos_6_2/bind/etc/named.conf



The location of zone files is /etc/zpanel/configs/bind/zones

Also all zone files and dns files have user and group as apache.

Also to avoid the named.conf to go blank in next domain add ,Pleas do the following
1) Log into zpanel
2) Go into the Module Admin
3) Click the DNS Config link
4) Edit this config option in the general tab:

Named CheckZone

FROM
named-checkzone
named-checkconf
named-compilezone

TO
/usr/sbin/named-checkzone
/usr/sbin/named-checkconf
/usr/sbin/named-compilezone

Regards


Friday 27 July 2012

How to mount sshfs remote directory in fstab

Hello,

 Sshfs is used to mount  a remote directory on another server to our local server.This can be done by installing the sshfs package and a package named fuse.

The mounting is done as below.
sshfs USERNAME@HOSTNAME_OR_IP:/PATH LOCAL_MOUNT_POINT SSH_OPTIONS
 
Eg: sshfs sessy@mycomputer:/home/sessy /mnt/sessy -C -p 9876
 
To unmount the remote system: 
fusermount -u LOCAL_MOUNT_POINT
 
To mount it again 
fusermount -u LOCAL_MOUNT_POINT
 
We have to do ssh-keygen inorder to avoid asking the password upon mounting.
 
This can be done as below.
Create private and public keys using ssh-keygen commands
 
ssh-keygen
 
This will generate  private key in /root/.ssh/id_rsa and public key in /root/.ssh/id_rsa.pub
Then copy the content in id_rsa.pub to users /.ssh/authorized_keys file in remote server from which we are mounting.
 
 
You can use scp to copy the file.
 
then try to connect it using   sshuser2remotehost ,this time password will not be asked.
 
Then mount is on fstab using the following settings
sshfs REMOTEUSER@REMOTE:REMOTEMOUNTPOINT LOCALMOUNTPOINT -pREMOTEPORTNUMBER -o uid=LOCALUSERID -o gid=DESIREDGROUPID -o idmap=user -o IdentityFile=/root/.ssh/YOURKEYFILE -o allow_other
 
Eg:sshfs#user@remote.com:/home/user/audio /var/www/html/audio 
fuse 
IdentityFile=/root/.ssh/id_rsa,idmap=user,allow_other,port=10022,uid=0,gid=0,rw,nosuid,nodev
  0 0  
 
 
Please see the link 
http://ewald.tienkamp.nl/2010/01/19/mounting-a-remote-file-system-over-ssh-using-sshfs-and-non-standard-settings/
 for more details.
Regards
 


Wednesday 25 July 2012

Temp directory hardening

Hello,

 Not all file systems are working inside a container; check /proc/filesystems inside a container to find 
out.
follow the steps given in http://linux-bloggers.blogspot.in/2012/06/hardening-linux-server-or-cenos-562.html in temp directory hardening section

mount -t tmpfs -o noexec,nosuid tmpfs /tmp

on /etc/fstab
/usr/tmpMnt /tmp    tmpfs   noexec,nosuid 0 0

Tuesday 24 July 2012

Images not loading issue on wordpress site

Hello,

 Images may not load on wordpress site if the permission of files are incorrect.To understand the file permissions of the wordpress contents,Please refer the link http://wordcastnet.com/2011/managing-file-permissions-in-wordpress/.

Wednesday 18 July 2012

How to change default mpm module of apache in Centos

In the RedHat-based Linux distributions, Apache webserver is configured to run with the prefork module by default; however, you can switch it to "worker" if you decide that this would suit your needs better. Usually, it is sufficient to uncomment this directive in the /etc/sysconfig/httpd file:
# grep HTTPD= /etc/sysconfig/httpd
#HTTPD=/usr/sbin/httpd.worker
and restart Apache
/etc/init.d/httpd restart

Please refer the link 
http://kb.parallels.com/en/113007 for furtherinformation.

Tuesday 17 July 2012

phpinfo page not working

Solution:

1)Copy /usr/local/cpanel/cgi-sys/php5.cgi to /home/username/ public_html/cgi-bin

2)Add the below given script

root [/home/username/public_html/cgi-bin]# vi phpini.cgi
#!/bin/sh
export PHPRC=/home/username/public_html
exec /home/username/public_html/cgi-bin/php5.cgi

3)And added a php.ini in the location (/home/username/public_html)

4)In the .htaccess put the following.

AddHandler php-cgi .php
Action php-cgi /cgi-bin/phpini.cgi

5) Permission of phpini.cgi should be 755


6) Now check the PHP page in your browser.

How to get plesk account information using mysql

1. Getting all the domain account information from Plesk
------------------------------------------------------------------------

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e "select
login,password,home from sys_users INNER JOIN accounts on
accounts.id=sys_users.account_id;"

2. Get client login details from Plesk.
-----------------------------------------------

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e "select
login,password from clients INNER JOIN accounts on
accounts.id=clients.account_id;"

3. Getting all mail account login information
--------------------------------------------------------

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e "SELECT
CONCAT_WS('@',mail.mail_name,domains.name) as email ,accounts.password
FROM domains,mail,accounts WHERE domains.id=mail.dom_id AND
accounts.id=mail.account_id ORDER BY domains.name ASC,mail.mail_name ASC;"

4. Creating/deleting/updating mail accounts using command line
---------------------------------------------------------------------------------

create mail account

/usr/local/psa/bin/mail -c USER@DOMAIN.COM -passwd PASSWORD -mailbox
true -cp-access true

update mail account

/usr/local/psa/bin/mail -u USER@DOMAIN.COM -passwd NEWPASS

remove mail account

/usr/local/psa/bin/mail --remove USER@DOMAIN.COM

5. Mailing list management
----------------------------------

creating mailing list

/usr/local/psa/bin/maillist --create MYLIST -domain DOMAIN.COM
-passwd_type plain -passwd PASS -notify false -email LISTADMIN@DOMAIN.COM

Adding/removing members to the mailing list.

/usr/local/psa/bin/maillist -u MYLIST -domain DOMAIN.COM -members
add:NEW@DOMAIN.COM

/usr/local/psa/bin/maillist -u MYLIST -domain DOMAIN.COM -members
del:NEW@DOMAIN.COM

Getting list members

/usr/local/psa/bin/maillist -i MYLIST -domain DOMAIN.COM

Removing list

/usr/local/psa/bin/maillist -r MYLIST -domain DOMAIN.COM

6. Managing databases.
------------------------------

create database

/usr/local/psa/bin/database --create DBNAME -domain DOMAIN.COM -server
localhost:3306 -add_user DBUSER -passwd PASS

remove database

/usr/local/psa/bin/database -r DBNAMe

Sunday 8 July 2012

How to change admin login details of light speed webserver


Hello,
Light speed webserver user details can be changed by using a script /usr/local/lsws/admin/misc/admpass.sh.

Light speed server port number is 7080.So can acces the login page via http://servernae:7080.

Friday 29 June 2012

.htaccess cheat sheet


cheat sheet of .htaccess
------------------------------


1.Unify kavoir.com and www.kavoir.co# Use a 301 redirect from kavoir.com to www.kavoir.com to tell SEs that the 2domains are the same thing so there's no PageRank leakage.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^kavoir\.com [NC]
RewriteRule ^(.*)$ http://www.kavoir.com/$1 [R=301]

2.Block spammers!
# This blocks 218.1.132.177 and *.spammers.com from accessing your site.
<limit GET POST PUT>
order deny,allow
deny from 218.1.132.177
deny from .spammers.com
allow from all
</limit>

3.Change default page!
# The order is followed as specified:
DirectoryIndex default.htm default.php index.html index.php

4.Enable directory browsing!
Options +Indexes
# block a few types of files from showing:
IndexIgnore *.wmv *.mp4 *.avi
Disable directory browsing!
Options All -Indexes

5.Customize error messages!
ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /servererror.html
6.Get SSI working with HTML/SHTML!

AddType text/html .html
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml

7.Redirect it!
Redirect oldpage.html http://www.domainname.com/newpage.html

8.Block visits or leeches from specific referers!
RewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block\.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2\.com [NC]
RewriteRule .* - [F]

9.Stop a file from being viewed!
# mycontacts.txt cannot be accessed by any means:
<files mycontacts.txt>
order allow,deny
deny from all
</files>

10.Password-protect a directory!
See http://thejackol.com/scripts/htpasswdgen.php

Saturday 23 June 2012

Bind installation on CentOS

Hello,

You can install Bind using yum in centOS
yum install bind



cp -r /usr/share/doc/bind-9.3.6/sample/etc/* /etc/
cp -r /usr/share/doc/bind-9.3.6/sample/var/named/* /var/named/
vim /etc/named.conf

That's it.

Named Error in Bind Solved

If you ever get error on restarting bind,

Please check the link http://opensource-guide.blogspot.in/2009/11/named-service-failed.html.

Thanks

Monday 18 June 2012

How to create custom php.ini for servers having fastcgi

Hello,

Open .htaccess file of the user and add the following as below
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php5.fcgi  


Move to the cgi-bin folder of the account


cp /usr/local/lib/php.ini /home/user/public_html/cgi-bin/

chown user: /home/user/public_html/cgi-bin/php.ini

chmod 755 /home/user/public_html/cgi-bin/php.ini

cd /home/user/public_html/cgi-bin/


vi php5.fcgi (insert the below codes and save)

#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5

chown user: /home/user/public_html/cgi-bin/php5.fcgi

chmod 755 /home/user/public_html/cgi-bin/php5.fcgi

Sending A Message to All Users On Linux System


If you want to  send a message to all users on linux system, you can use wall command, which sends a message to everybody logged in with their mesg permission set to yes. The message can be given as an argument to wall, or it can be sent to wall’s standard input. When using the standard input from a terminal, the message should be terminated with the EOF key (usually Control-D).

Examples

To send a message “Alert ! Web server under DOS attack !”, type the following command
$ wall
Alert ! Web server under DOS attack !
When the message content is complete, press Control-D (CTRL+D) to send message to all users.
To display message “Alert ! Web server under DOS attack !” to all admin group member use wall command with “–g” option as follows:
$ wall -g admin
Alert ! Web server under DOS attack !
When the message content is complete, press Control-D (CTRL+D) to send message to all users.

How Do I Configure Apache Server To Listen Multiple Ports ?

Hello,
By default Apache server listens on TCP port 80 but I’d like an Apache Web Server to listen on port 80 and port 8080.But we can also configure apache to listen on multiple ports.It is shown below.


edit file /etc/httpd.conf.httpd.conf
 and search the line Listen 80
Add one more line like it and change the port to one we want
Listen 8080
And find the VirtualHost portion for your website config and add *:8080 as shown below:


<Virtual Host *:80 *:8080 >
.................
<Virtual Host>

Thats all.................

Friday 15 June 2012

Yum memory error


If you are getting  "MemoryError" while doing yum update or yum install ,follow the steps shown below:

Solution


# ulimit -a

The output for this will be obtained as :

root@server1 [~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 19
file size               (blocks, -f) unlimited
pending signals                 (-i) 139264
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) 10000
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 15
virtual memory          (kbytes, -v) 262144
file locks                      (-x) unlimited

The reason for such memory error  is because of virtual memory and max. memory size. It should be unlimited, otherwise it will show memory error.

# ulimit -m unlimited 
#ulimit -v unlimited
  Then run yum again........
This would helps......:)

Saturday 9 June 2012

Installing LAMP on Linux

Please refer these links to get more information on installing LAMP on linux servers.

http://www.lamphowto.com/
http://www.howtoforge.com/quick-n-easy-lamp-server-centos-rhel

http://www.lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/

How to add IPs in Windows Webserver2008 and Webserver 2003


If you have a dedicated server and you need to add an additional ip address, first thing to do is request for the additional ip address from the hosting company. Often time they would not hook it with your server, they would just give it to you.
So how you add the additional ip address to your windows server?
These steps are for Windows Server 2003.
  • Click on Start button
  • Open Cotnrol Panel
  • Open Network connections
  • Select Local Area Connection (for first Ethernet card)
  • Right Click and select Properties
  • Select Internet Protocol (TCP/IP)
  • Now click on Properties button
  • Click on Advanced tab
  • Now you need to add in an IP address section Enter IP details such as IP address, Subnetmask etc
  • Save the changes and go back to Windows server desktop
These steps are for Windows Server 2008.
  • Click on Start button
  • Open Cotnrol Panel
  • Click on Network and Sharing Center
  • Click on Manage Network Connections
  • Right Click on the active network icon  and select Properties
  • Select Internet Protocol Version (TCP/IP). There may be more then version. For me there are 4 and 6. Mine one is at 4.
  • Now click on Properties button
  • Click on Advanced tab
  • Now you need to add in an IP address section Enter IP details such as IP address, Subnetmask etc
  • Save the changes and go back to Windows server desktop
After that you need to verifty that new settings are working. This is how you do that:
  • Open command prompt
  • Click on Start button
  • Select Run
  • Type cmd and press enter
  • Type the following command at DOS prompt: ipconfig /all

Also Refer this link to get more information about this in windows virtual machines as well.

Ad