Wednesday, October 12, 2011

Add extra space to VPS from Virtuozzo node

vzctl set VEID --save --diskspace 40G

So the VE will have 40GB space.

If you want 60 GB then

vzctl set VEID --save --diskspace 60G

and so on...

IndianVPS.com

Sunday, June 19, 2011

Command to kill ssh user

Use the below command to kill ssh user using pts

pkill -9 -t pts/46

This will kill session pts/46

Wednesday, June 15, 2011

Turn off ssl cPanel redirection from command line.

If you are using WHM, from WHM you can turn off the SSL redirtection as follows:

SSL redirection can be found in WHM >> Tweak Settings >> Redirection

Always redirect to SSL [?] On Off = off

If you want to turn off the SSL login URL for the WHM on the server you can simply do it from command line.

You can follow following steps for this:

Login to server as root

Open the file: /var/cpanel/cpanel.config

root@server [~]# vi /var/cpanel/cpanel.config

Check for the line:

requiressl=1
And reset it to
requiressl=0

root@server [~]# /etc/init.d/cpanel restart

Resetting SSH port to 22 via WHM

If you are unable to connect to a cPanel server over SSH:

* because of a forgotten custom SSH port
* having restarted sshd service after making any wrong settings in sshd_config file

- you can still connect to that server via safe sshd service provided by cPanel over port 22 by following the steps below:

* Log in to WHM as root user and browse to the following URL.

http://x.x.x.x:2086/scripts2/autofixer (Replace x.x.x.x with the server IP address)

* You will be presented with an AutoFixer window. Enter
*"safesshrestart"* in the given text field (Enter script name) and click Submit.

It will kill any already running sshd processes and start a new one listening on the default 22 port using the configuration file at /var/cpanel/safe_sshd.

* Connect to the server over SSH via port 22.

* Note down the custom port set in /etc/ssh/sshd_config or fix any errors in it. Once you are ready, restart sshd.

* You should then be able to connect to the regular ssh service running on your custom port if set any.

You can find more information regarding autofixer feature at http://httpupdate.cpanel.net/autofixer/

cPanel: Fantastico is not installed at the default location

If you get the following error when accessing Fantastico (user login):

Quote:
Fantastico is not installed at the default location /usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory from it's current location to /usr/local/cpanel/3rdparty/fantastico OR enable ioncube loaders in WHM -> Tweak settings.
To resolve this issue, you can change the option to enable ioncube loaders in WHM > Tweak Settings and then run:

Code:
/scripts/makecpphp

Enabling Virtuozzo with offline-management

Check the following url to access both 8443 plesk and 4643 VZ with offline management

http://forum.parallels.com/showthread.php?t=74654

# vzctl set ${VEID} --save --offline_management yes --offline_service vzpp

Wednesday, April 20, 2011

IPTABLES Rules

1. View / List All iptables Rules

When you want to check what rules are in iptables, use –list option as shown below.

# iptables --list

Example 1: Iptables list output showing no rules

# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

The above output shows chain headers. As you see, there are no rules in it.

Example 2: Iptables list output showing some rules

When there is a rule to disable ping reply, you have the iptables list output as like the following. You can see the rule in the OUTPUT chain.

# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DROP icmp -- anywhere anywhere icmp echo-request

2. Delete iptables Rules using flush option

When you want to delete all the rules, use the flush option as shown below.

# iptables --flush

After doing this, your iptables will become empty, and the “iptables –list” output will look like what is shown in the example 1.

You can also delete (flush) a particular iptable chain by giving the chain name as an argument as shown below.

# iptables --flush OUTPUT

Monday, March 15, 2010

Mysql Database showing 0MB disk usage

If your Mysql DB are showing 0MB disk usage in cPanel then do the following things.

vi /var/cpanel/cpanel.config

find
"disk_usage_include_sqldbs"

change the value from 0 to 1

and run
#/scripts/update_db_cache

Issue should be fixed :)

Regards
Ninad

Monday, March 1, 2010

IndianVPS | UK & US SERVERS | 24X7 SUPPORT | Free Transfer

Indian VPS is one of the world's top web hosting companies with large number of hosted domains. We have dedicated staff to provide you superior support around the clock.

