MyTrueHost launched Web Hosting for Indian clients just in Rs 60/Month with various payment options(netbanking, debit card, credit card,cash card or paypal).
Please Visit at https://www.mytruehost.in

Create an SSH banner.

Adding a banner to your Dedicated Server is extremely easy to do. It is comprised of 2 steps.

1.) Edit your sshd_config file located at /etc/ssh/sshd_config and add the folowing line:

Banner /etc/banner

2.) Now you need to create this file. Using your favorite editor, just create the new file and put whatever you would like your users to see when they attempt to login to your Dedicated Server.

Here is an example:

This computer system is for authorized users only. All activity is logged and regulary checked by systems personal. Individuals using this system without authority or in excess of their authority are subject to having all their services revoked. Any illegal services run by user or attempts to take down this server or its services will be reported to local law enforcement, and said user will be punished to the full extent of the law. Anyone using this system consents to these terms.

 

How to install LAMP (Apache, MySQL and PHP in Linux) using Yum

There are many ways to install Lamp in Linux server but following is the easiest way to install using yum

First Go in http://www.centos.org/ and download latest copy of centos

Once you installed CentOS on server from shell type following commands
yum install httpd

Above command will install apache server then install php using following command.

yum install php

once you install php install MySql using following command

yum install mysql-server mysql

then restart services

service httpd start

service mysqld start

Once both services is running, you can check it by browser http://localhost and you should see a welcome page from CentOS

To test if php is running or not using phpinfo page

go to /var/www/html and create index.php and add following code

<?php phpinfo(); ?>

Once this done refresh your browser you will see the phpinfo page.

 

how to install geoIP

You just need to fire following command on cpanel server to install geoIP.

pecl install GeoIP

While installation you may get the following error.

checking for re2c version… invalid
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk… gawk
checking for geoip support… yes, shared
checking for geoip files in default path… not found
configure: error: Please reinstall the geoip distribution
IF you got the above error then you need to install
Geoip C API from this link http://www.maxmind.com/app/c
and then you need to install mod_geoip from this URL
http://geolite.maxmind.com/download/…pi/mod_geoip2/


Once you install this then proceed with this command pecl install GeoIP

 


 

Disable IPV6 on linux server.

For security reason its always better tio disable IPV6 on Linus server, as IPV6 traffic is not filter by server firewall. Refer following steps to disable IPV6.

Login in to server as root user and open networking file.

root@server[~]#pico /etc/sysconfig/network

Add following two lines in the end of network file.

NETWORKING_IPV6=no
IPV6INIT=no

save network file  and restart network service or simply reboot server to implement changes

 

How to check server 32 or 64 bit?

Its very common issue, every new techie not sure about server bit at that time simply run following command to get bit information.

getconf LONG_BIT

 

Three steps to mount remote directory on Linux Server

We can mount the remote directory on the Linux Server by using the following three simple commands only.

Login in to the server as a root user and run the commands one by one and make sure that you are using your own remote server ip instead of our test server ip198.168.0.2

yum install fuse-sshfs

The above command will install the fuse-sshfs

Create the mount directory where you want to mount the remote directory.

mkdir /mnt/remotemount

Now mount the remote directory make sure that you are using the correct remote directory server ip and root password

sshfs root@192.168.1.2:/the_physical_path_which_you_are_mounting  /mnt/remotemount

Now check the mount point

mount

If you want to remove the mount point then use the following command

umount /mnt/remotemount

If above command shows the error “mount point busy” the use the following command

umount -l /mnt/remotemount

 

/scripts/fixquotas gives error “edquota: Quota file not found or has wrong format”?

After running /scripts/fixquotas it gives following error message and showing unlimited disk space in WHM >> Main >> List account.

root@server [/]# /scripts/fixquotas –force
Installing Default Quota Databases……Done
Linux Quota Support
Quotas are now on
Resetting quota for user23 to 1000 M
edquota: Quota file not found or has wrong format.
No filesystems with quota detected.
edquota: Quota file not found or has wrong format.
No filesystems with quota detected.
Resetting quota for user2 to 1000 M
edquota: Quota file not found or has wrong format.
No filesystems with quota detected.
Resetting quota for dates to 1000 M
Resetting quota for userq to 1000 M
edquota: Quota file not found or has wrong format.

In this case refer following steps.

root@server [/]#touch /home/quota.user
root@server [/]#touch /home/quota.group
root@server [/]#chmod 600 /home/quota.user
root@server [/]#chmod 600 /home/quota.group

root@server [/]#quotacheck -acugv

Some time above command gives error message

root@server [/]# quotacheck -acugv
quotacheck: Cannot remount filesystem mounted on / read-only so counted values might not be right.
Please stop all programs writing to filesystem or use -m flag to force checking.

Than run following command

root@server [/]# quotacheck -acugvm
quotacheck: Scanning /dev/simfs [/] quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
done
quotacheck: Checked 33478 directories and 368211 files
quotacheck: Old file not found.
quotacheck: Old file not found.

Now run

root@server [/]#/scripts/fixquotas –force

It will sort out your issue ENJOY :)

 

How to add nameservers from shell.

Most of the time on cPanel dedicated server we add nameservers from WHM but some time we are not able to access WHM. In that case we can add nameservers from shell by using root login details.

Login in to server as root user and run following commands.

root@server[~]#/scripts/adddns –domain ns1.your_domain.com –ip=111.222.222.1

root@server[~]#/scripts/adddns –domain ns2.your_domain.com –ip=111.222.222.2

You can use your domain name instead of your_domain.com in above command with the respective ips which you want to use for your nameservers.

root@server[~]#service named restart
or
root@server[~]#/etc/init.d/named restart

 

Install GIT on cPanel server.

We can install the GIT on the cPanel server by using the yum.

Login in to the server as root user and run the following command.

yum –disableexcludes=main install git -y

 

Secure Joomla site.

To avoid Joomla site to be hacked follow the following steps.

Disable RG_EMULATION for Joomla. When this option is enabled even the latest Joomla is

vulnerable to some variable injections. It can be disabled by placing the following line in

your configuration.php:

if(!defined(‘RG_EMULATION’)) { define( ‘RG_EMULATION’, 0 ); }

————-
Secure your administrator’s area. This will first prevent simple brute-force attacks. Along

with that, all components and modules’ code inside this directory will be safe. For this

purpose:

– Place an .htaccess inside Joomla’s ‘administrator’ directory. It should contain:

Deny from all
Allow from YourIP*

In case your IP changes, you should try securing the directory with Password Protection

If you are using PHP 5.2, make sure that the directive ‘allow_url_include’ is set to off;

If you are using PHP version below 5.2, make sure that the directive ‘allow_url_fopen’ is

set to off.