WEB HOSTING UK CPANEL WEB HOSTING
MANAGED DEDICATED SERVERS WINDOWS WEB HOSTING
WINDOWS ASP.NET MSSQL ECOMMERCE HOSTING
VIRTUAL PRIVATE SERVERS PHP MYSQL LINUX HOSTING
MS SQL MS ACCESS ASP .NET WHM CPANEL RESELLER HOST
LINUX WINDOWS WEB HOSTING ECOMMERCE SHOPPING CART
OSCOMMERCE AGORA ZEN CART BUSINESS WEB SITE HOSTING
PERSONAL WEB SITE HOSTING DOMAIN NAME REGISTRATION

April 2007


Web Hosting

Today most of the sites are based on CSS. There are many reasons why CSS have become so popular some of them are easy maintenance of website, clean html code, easy updates, increase download speed, reduce bandwidth and most important improves search ranking ;
You must be wondering how it helps in ranking? Here’s the explanation….

Generally a page of site get index when the spider/bot of search engines crawls content of that page, When a search engine, such as Google, sends a spider to crawl your website, it looks through the code of your webpage they actually read certain elements of your HTML code. Certain HTML code holds more weight than other tags. So it is necessary to have a clean and readable code which is easy to understand by spiders, if there are unnecessary text and tags in your HTML file, spiders will have to struggle to understand that page is related to a particular search keyword. Using CSS you will be able to change the code layout without destroying the actual visual layout and will get an clean html code which will result to better search engine rankings.
eg .

You can easily make the main content of your site to show up above the header or navigation menu in the code of your website; thus will help to show search engine crawlers the importance of your content.

Today major search engines such as: Google, Yahoo and MSN loves to see your content; the text, not the clumsy code. Using CSS you can have pure and clean food for spiders.

You normally switch between shells to gain extra functionality; each shell is having it’s own flavor; so if you do decide to change your shell you must be very careful otherwise it may cause you a lot of hassle.

Before switching to new shell please check if it is present in /etc/shells, if this file does not exist, get it added by your administrator with required shell script.

A normal user may only change the login shell for her own account, the super user i.e. root user may change the login shell for any account.

Procedure :

For changing your shell you use a command chsh which will change your shell.

Syntax ;

chsh -s {shell-name} {user-name}
here -s {shell-name} : Specify your login shell name (full path of the shell you want to use )
{user-name} : It is optional, useful if you are a root user.

You will have to provide password when prompted and your shell will get changed. Remember you new shell will get activated next time you log in. Executing the chsh command will not change the shell you are currently running.

eg ;

*) You have root access and you want to change the shell of user kim to /usr/bin/ksh,
you will fire the command as ;
chsh /usr/bin/ksh kim.

Bash is a default shell on most of the Linux operating system, you should be aware of all the keyboard shortcuts to avoid typo mistakes.

Following is the list of shortcuts which will save your precious time;

#) Using Ctrl combination :

ctrl+a : jump to beginning of line you are typing on ;

ctrl+b : moving back a character ;

ctrl+c : terminate the command;

ctrl+d:delete character at cursor;

ctrl+D : exit the current shell;

ctrl+h : delete character before cursor ;

ctrl+e : jump to end of line you are typing on ;

ctrl+f : move forward by one character ;

ctrl+l : clear the screen :

ctrl+K : clear the line after cursor ;

ctrl+H : works as backspace ;

ctrl+t : transpose 2 characters ;

ctrl+xx : move between end-of-line and current cursor position ;

ctrl+r : search the history backwords ;

ctrl+w : erase word before cursor ;

ctrl+x@ : shows possible hostname completions;

ctrl+y : recover previous deletion ;

ctrl+z : suspend/stop the command which is running ;

#) UsingAlt combination :

Alt + > - Move to the last line in the history ;

Alt + ? - Show current completion list ;

Alt + * - Insert all possible completions ;

Alt + / - Attempt to complete filename ;

Alt + . - Yank last argument to previous command ;

Alt + b - Move backward ;

Alt + c - Capitalize the word ;

Alt + d - Delete word ;

Alt + f - Move word forward ;

Alt + l - Make word lowercase ;

Alt + n - Search the history forwards non-incremental ;

Alt + p - Search the history backwards non-incremental ;

Alt + r - Recall command ;

Alt + t - Move words around ;

Alt + u - Make word uppercase ;

Alt + back-space - Delete backward from cursor ;

#) Using Esc combination :

esc+d : delete word ;

esc+f : move forward a word ;

esc+b : mmove backward a word ;

esc+t : transpose two adjacent words ;

#) Using Tab combination :

*)Press tab twice to see all available commands;

*)Press tab twice after a word to view all commands starting with that word ;

*)Pressing ~along with hitting tab 2 times will give you list of all user on system from /etc/passwd;

*)Pressing $along with hitting tab 2 times will show you all sys variables ;

*)Pressing / along with hitting tab 2 times will give you entire directory structure including hidden ;

#) Some extras :

*) To complete a command you can hit the tab key after typing one or more letters of a command.

*) you can use ! along with first few character of previous command to get previous command fired;

eg; if you have used ifconfig sometime back then you can use !if to fire that command once again.

Understanding cURL :

It is a command line tool used for transfer of your file with URL from or to a server, using supported protocols such as (FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE and LDAP)
This command is designed to work if you don’t want user interaction ie to automate unattended file transfers or sequences of operations; Just fire the command with proper parameters and sit aside. You can view the status of process at any time as cURL normally displays a progress meter during operations, indicating amount of transfered data, transfer speeds and estimated time left etc.

