What is Apache Handler?

Apache is an open source HTTP server that is used to serve a web site’s content. It specifies the file types and its extensions that are processed by the server. When Apache recognizes a file, it has an action built in for that particular file type and will perform that action. If Apache wants to do a different action for a particular file type, then it is necessary to make a handler to instruct Apache to perform that action.

Apache can handle CGI scripts and server-parsed files. These files include the file extensions such as .cgi, .pl, .plx, .shtml and .perl. Normally, all the files are served by the server but certain file types are handled separately.

A “handler” is an internal representation of an action which has to be performed when a file is called for an action. Based on the file type, files have implicit handlers. But handlers can also be configured explicitly based on the file extensions, location or without relation to the file type. It is advantageous as it allows both type and handler to associate with a file.

Built-in Handlers:

Handlers can be either built into the server or included in a module or they can be added with Action derivative. The built-in handlers are listed below

  • default-handler – sends the file and handles static content by default.
  • send-as-is – sends the file with HTTP headers as is.
  • cgi-script – handles the file as a CGI Script.
  • IMAP-file – Parses the file as an imagemap rule file.
  • server-info – Gets the configuration details of a server.
  • server-parsed – Parses the server side files.
  • server-status – Gets the report of server’s status.
  • type-map – Parses the file as type-map for content negotiation.

Steps to add a custom Apache Handler:

  1. Log into cPanel.
  2. In the home screen, under ‘Advanced’ section click ‘Apache Handlers’.
  3. Under ‘Create an Apache Handler’, type the name of the handler in the text box.
  4. In the Extension(s) text box, type the required file extension or extensions. Add ‘.’ before the extension name.
  5. Then click Add.

Steps to delete a custom Apache Handler:

  1. Log into cPanel.
  2. In the home screen, under ‘Advanced’ section click ‘Apache Handlers’.
  3. In ‘User Defined Apache Handlers’, a list of custom Apache handlers will be displayed.
  4. If you want to delete any handler, click the red X icon on ‘remove’.
  5. Click Delete Handler to confirm the deletion.

Related Links:

Apache Handler | Apache Handler in cPanel 

Categorized in:

Tagged in:

,