cPanel and Plesk
Free Transfer
24X7 Support
99.9% Uptime Guarantee
Location available :: London and Washington DC

15% Discounts on all VPS Plans.

www.indianvps.com

Friday, January 8, 2010

Increase inodes from virtuozzo node

vzctl set VE_ID --diskinodes BARRIER:LIMIT --save

Where VE_ID is your VPS ID and
BARRIER:LIMIT will be the limit of your inodes.


Regards,
Ninad

Wednesday, November 11, 2009

How To Add An IP Address from SSH

cd /etc/sysconfig/network-scripts

In this directory, you will find some files that begin with “ifcfg-”. There will be one file for each of your physical network adapters and one file for each of your virtual adapters. In my case, the existing script files are:

  • ifcfg-lo => this is the loopback interface
  • ifcfg-venet0 => this is my one and only physical adapter
  • ifcfg-venet0:0 => virtual adapter #1
  • ifcfg-venet0:1 => virtual adapter #2
  • ifcfg-venet0:2 => virtual adapter #3
  • ifcfg-venet0:3 => virtual adapter #4

So now what you need to do is to either copy an existing configuration file (if you have one of course) or create a new one. The new configuration file name must include the number of the virtual adapter. So supposing you want to add a fifth IP address from an existing script, you would issue:

# cp ifcfg-venet0:3 ifcfg-venet0:4

Next you will need to edit this file so that it contains your new IP address. You can use “vi” to do so.

DEVICE=venet0:4
ONBOOT=yes
IPADDR=192.168.0.4


Now you’ve got a new IP address and cPanel is running fine but there’s one more step to go.

Although you’ve added a new IP address at the operating system level, you now have to make it available for cPanel. Log in WHM as root (http://www.yourserver.com:2086) and click on Add a new IP address from the IP Functions menu.

Now simply enter the new IP address with the subnet mask 255.255.255.255 and hit the “Submit” button.

So that’s it! You’ve now got an additionnal IP address available for your web server.



NETMASK=255.255.255.255

Of course you’ll have to change 192.168.0.4 for your new IP. Save the file when you’re done.

To activate the new virtual adapter, issue this command:

# /etc/init.d/network restart

To make sure your new virtual adapter has been activated, use the “ifconfig” command. You should see the new adapter configuration details at the end.

At this point, the new IP address should be working but now cPanel will be deactivated. To re-activate it, simply issue this command:

/usr/local/cpanel/cpkeyclt

Saturday, November 7, 2009

ip_conntrack table full, dropping packet error

If you are getting error
kernel: ip_conntrack: CT 87726*: table full, dropping packet.

Generally, the ip_conntrack_max is set to the total MB of RAM installed multiplied by 16.

You need to increase
ip_conntrack


# echo 37072 > /proc/sys/net/ipv4/ip_conntrack_max
This will increase ip_conntrack number to 37072

Command to check the current count
# cat /proc/sys/net/ipv4/ip_conntrack_max

To make this persistent you have to add a line like
‘net.ipv4.ip_conntrack_max=37072′ to /etc/sysctl.conf


Thanks
Ninad

Thursday, November 5, 2009

How to increase quotaugidlimit in a vps from NODE

# vzctl set 100 --save --quotaugidlimit 1000

101 will be your VPS ID

To apply changes it is required to restart VE:
# vzctl restart 100




Thanks
Ninad

Tuesday, November 3, 2009

Install YUM from VZ Node

Run this command from node
#vzpkg install VEID -p yum

VEID will be your VPS ID.



Thanks
Ninad

Monday, November 2, 2009

Features of Apache 2.2

Please check
http://httpd.apache.org/docs/2.2/new_features_2_2.html

Install mod_xsendfile

mod_xsendfile is a small Apache2 module that processes X-SENDFILE headers registered by the original output handler.

If it encounters the presence of such header it will discard all output and send the file specified by that header instead using Apache internals including all optimizations like caching-headers and sendfile or mmap if configured.

It is useful for processing script-output of e.g. php, perl or any cgi.


Download from source

wget http://tn123.ath.cx/mod_xsendfile/mod_xsendfile-0.9.tar.gz

Compile and install

apxs -cia mod_xsendfile.c


Restart apache


Works in apache2.2


Thanks

Ninad

Sunday, November 1, 2009

SSHD Failed

If you are getting error while starting ssh

sshd dead but subsys locked

Do the following

remove /dev/null
and then: "mknod /dev/null c 1 3"

this will create the /dev/null and sshd should start as normal.


Thanks
Ninad

GeoIP installation for Linux

Download the current GeoLite Country, GeoLite City and Organization (AS Numbers) databases


wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz

Create GeoIP data directory if it doesn't already exist

if [ ! -d /usr/local/share/GeoIP ] ; then
mkdir /usr/local/share/GeoIP
fi

Move data files to directory and unzip.

mv GeoIP.dat.gz /usr/local/share/GeoIP/
gunzip /usr/local/share/GeoIP/GeoIP.dat.gz

mv GeoLiteCity.dat.gz /usr/local/share/GeoIP/
gunzip /usr/local/share/GeoIP/GeoLiteCity.dat.gz

mv GeoIPASNum.dat.gz /usr/local/share/GeoIP/


Install the GeoIP program.


There are two options:

  1. Install a C program and a Perl program
  2. Install just a Perl program.

Option a) will provide the fastest performance.

