Create .htaccess Files Online

The .htaccess Editor allows you to easily create .htaccess files online. This is a great service for beginners just starting out or a seasoned developer looking to save some time. .htaccess files are not only very useful and helpful, but they are often essential for websites hosted on a shared host. Unfortunately they are somewhat cumbersome to understand. There are a lot of websites and references available to help you understand the files and syntax and available features, but this website makes it east by creating the syntax for you. I have listed the features available below.

Features

  • Deny all access to files
  • Basic authentication
  • Error page
  • Default page
  • Setup WWW
  • Redirect directives
  • Access restriction

The form is very easy to understand, which allows you to get started right away. Once you fill in the form, it will write the appropriate entry you will need in your .htaccess file. Not only is it easy to use, but it is a learning resource as well. You can gain an understanding for .htaccess files by simply looking at what is created by the form based on your parameters. Once you have created a few of these files, you won't need a lot of help in creating future files. But for now, take advantage of this great tool.

All-In-One Web Server Installation Packages

A traditional web server is made up of many different components, including an http server, mail server, FTP server, and more. In days gone by, a webmaster would install each software package individually to get a custom web server up and running. These kinds of server setups offer many advantages, including testing, learning, and being able to have total control over the web server environment. Today there are many different options available that bundle each component into an easy single installation package.

The installation packages are basically split into two main categories, WAMP (Windows Apache MySQL PHP) servers and LAMP (Linux Apache MySQL PHP) servers. As you can see, they are installation packages that include the Apache httpd server, the MySQL database server, and PHP installed on either a Windows machine or a Linux/Unix machine. There are many different WAMP/LAMP installation packages available that contain the 4 major components, as well as other software to make a more full featured web server. These packages can vary slightly, while meeting the general requirements for running a web server. I have listed some of the most common packages available below.

WAMP

  • Apache2Triad - This package includes an incredible list of features. It installs Apache with mod_python, mod_ssl, mod_perl, OpenSSL, and AWStats, MySQL with phpMyAdmin, PostgreSQL with pgAdmin and phpPgAdmin, xmail with PHPXMail and UebiMiau, SlimFTPD with PHPsFTPd, PHP with Pear and Smarty, Perl with CPAN, and Python with Spyce and wxPython.
  • XAMPP - This package installs Apache with OpenSSL, MySQL with phpMyAdmin, PHP 4 and PHP 5, FileZilla FTP server, and Mercury Mail Transport System. You can also get Perl and Tomcat as an add-on.
  • WampServer 2.0 - This is the new version of the WAMP5 server. It installs Apache, MySQL with PHPMyAdmin and SQLiteManager, and PHP. It doesn't have all the bells and whistles of the first servers listed, but it is reliable and has the ability to install many different releases of Apache, MySQL, and PHP.
  • The Uniform Server - This package installs Apache, MySQL with phpMyAdmin, and PHP. It also includes SSL capabilities, but I couldn't find what software is used.
  • SpikeWAMP - This package installs Apache, MySQL, and PHP. This version also includes the ability to install popular applications like Drupal, Joomla, Moodle, phpBB, and more. There is also an update channel that allows you to download and install the new beta versions of the applications. This is a nice and easy WAMP installation package.

LAMP

  • XAMPP - This package installs Apache with OpenSSL, MySQL with phpMyAdmin, PHP 4 and PHP 5, FileZilla FTP server, and Mercury Mail Transport System.
  • Apache Toolbox - This package installs one of the largest bundles of applications and mods I have seen; it boasts almost 100 different modules. Some of these include Apache, MySQL, Apache, WebDAV, OpenLDAP, and gd libraries. Take a look at the website to get the full listing.
  • BitRock - This package is based on the BitNami stacks and installs Apache, MySQL with phpMyAdmin, and PHP. There are also some popular applications available for easy installation with BitRock, like phpBB, WordPress, Joomla, and Subversion just to name a few.

What LAMP/WAMP server do you use? Or do you set up all the pieces separately? Let us know in the comments.

Easily Create Custom Error Pages

Chances are we've all been to a web page that no longer exists and have been staring at an error page that looks plain and provides virtually no useful information (other than the warning saying the page no longer exists). That's because Apache has included hard coded error pages in its httpd server, and while they get the job done, the job could be done better in just a few small steps. Custom error pages can be developed to help provide more information about the error, to automatically redirect the viewer to a landing page, and to integrate your site design.

Apache's ErrorDocument Directive can be used to display the default page packaged with the server or show custom error pages tailored specifically for your site. The 5 most common custom error pages used are listed below.

  • 400 - Bad Request
  • 401 - Authorization required
  • 403 - Forbidden
  • 404 - Wrong page
  • 500 - Internal server error

Creating custom error pages can be accomplished simply by creating a web page for each (or one web page accepting dynamic input) and adding a few lines to your htaccess file. I have listed examples for a static page for each error and a dynamic page for all errors below. This code should be added to your htaccess file.

Static Pages

ErrorDocument 400 /error/custom_400.html
ErrorDocument 401 /error/custom_401.html
ErrorDocument 403 /error/custom_403.html
ErrorDocument 404 /error/custom_404.html
ErrorDocument 500 /error/custom_500.html

Dynamic Page

ErrorDocument 400 /error/custom_error.php?error=400
ErrorDocument 401 /error/custom_error.php?error=401
ErrorDocument 403 /error/custom_error.php?error=403
ErrorDocument 404 /error/custom_error.php?error=404
ErrorDocument 500 /error/custom_error.php?error=500

Each of these pages could be stored wherever you like. I used the "error" directory as an example, and you can name the files however you like, using whatever type of file you wish. The ErrorDocument directive allows you to redirect to an external URL as well as a local path.