However if you invoke curl to write some data at some terminal then this progress meter gets disable otherwise it would mess up the output mixing progress meter and response data.

The URL syntax is protocol dependent if you don’t specify any protocol cURL will take it as HTTP by default. Curl will attempt to re-use connections for multiple file transfers, so that getting many files from the same server will not do multiple connects this improves transfer speed.

Wine : It is an open source implementation which allows people to run some Windows program on Linux. The Wine project was started in 1993 as a way to support Windows 3.1 programs running on Linux.

Wine can be think as a compatibility layer for running Windows programs on unix/linux. Wine does not require Microsoft Windows, as it is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code.

Wine provides both a development toolkit for porting Windows source code to Unix/linux as well as a program loader, allowing many unmodified Windows programs to run on linux, FreeBSD, Mac OS X, and Solaris.

Benefits of using Wine :

*) If you are much dependent on windows application and you want to implement them on your Unix/Linux box it is possible using Wine; you will enjoy windows flavor with Unix Stability, flexibility, remote administration etc…
*) Wine makes it economical to use thin clients: simply install Wine on a Linux server, you can access these Windows applications from any X terminal.
*) Wine is Open Source, so you can edit-extend code as per your need giving you a customize application.

As the popularity of Linux has been increased tremendously, webmaster want their windows application to run on linux so many companies have took initiative for building and selling fine tuned version of wine. In future most big companies would have to release a Wine version of their product to make it for linux lovers; if it was meant for windows.

One of the latest example of implementation wine is by Google; It has used wine for it’s popular Windows Picasa photo editing to work on linux.

Definitely there is bright future for wine….

Using higher SSH listening port number :

Generally hacker uses port scanner software to see whether hosts are running an SSH service. SSH listens for connections on port 22 so it’s wise to change the SSH port to a number higher than 1024 because most port scanners softwares don’t scan high ports securing your ssh service.

You can implement this by editing sshd_config file as :

*) Open the /etc/ssh/sshd_config file and look for the line that says:

Port 22

Change the port number (higher than 1024)
and restart the SSH service:/etc/init.d/ssh restart

Using SSH protocol 2

ssh has two protocols it can use namely SSH1 and SSH2 protocol. SSH protocol 2 is much more secure as compare to protocol 1; you should make following changes in your sshd_config

Edit /etc/ssh/sshd_config and look for the line that says:

Protocol 2,1

Change the line so it says only protocol 2.

Allowing only specific users to log in via SSH

Securing root access is most important step for your server security.You should not permit root logins via SSH as if anyone gets root login for your system, he can do more damage than if he gains normal user login so it’s better to configure SSH server so that root user is not allowed to log in. To do this you have to edit sshd_config file in following way;

Find the line that says:

PermitRootLogin yes

Change option “yes” to “no” and restart the service.

You can then log in with any other defined user and switch to user root if you want to become a superuser.

It is wise to create a dummy local user with absolutely no rights on the system and use that user to login into SSH. That way no harm can be done if the user account is compromised.

If you want only certain users should be able to log in via SSH then you can specify all of them in your sshd_config file For example, you want to allow users anze, dasa, and kimy to log in via SSH, you have to edit your sshd_config file and insert all users at the end of this file;

AllowUsers anze dasa kimy

Using TCP wrappers to allow only specific hosts to connect;

If you want only specific hosts on a network to be able to connect to your SSH service, and don’t want to use or mess up your iptables configuration then you can use TCP wrappers; Here you will make a rule to allow only specific hosts on your local subnet.

By default TCP wrappers first look in the /etc/hosts.deny file to see what hosts are denied for what service. Next, TCP wrapper looks in /etc/hosts.allow file to see if there are any rules that would allow hosts to connect to a specific service. You have to create a rule like this in /etc/hosts.deny:

sshd: ALL This means that all hosts are forbidden to access the SSH service. Next, create a rule in /etc/hosts.allow to allow only specific hosts to use the SSH service:

sshd: ip addresses of host

sshd: 192.168.1 193.180.177.13 Now only hosts from the 192.168.1.0/24 network and the 193.180.177.13 host can access the SSH service. All other hosts are disconnected before they even get to the login prompt, and receive an error like this:

ssh_exchange_identification: Connection closed by remote host

Time-locking SSH session;

You can use different iptables parameters to limit connections to the SSH service for specific time periods. You can use the /second, /minute, /hour, or /day switch.

*) In the first example, if a user enters the wrong password, access to the SSH service is blocked for one minute, and the user gets only one login try per minute from that moment on:

~# iptables -A INPUT -p tcp -m state --syn --state NEW --dport 22 -m limit --limit 1/minute --limit-burst 1 -j ACCEPT

~# iptables -A INPUT -p tcp -m state --syn --state NEW --dport 22 -j DROP

*) In a second example, iptables are set to allow only host 193.180.177.13 to connect to the SSH service. After three failed login tries, iptables allows the host only one login try per minute:

~# iptables -A INPUT -p tcp -s 193.180.177.13 -m state --syn --state NEW --dport 22 -m limit --limit 1/minute --limit-burst 1 -j ACCEPT
~# iptables -A INPUT -p tcp -s 193.180.177.13 -m state --syn --state NEW --dport 22 -j DROP.

Note : ( After changing all required settings at /etc/ssh/sshd_conf you need to restart your ssh server daemon using : /etc/init.d/ssh restart ; in order to make all changes effective.)