The instructions for a) are known to work using Fedora Core 6 - FC6.

  1. Install GeoIP C API http://www.maxmind.com/app/c

Download the GeoIP-*.tar.gz file, uncompress it and compile.


wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.5.tar.gz
tar -xvzf GeoIP-1.4.5.tar.gz
cd GeoIP-1.4.5

./configure
make
make check

2007-10-10: Thanks to James Rice who notified us of version 1.4.3. 2007-02-21: Thanks to Daniel Wallace who notified us of version 1.4.2. 2007-01-13: Thanks to Daniel Wallace who notified us of version 1.4.1. 2006-09-25: Thanks to Oleg Nerus who notified us of version 1.4.0. 2006-05-21: Thanks to Florian Burka who notified us of the availability of version 1.3.17.

With a text editor, add the directory libGeoIP.so was installed in, i.e. /usr/local/lib, to /etc/ld.so.conf, and execute ldconfig

  1. Install Geo::IP Perl Module

Download the Geo-IP-*.tar.gz file, uncompress it and compile.


wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.35.tar.gz

tar -xvzf Geo-IP-1.35.tar.gz
cd Geo-IP-1.35

perl Makefile.PL LIBS='-L/usr/local/lib'
make
make test

Option b) (in lieu of option a!)

PurePerl Module (is slower, but does not require C library). Download latest Geo-IP-PurePerl-*.tar.gz file, uncompress and compile. Replace the version below with the current version.

wget http://www.maxmind.com/download/geoip/api/pureperl/Geo-IP-PurePerl-1.17.tar.gz tar -xvzf Geo-IP-PurePerl-1.17.tar.gz -C /usr/local/src/ cd /usr/local/src/Geo-IP-PurePerl-1.17 perl Makefile.PL make make test make install

Update your awstats.mysite.conf configuration file

Look for the following geoip LoadPlugin options in your AWStats configuration file. Update them with the full path to each of the two database files.

LoadPlugin="geoip GEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat"
LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/local/share/GeoIP/GeoLiteCity.dat"


LoadPlugin="geoip_org_maxmind GEOIP_STANDARD /usr/local/share/GeoIP/GeoIPASNum.dat"



sudo make install

sudo make install



gunzip /usr/local/share/GeoIP/GeoIPASNum.dat.gz


Source : Antezeta


Friday, October 30, 2009

How to take backup of your mysql database

To backup your database.

# mysqldump database_name > backup.sql

For example ninad_ninad is the database name
command will be

#mysqldump ninad_ninad > ninad_ninad_old.sql

backup created in ninad_ninad_old.sql

Now restore it

first create an emtpy database
#mkdir ninad_ninad

Correct ownership
#chown mysql.mysql ninad_ninad

#mysql databasename < backup.sql
it will be
#mysql ninad_ninad < ninad_ninad_old.sql


Thanks
Ninad

Thursday, October 29, 2009

How to check suPHP version

To check suPHP version

Run the command

find / -name suphp

Once you have found the binary, run the following:

/path/to/suphp

It should produce a result along the lines of:

suPHP version 0.6.3


Thanks
Ninad


View My Stats