Tag Archives: Apache

How to generate passwords for .htpasswd using PHP

In my earlier post about .htaccess I had described about authentication using .htaccess and command to generate .htpasswd file. However, when we want to add passwords for many users that method will take too long, since we will have to add passwords for each user one at a time. However, there is an easier way to generate the .htpasswd file using PHP. In this post I will show the different algorithms which can be used to generate the .htpasswd file.
Read more »

How to hide apache information with ServerTokens and ServerSignature directives

In default Apache configuration, the server sends HTTP Header with the information of Apache version, modules, Operating System, etc of the Server. The HTTP response header “Server” displays all these details of the server. This information can be used by hackers to try to exploit any vulnerabilities in the Apache, OS or other modules you are running, specially if you are running an older version with known vulnerabilities.

Sample HTTP Response Header:

HTTP/1.1 200 OK
Date: Sun, 10 Feb 2012 07:24:47 GMT
Server: Apache/2.2.17 (Win32) PHP/5.2.17
Vary: Accept-Encoding,Cookie

Read more »

more .htaccess tips

In my previous post .htaccess tips I had started with what is .htaccess file and some things that can be done using it. In this post I’ll cover more about .htaccess files.

Topics Covered:

Read more »

.htaccess tips

Topics Covered:

What is .htaccess file?

.htaccess file is used on Apache Web Server to make configuration changes on per-directory basis. This file contains the configuration directives and are applied to the directory and all its sub directories. The configuration directives in .htaccess files may overwrite the directives in any .htaccess file found higher up in the directory tree and even the main server configuration.

To enable use of .htaccess file the AllowOverride Directive has to be set in the Apache Server configuration.

Read more »

Creating multiple virtual hosts/websites in Wampserver

To create multiple websites, it would be helpful to have each website setup on the local computer. With Wampserver (or just Apache) we can easily configure multiple websites. Following are the steps to create multiple websites using Apache’s configuration. This uses Apache’s “Named Virtual Hosts” configuration. I have tested these steps on Wampserver 2.1 running on Windows XP and Windows 7.

Read more »