Tag Archive 'apache'

Linux Hosting: A Fine Point Overview

In your mission to find a website provider, you will notice that many companies offer what is know as Linux-based hosting. This article will detail the finer points of this option and how it can be used to create and maintain dynamic web sites. We will also shed a bit of light on the Linux operating system in general and why it is the preferred choice by many users.

History

Linux is essentially a variation of the Unix operating system. It was created in 1991 at Finland’s University of Helsinki by a student named Linus Torvalds. Torvalds came to develop Linux while working on a non-commercial replacement version for Minux, a smaller Unix-like system. Linux was originally intended for academic use but evolved into something much more useful.

Since it was developed under the GNU Project’s General Public License, the source code of Linux is freely available. While the goal of the GNU Project was to develop and distribute free Unix compatible software, the Linux operating system itself is not free, only the source code for the kernel and most of it’s software. Linux developers and third-party vendors can charge a fee for it as long as the source code is freely available.

Web Hosting

Just as with any provider, before choosing a Linux host, you should first determine the needs of your website. Many ISPs (Internet Service Providers) will offer a Linux-based hosting plan for a very reasonable price. This option presents you with a wide range of software applications that can be used to enhance the presentation and functionality of your site. The most common configuration of this type of hosting is known as a LAMP platform, consisting of a Linux operating system, an Apache web server, a MySQL database and PHP, Perl or Python scripts.

The LAMP configuration offers a number of components that can be used to support and run a website or a server. When put into action, it defines server infrastructures and a paradigm for developing software. LAMP is so widely used because the Linux system itself is so affordable.

The Apache server is what provides access to websites on the internet and is available for both Linux and Unix systems. It is currently the most widely used server today. MySQL is the database management system that adds ease to building a website. It actually functions as a server and is a multithreaded, multi-user system that grants users with access to their databases. MySQL is the most popular database management system and is said to have more than 10 million installations. The programming languages used in LAMP are typically either PHP, Perl or Python. These scripts are used to create object-orientated web pages and can also be used on Windows-based platforms as well.

The Linux system itself is capable of many things such as networking, software development and functioning as an end-user platform. It works with almost any kind of hardware from the basic AMD and Intel products to more obscure names such as Digital Alpha, PowerPC and Silicon Graphics. Due to its low cost and high-level of functionality, Linux has become one of the most popular operating systems and web hosting platforms outside of Windows.


htaccess for Password Protection - cPanel Tutorial Ch.9

Hypertext Access or htaccess was originally created as a default name of the Apache server directory configuration file.  Its purpose is to provide the power to customize directories of a server’s primary configuration file.  These directives are all required to be in .htaccess context and can only be used with the correct command lines.  The .htaccess file controls not only the directories it was created in, but all subdirectories within it as well.

As one of the most effective configuration files, htaccess is rather critical to your website.  Keep in mind that the most minimal syntax error, such as an omitted space, can result in the malfunction of your server.  It is very critical to use MySQL or PHPMyAdmin to backup your website, this includes any original .htaccess files.  Any changes that need to be made to .htaccess can easily be made within your cPanel.  We will get to that a little later.

When it comes to using the .htaccess file, options within your web hosting server seem unlimited.  With great power also comes great responsibility and risks.  By making one small mistake with the .htaccess file you run the chance of making your whole site dysfunctional.  The best way to manage your .htaccess files is certainly through the cPanel.  Your advanced administrative area will write the files out for you and is typically a safer method opposed to editing them on your own.

Many benefits come along with the .htaccess file, but protection is perhaps its most famed area.  
Password protecting your directories and website can be done several ways yet is easily managed by way of the cPanel. Here is a perfect example:

- First log into your cPanel
- You will then find the htacess/htpassword creator tool on the page.  From there you will create a username and password you would like to use for the designated directory.  
- Click on the “create file” tab
- You will then create two files, .htaccess and htpasswd

The first box on the tool page will then read something like this:

AuthName “Password Protected Directory”
AuthType Basic
AuthUserFile /your/server/path/.htpasswd
require valid-user

The AuthName field is something that may be changed as this will translate a prompt that asks for a user’s credentials.  You may wish to type in “You Must Be Logged In To Do That” or “Password Protected Area”.  You must change the AuthUserFile path and assure that the modified location is placed above the documentroot.  Refer to the example below.  

/home/username/www/secure/ - secure folder
/http://www.domain.com/secure/ - accessing domain
/home/username/www/ - where all files are served from
/htpassword: /home/username/passwords/ - the storing of our password

This is how our .htaccess file would now translate:

AuthName “Password Protected Directory”
AuthType Basic
AuthUserFile /home/username/passwords/.htpasswd
require valid-user

From the second box of the page you will copy then paste this code into the new htpasswd file.  This normally takes no longer than two to three minutes to complete after the first trial, a fairly simple process that adds great protection for your website.


htaccess Blocking - cPanel Tutorial Ch.10

Apache web hosting servers have designed a number of configuration tools to assist the user in administrating their site.  Few of them have more purpose and functions than the little file by the name of .htaccess.  This file is powerfull when changes are made within it, giving users the freedom to override default functions of their web hosting server.

As a mere ASCII text file htaccess can be evolved to perform many operations.  We previously learned that this file can password protect the directories of your website.  It also has the ability to redirect users to a different location or block IP’s or certain domains.  

WHY BLOCK WITH .HTACCESS?

There is an endless amount of sites hosting blogs and member forums on the net.  These websites are frequently targeted by an equal amount of computer hackers and spammers.  Coming up with a solution to this never ending problem has been ongoing since the internet’s introduction. .Htaccess is great tool that limits this activity and gives you a bit more privacy.

You may have observed the fact there is no prefix for this file; it simply starts with a period and is then followed by the letters htaccess.  This means that it will typically be stored as a hidden system file.  Hidden system files can easily be unveiled via the manager page of your cPanel.  Since not all web hosting servers will allow the use of .htaccess, it is certainly best to check company regulations before proceeding.

HTACCESS vs THE CPANEL

While .htaccess files can be activated in via your cPanel there has been a debate on whether you should use them or not.  Being that .htaccess is such a sensitive file that could inadvertently shutdown a website it should only be used when absolutely required.  The IP Deny Manager feature of cPanel was one designed to work similar to .htaccess.   

Just like .htaccess the IP Deny Manager allows users to block IP addresses and domains from entering your website.  If there is an IP address or domain you wish to block from your website it can simply done within the cPanel:

- First log into the cPanel account
- Find the “site management” tab and click “IP Deny Manager”
- Locate “Add IP Deny” then type in the address you have chosen to block
- Click the “Add” button

From there your IP Deny Manager has been set.  The online hecklers you have singled out will never have access to your site again unless you choose to lift the ban.  Your htaccess file helps in the removal process, or you can simply select the IP from a drop down page in the IP Deny Manager and manually lift the ban.   
One of the main reasons you may want to block an IP is due to the content of your site being stolen.  While the .htaccess file is a great way to prevent this activity, the cPanel also has a reliable feature that works on its own in the IP Deny Manager.